LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-30-2011, 11:58 AM   #1
helyos
LQ Newbie
 
Registered: May 2011
Posts: 28

Rep: Reputation: 3
Virtualization and connectivity to internet


Hello there,

I have a host on ubuntu and i think i would like to virtualize my web-server. So, to be more clear i have for instance the ip 92.124.74.8 to the main server (where virtualbox will be installed)

After i will install the web-server into virtualbox it will have the address 196.168.1.10

So, how can i specify on the main server 92.124.74.8 that all the requests on port 80 to be transfered on 196.168.1.10 (virtual machine). The problem is that on 92.124.74.8 i don't have access to the router/switch.

Is there a possibility to make this forward from the main machine 92.124.74.8 ?

Thank you a lot.
 
Old 05-30-2011, 01:12 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi there,

As I can understand you want http machine requested by the clients to be forwarded to guest machine by the host machine. Can you let us know as to which type of ethernet configuration you are using for guest machine whether NAT or Bridge?

Also it would be good to know which VM solution you are using (Virtual Box or VMware)?

You can forward the http request by enabling IP forwarding on the host machine and then creating a rule in iptables to match the request for http and forward it to guest machine.

I am still interested in knowing the ethernet configuration and VM solution in use and also the guest OS on which you will configure web server :-)
 
Old 05-30-2011, 01:49 PM   #3
helyos
LQ Newbie
 
Registered: May 2011
Posts: 28

Original Poster
Rep: Reputation: 3
T3RM1NVT0R,

Hi and thank you for your response. I have not implemented the "ideea" yet because all these changes must be fast.

So:
On the host machine i will install Virtual Box and the NAT connection between guest os and host os i think it will be good.

In this situation i will have to turn on IP forwarding on the host machine and then do something like this:

Code:
#iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 \-j DNAT --to x.x.x.x:80
?!

Thank you in advance.

Last edited by helyos; 05-30-2011 at 01:51 PM.
 
Old 05-30-2011, 02:47 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi Helyos,

You can setup the connection as per your requirement. NAT is used when you want to share the guest machine IP with the host machine whereas you use Bridge network setting if you want the guest to be directly connected to the physical network.

You can enable the IP forwarding from /etc/sysctl.conf file. Also for more information on iptables you can refer: http://www.yolinux.com/TUTORIALS/Lin...rkGateway.html

iptable instruction that you mentioned looks good to me, just have a query as to why we are using \ before jump target switch.
 
Old 06-01-2011, 09:54 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,323
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
I would suggest using a bridged connection.

If VirtualBox shows several adapter types for the bridge (it would be under the "advanced" itme on the network adapter page), you may have to test each type to find out which adapter type works.

Once the bridge is established, the port forwarding to the virtual machine can be configured in your router, because the virtual machine will be connecting directly to the router via the bridge.

I have not used these settings for hosting purposes, but, with these settings, I have ssh'd and scp'd into a virtual machine on one computer from separate physical computers on my network.

See the attached screen capture.

Last edited by frankbell; 06-28-2014 at 02:32 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Connectivity Via Another Computer magnetar21 Linux - Networking 2 11-03-2007 01:05 AM
Internet Connectivity Issue sdr0715 Linux - General 2 09-28-2005 01:11 PM
No Internet Connectivity laltupi Linux - Networking 1 07-19-2004 10:34 AM
Internet Connectivity is a NO-GO Help Please!! ClericPreston Linux - Newbie 1 06-04-2004 07:36 PM
SUSE 8.0 and Internet connectivity mastahnke Linux - Networking 2 03-06-2003 09:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration