Page 1 of 1

Reach Internet with host only networking

Posted: 22. Jan 2011, 19:47
by riprop
Hello,
this is configuration on my laptop at work:

HOST: Ubuntu 10.10, IP = 10.?.?.? from dhcp
GUEST: Oracle En. Linux 5.5 , host only networking, IP = 192.168.56.101

I can reach guest from host on IP=192.168.56.101, and host from guest on IP =192.168.56.1.

I want to use host to reach Internet from guest (so the host is something like gateway), but I'm not so good in Linux networking, routing and so. Can this be done ? How ?

Please do not suggest other solution (like using NAT, bridged or Internal networking in vbox instead of host only networking , or using another adapter in guest,...) !

Thanks in advance ?

Re: Reach Internet with host only networking

Posted: 22. Jan 2011, 19:51
by Perryg
With your restrictions the only thing I see is for you to learn how to use IP tables.

Re: Reach Internet with host only networking

Posted: 22. Jan 2011, 20:00
by riprop
Thanks for trail.
Is Iptables enough, what about routing table ?

I didn't mention (in order to keep question clear/simple/short), but I have two more guests (with IPs 192.168.56.102 and 192.168.56.103), and all they can be reached mutually now, I just want to add Internet to them trough HOST.

Re: Reach Internet with host only networking

Posted: 22. Jan 2011, 20:04
by stefan.becker
One approach is to use a proxy server on the host.

Re: Reach Internet with host only networking

Posted: 22. Jan 2011, 20:08
by Perryg
Google using iptables to route packets It explains it better then I can here. It can do what you want.

Edit: Or as Stefan says use squid, but this approach is limited and sometime restrictive depending on how you set it up.