Common NAT address on 2 VMs: 10.0.5.15

This is for discussing general topics about how to use VirtualBox.
Post Reply
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Common NAT address on 2 VMs: 10.0.5.15

Post by socratis »

OK, from the manual, we have this:
VB 4.3.2 User Manual - Ch. 9.11 wrote:In NAT mode, the guest network interface is assigned to the IPv4 range 10.0.x.0/24 by default where x corresponds to the instance of the NAT interface +2. So x is 2 when there is only one NAT instance active. In that case the guest is assigned to the address 10.0.2.15, the gateway is set to 10.0.2.2 and the name server can be found at 10.0.2.3.
Now, I'm not 100% sure what the "NAT instance active" means. I take it that if you have "x" active net cards (on one or more VMs) then "x" increases by every active card. So, 1st NAT => 10.0.3.z, 2nd NAT => 10.0.4.z, 3rd NAT => 10.0.5.z and so on.

In my situation, I have several VMs, but each and every instance of every machine that has a NAT interface gets assigned the same address: 10.0.5.15. Eg. from a WinXP machine and a ScientificLinux running in parallel, I get in Windows:
Ethernet adapter NAT:
        Connection-specific DNS Suffix  . : Home
        Description . . . . . . . . . . . : AMD PCNET Family PCI Ethernet Adapter #4
        Physical Address. . . . . . . . . : 08-00-27-E6-3A-35
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 10.0.5.15
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 10.0.5.2
        DHCP Server . . . . . . . . . . . : 10.0.5.2
        DNS Servers . . . . . . . . . . . : 10.0.0.1
        Lease Obtained. . . . . . . . . . : Tuesday, 05 November, 2013 18:27:20
        Lease Expires . . . . . . . . . . : Wednesday, 06 November, 2013 18:27:20
and in Linux:
eth3      Link encap:Ethernet  HWaddr 08:00:27:7E:DD:04  
          inet addr:10.0.5.15  Bcast:10.0.5.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe7e:dd04/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:40 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12897 (12.5 KiB)  TX bytes:4686 (4.5 KiB)
What's going on? Are they supposed to have the same IP? Am I reading the manual wrong? Have I done something? I can post the machines config files, the VB config and any logs that anyone might ask.

The only reference I found on this was a reply by a user "vbox4me2" on 9/Aug/2010, but it's not very enlightening...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
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: Common NAT address on 2 VMs: 10.0.5.15

Post by BillG »

That is what I would expect. The original NAT in VirtualBox was designed to allow the client access to the host NIC and the network it is connected to by sharing the connection. It was not designed to allow the guest machines to have different IP addresses and be able to communicate with each other. That feature has now been added in 4.3 and it is called NAT network. This works more like a standard NAT router.

The NAT instance mentioned in your post relates to more than one NAT running on the same host (ie all guests are not using the same NAT interface on the host).
Bill
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Common NAT address on 2 VMs: 10.0.5.15

Post by socratis »

I said:
socratis wrote:I take it that if you have "x" active net cards (on one or more VMs) then "x" increases by every active card.
and you complemented:
BillG wrote:The NAT instance mentioned in your post relates to more than one NAT running on the same host (ie all guests are not using the same NAT interface on the host).
which makes sense. Note that the emphasis on my quote was my misunderstanding. When I setup a VM, I always assign 4 network cards, 1) HostOnly, 2) Internal, 3) Bridged, 4)NAT. That's why ALL of my VMs are assigned the 10.0.5.15 address. I did a test and assigned all 4 to NAT. Understandably and predictably they were 1) 10.0.2.15, 2) 10.0.3.15, 3) 10.0.4.15, 4) 10.0.5.15. It all makes sense now. I think I need to check the "NAT Network" option. Thanks again!
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply