NAT adapters - Gateway and IP

This is for discussing general topics about how to use VirtualBox.
Post Reply
mirk
Posts: 7
Joined: 29. May 2012, 21:26

NAT adapters - Gateway and IP

Post by mirk »

How can I control what gateway IP and IP that the vm gets? When I use NAT, it makes the gateway 10.0.2.2 with an IP of 10.0.2.15 by default.

Where can I configure those settings in virtualbox so that it is a different network such as 10.0.0.1/255.255.255.0?
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: NAT adapters - Gateway and IP

Post by BillG »

What exactly are you trying to achieve? Are you trying to link the vm to a physical network which uses 10.0.0.1/24? If so you don't use NAT. You change the network type to bridged, and use the physical NIC in the host which is in that network. If the network has a DHCP server, the vm will get its config from there (as the host does).

If you use NAT the IP address and the gateway are supplied by NAT and must be in the same IP subnet as the NAT device in the host.
Bill
mirk
Posts: 7
Joined: 29. May 2012, 21:26

Re: NAT adapters - Gateway and IP

Post by mirk »

No. I am on a 192.168.1.1 network physically but when I use NAT, the virtual machine's gateway is 10.0.2.2 and I want to make it be 10.0.0.1. How can I make the gateway for NAT be 10.0.0.1 on the virtual machines using NAT?

Does that make sense?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: NAT adapters - Gateway and IP

Post by Perryg »

See chapter 9.12 Fine-tuning the VirtualBox NAT engine in your VirtualBox users guide.
mirk
Posts: 7
Joined: 29. May 2012, 21:26

Re: NAT adapters - Gateway and IP

Post by mirk »

Crud :(

I'm trying to study for 70-640 and it gives me example IPs to use for server core and a domain to connect to. By default, I am using:

Domain Controller's IP=10.0.2.15/255.255.255.0 and Gateway=10.0.2.2
Server Core's IP=10.0.2.12/255.255.255.0 and Gateway=10.0.2.2

They are both NAT. They don't see each other in ARP and cannot ping. Forget modifying. Why would they not be able to see each other if they are on the same network with the same gateway and both using NAT?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: NAT adapters - Gateway and IP

Post by Perryg »

Would have been nice to know that you were trying to work on networking/domain. You can't really use VBox NAT for this. Use Internal.

The easiest and for most the best way to use and test Windows domains in VirtualBox
Setup Windows Domain in VirtualBox
mirk
Posts: 7
Joined: 29. May 2012, 21:26

Re: NAT adapters - Gateway and IP

Post by mirk »

Thanks. This is looking to work. I have them both on an internal network, but not ICS because I'm not concerned about internet access right now. They both show up in each other's arp table now too.
Post Reply