Every now and then I use my guest operating system to a vpn/
So obviousy my nameserver/dns information changes.
Im using NAT'ed host.
Is there an automatic way in VBox to signal the guest OS that it needs to refresh the nameserver/dns information ?
For the time being i have to manually change the resolv.conf but was hoping to see some automatic way of doing it ?
Im on vbox 2.2.0
Any ideas ?
Signal guest to refresh nameserver info when guest via vpn
-
patelbhavesh
- Posts: 17
- Joined: 10. Apr 2009, 05:23
- Primary OS: Debian Lenny
- VBox Version: OSE Debian
- Guest OSses: Linux
- Location: Sunnyvale,CA,USA
- Contact:
-
Perryg
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: Signal guest to refresh nameserver info when guest via vpn
The guest needs to refresh the dns pool not VBox.
You should be able to put something in a cron job for that though.
You should be able to put something in a cron job for that though.
-
patelbhavesh
- Posts: 17
- Joined: 10. Apr 2009, 05:23
- Primary OS: Debian Lenny
- VBox Version: OSE Debian
- Guest OSses: Linux
- Location: Sunnyvale,CA,USA
- Contact:
Re: Signal guest to refresh nameserver info when guest via vpn
Im not an expert on networking, but this is what i have observed.
When a vpn is created a new network interface is used on the guest os like say juniper netwroks which uses the guest OS's.
But as vbox is associated to the NIC of the guest os it does not know that a new network interface like juniper netwroks is created and all traffic is tunneled thru it.
so say for example guest os has ip address as 192.168.1.4 and dns is 67.88.88.xx and then when the vpn connection is made with say juniper network the ip address for junipers interface is 172.xx.xx.xx and the dns and nameserver is 172.134.xx.xx etc so Vbox does not come to know that a new tunnel is created and hence the host os still tries DNS with 67.88.88.xx
So im curious whether is this something Vbox needs to handle or the host os ?
When a vpn is created a new network interface is used on the guest os like say juniper netwroks which uses the guest OS's.
But as vbox is associated to the NIC of the guest os it does not know that a new network interface like juniper netwroks is created and all traffic is tunneled thru it.
so say for example guest os has ip address as 192.168.1.4 and dns is 67.88.88.xx and then when the vpn connection is made with say juniper network the ip address for junipers interface is 172.xx.xx.xx and the dns and nameserver is 172.134.xx.xx etc so Vbox does not come to know that a new tunnel is created and hence the host os still tries DNS with 67.88.88.xx
So im curious whether is this something Vbox needs to handle or the host os ?
-
baf
- Volunteer
- Posts: 829
- Joined: 27. Sep 2008, 06:18
- Primary OS: Mac OS X Leopard
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: linux,xp,win7
- Location: Luleå or Skellefteå, Sweden
Re: Signal guest to refresh nameserver info when guest via vpn
One way is to let your host handle it.
If you are on nat you can set your resolv.conf like this:
I'm not sure if it's VirtualBox or your host that handles it but it works fine for me on Mac OSx at least.
If you are on nat you can set your resolv.conf like this:
Code: Select all
nameserver 10.0.2.3
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
My way: "You live as long as you learn".
-
patelbhavesh
- Posts: 17
- Joined: 10. Apr 2009, 05:23
- Primary OS: Debian Lenny
- VBox Version: OSE Debian
- Guest OSses: Linux
- Location: Sunnyvale,CA,USA
- Contact:
Re: Signal guest to refresh nameserver info when guest via vpn
Thnx i will try it out resolv.conf is handled by the guest os.So im assuming that we are saying that we need to set the DNS and nameserver as the ip address of the host ?baf wrote:One way is to let your host handle it.
If you are on nat you can set your resolv.conf like this:I'm not sure if it's VirtualBox or your host that handles it but it works fine for me on Mac OSx at least.Code: Select all
nameserver 10.0.2.3
Re: Signal guest to refresh nameserver info when guest via vpn
When a VPN is created the new adapter should get all relevant info from the VPN server, plus the default gateway should be adjusted conform the VPN values, if this doesn't happen the VPN server is at fault here.
[This space is intentionally left blank]
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-
-
patelbhavesh
- Posts: 17
- Joined: 10. Apr 2009, 05:23
- Primary OS: Debian Lenny
- VBox Version: OSE Debian
- Guest OSses: Linux
- Location: Sunnyvale,CA,USA
- Contact:
Re: Signal guest to refresh nameserver info when guest via vpn
The VPN adapter is created in the Host OS because thats where im connecting with VPN.All the information for the Host OS is correctly set by the VPN server and Im able to use it without any issues.vbox4me2 wrote:When a VPN is created the new adapter should get all relevant info from the VPN server, plus the default gateway should be adjusted conform the VPN values, if this doesn't happen the VPN server is at fault here.
However the issue is with the Guest OS because the Guest OS continues to have the information of nameservers/dns etc before the vpn connection was made including the ip address which was obtained by the guest os from Vbox.
After the VPN is connected there does not seem to be any automatic way to signal the guest os that something in the layer below VBox , has changed that is a new adapter is being used.
Also note that only name server is a problem becuse i can ping all the machines behind the VPN with their ip address.
Anyways looks like currently the best way is to manually set the value thru a script of the nameserver/dhcp after a vpn connection is established and then restoring it to the previous value after the vpn connection is disconnected.
-
patelbhavesh
- Posts: 17
- Joined: 10. Apr 2009, 05:23
- Primary OS: Debian Lenny
- VBox Version: OSE Debian
- Guest OSses: Linux
- Location: Sunnyvale,CA,USA
- Contact:
Re: Signal guest to refresh nameserver info when guest via vpn
I think i found the answer to this thread.Looks like it is a Windows issue
http://forums.virtualbox.org/viewtopic.php?f=6&t=17383
http://forums.virtualbox.org/viewtopic.php?f=6&t=17383