Set the guest IP with NAT and without port forwarding

This is for discussing general topics about how to use VirtualBox.
Post Reply
celine
Posts: 5
Joined: 27. Nov 2009, 11:24
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP

Set the guest IP with NAT and without port forwarding

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

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

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
celine
Posts: 5
Joined: 27. Nov 2009, 11:24
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP

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

Post 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.
Post Reply