NatNetwork Problem

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Anzaki
Posts: 1
Joined: 15. Oct 2020, 17:22

NatNetwork Problem

Post by Anzaki »

Hello everyone I am doing a test lab in regards to active directory. I created two separate VM, one for server and one for client.
My problem is when i try to enable DHCP to my NatNetwork I can access the internet in my server VM, however when i try to assign my
my server a static ip address i fail to access the internet. I try to add a DNS entry of 8.8.8.8 but i can only ping 8.8.8.8 but it cant resolve domain name such as google. why is this happening?

One more thing when i try to check my ip configuration in the command prompt i get the following result.

Description . . . . . . . . . . . : Intel(R) Dual Band PRO/1000 MT Network Connection
Physical Address. . . . . . . . . : 08-00-27-88-80-C5
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::e0ac:2029:7b39:42ae%2(Preferred)
Auto Configuration IPv4 Address. . . . . . . . . . . : 169..254.66.174(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.0.0
IPv4 Address. . . . . . . . . . . : 172.161.1.2(Duplicate)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 172.16.1.1
DNS Servers . . . . . . . . . . . : 8.8.8.8
NetBIOS over Tcpip. . . . . . . . : Enabled

Why is it my assigned ip address is duplicate?

here is my VBoxManage.exe list natnets

NetworkName: Network
IP: 172.16.1.1
Network: 172.16.1.0/24
IPv6 Enabled: No
IPv6 Prefix: fd17:625c:f037:2::/64
DHCP Enabled: No
Enabled: Yes
loopback mappings (ipv4)
127.0.0.1=2

VBoxManage list dhcpservers
NetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter
Dhcpd IP: 192.168.56.100
LowerIPAddress: 192.168.56.101
UpperIPAddress: 192.168.56.254
NetworkMask: 255.255.255.0
Enabled: Yes
Global Configuration:
minLeaseTime: default
defaultLeaseTime: default
maxLeaseTime: default
Forced options: None
Suppressed opts.: None
1/legacy: 255.255.255.0
Groups: None
Individual Configs: None
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: NatNetwork Problem

Post by BillG »

Active Directory is very fussy about DNS. All directory members should use the DC for DNS, or AD lookups will fail. A public DNS server cannot resolve your AD names.

The best way to run an AD setup under VIrtualBox is to run it in a private internal (virtual) network (just as you would set up a domain of physical machines on a physical switch). If you want to run DHCP, set it up to run on the DC. If you don't, use static configuration. Set it up so that all machines use the local DC for DNS. Get AD working before you even think about Internet access.

If you want to give your private network access to the Internet, use a vm as a router. If you configure it as a NAT router and use the router's DHCP, you will have to modify the DNS settings of the clients manually so that they use the router as the default gateway but the local DC for DNS. You will also need to set a forwarder to a public DNS service like 4.2.2.2 or 8.8.8.8 in the DNS server on the DC so that the DC can resolve URLs for itself and its clients.
Bill
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: NatNetwork Problem

Post by scottgus1 »

To implement Bill's suggestions:
BillG wrote:run it in a private internal (virtual) network
BillG wrote:to give your private network access to the Internet, use a vm as a router
You might want to consider this: Virtualbox Networks: In Pictures: "Sandbox"

Regarding the duplicate IP address, it appears this is being flagged by the guest OS. Being that we don't have full info 9n the other guest in the NAT network, we can't say if or why that label might be accurate, but if you cloned one guest to get the other, the guest's MAC addresses might be the same, which can cause duplicate IP addresses when handed out by DHCP. You have DHCP off, but there may be a duplicate MAC causing the label.

Or, the disabled DHCP server might be at that IP address. VirtualBox's DHCP servers don't sit in the gateway address like a normal router's does.

NAT networks can cause connection trouble if you change the IP range after you have used the network. See Virtualbox Networks: In Pictures: NAT network
Post Reply