Page 1 of 1

Set the guest IP with NAT and without port forwarding

Posted: 27. Nov 2009, 11:30
by celine
Hi,

I'd like to change my network to have my guest IP set to 192.168.5.7

I'd made the following change :

Code: Select all

VBoxManage modifyvm "My Guest" --natnet1 "192.168.5/24"
, the network is right but not the IP (fixed to .15)

I've read the command

Code: Select all

VBoxManage setextradata "My Guest" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestIP" 192.168.5.7"
could help, but it seems to work only with port forwarding options. (error msg : configuration query for "HostPort" int failed).

Is this a way to do without using a DHCP internal ?

Thank you very much.

Re: Set the guest IP with NAT and without port forwarding

Posted: 27. Nov 2009, 11:57
by Sasquatch
Why do you want to change it? There should be no real reason to change the NAT IP address. If it is so you can access the Guest directly, don't bother, it won't work. You need Bridged for that. Or at least Host-Only, but the VM won't be accessible by other machines on the network. See the manual, chapter 6. But you probably read it already.

Re: Set the guest IP with NAT and without port forwarding

Posted: 27. Nov 2009, 12:17
by celine
Hi,
Thanks for your answer. I don't need to access the guest directy. I should maybe explain my configuration more precisely :

I have a host on ubuntu which establish a VPN tunnel with the outside (w. openswan) and a guest (win XP with DHCP) which should be "in the tunnel" with the IP of the tunnel. There should be no other communication between the host and the guest.

First I try to implement simple NAT between my host and my guest, not regarding the IP but... my guest is registering on the windows domain's DNS with the IP inside the guest, before the NAT. But this IP shouldn't be seen, I want to be seen with the IP of the tunnel (192.168.5.7)

Second, I try the bridge solution, by fixing the IP inside my guest to the tunnel IP. But it doesn't work either. For some obscure reason, the packets that arrive from the virtualbox don't go into the tunnel (it is working very well on the host). Contacting people from openswan don't work, because it's a problem with virtualbox...

Third, I was thinking about fixing the IP with the NAT (my question), but it doesn't seem to be possible.

Fourth, I have installed a dhcp server on my guest, and wanted to use vboxnet0 to set the IP, but now the IP of the vboxnet interface doesn't answer to ARP request from the guest, and I have no communication possible between these hosts.

I'm quite lost... If someone has an idea... Thanks for reading me so far.