Page 1 of 1

How do I route host's connection through guest?

Posted: 30. Aug 2008, 17:00
by artships
Ubuntua 8.04 host, WinXP guest, Virtualbox 1.5.6, installed bridge-utils and uml-utilities.

I have to use the Nortel Contivity client to connect to my company. I can't get any of the sources to compile so I installed the Apani VPN client on the WinXP guest. Works! But once the client is connected, I want to connect to my company's Sun box and run XWindows programs, redirecting the DISPLAY back to my Ubuntu host. I can already run mstsc.exe on the client and login to my company's WinXP box. I can also telnet from guest to my Sun box.

Thinking the solution will involve a bridge, I've given the host an IP of 192.168.1.50, and the guest, 192.168.1.60. After connecting, the client's IP becomes 172.21.7.47, and the client's domain servers become those of my company.

vbox->Settings->Network: Adaptor 0, Host Interface Settings:
Interface name is blank, Setup Application is a script that looks like:

Code: Select all

#!/bin/bash
brctl addbr br0
ifconfig eth0 0.0.0.0 promisc
ifconfig br0 192.168.1.50 netmask 255.255.255.0 up
route add -net 192.168.1.0 netmask 255.255.255.0 br0
route add default gw 192.168.1.1 br0
brctl addif br0 eth0
interface=`VBoxTunctl -b -u username`
ifconfig tap0 up
brctl addif br0 tap0
iptables -I INPUT -i br0 -j ACCEPT
echo "$interface"
exit
The two lines that talk about "interface" arranges for the tunnel id (always 0, so far) to be a parameter to a script which undoes all the networking stuff.

What further do I have to do on the host to interact with the world through the guest?

Posted: 31. Aug 2008, 18:38
by Sasquatch
Well, simplisticly seen, I would say, set it all to bridge, let the Host set an IP in the range of the guest with the Guest as gateway and DNS server. As I'm thinking it out now, I would say create a second HIF and use that as the 'gateway'-interface. Release the IP on the br0 interface so the Host has no other connection to use. Schemetically like this:

Code: Select all

Host br0: no IP         Guest br0: company IP
Host vb0: IP to guest   Guest vb0: shared the vpn connection to
Hope I made some sense.