Constantly unable to connect client to internet via NAT network no matter what I do

Discussions related to using VirtualBox on Windows hosts.
Post Reply
AW-1992
Posts: 18
Joined: 6. Mar 2023, 02:41

Constantly unable to connect client to internet via NAT network no matter what I do

Post by AW-1992 »

Hi friends, I'm trying to set up a NAT network with my host and three client VMs for an assignment. I can't get the first client VM to connect to the network. For the purposes of the assignment I need the IP address to be in the format of 192.168.1.xx but anything that works will be fine for now.

Trying to ping host from virtual machine: ping transmit failed, general failure [image removed because cant post url yet, imgur gallery HodCrDp]

Virtual machine IP settings: neither a static IP or dynamic will work. [image removed because cant post url yet, imgur gallery HodCrDp]

Information:
Host IP address: 192.168.1.196. On DHCP. If I set it to static, it loses internet, even if I set it to the same IP address as before.
Host's router: 192.168.1.1
NAT Network IP: Tried setting it to 192.168.1.11. Set subnet mask to 255.255.255.0 and default gateway to 168.192.1.1 and DNS to 192.168.1.1. Tried obtain ip address automatically and didn't work.
Set NAT Network IP to the default 10.0.2.0/24, then inside the virtual machines ipv4 settings changed ip address to 10.0.2.10, subnet mask to 255.255.255.0 and default gateway to 10.0.2.2. It worked for one day, then I opened the VM again the next day and the internet stopped working.
Tried using a virtualbox host-only ehternet adapter to connect to internet like before, didn't work.
I am on version 7. Teacher said to downgrade to 6.1.38. When I do this, the existing VMs cannot be accessed (searched and forums said its due to drive incompability and that theres no way to get around this other than to reinstall. Would rather not spend 6 hours reinstalling if I can avoid it.). Also surely everything 6 can do 7 can also do.

Help would be greatly appreciated and thanked. Using simple language would also be appreciated because I'm not at an advanced knowledge level for this technology.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by scottgus1 »

Pictures can be posted using the forum's Upload Attachment tab on the first day first post.
Image

********************
For the VM that cannot connect:

Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

Right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. In the "Logs" subfolder, zip the VM's "vbox.log", and post the zip file, using the forum's Upload Attachment tab. (Configure your host OS to show all extensions so you can find the "vbox.log", not "vbox.log.1", etc.)

Please also see Virtualbox Networks: In Pictures: NAT network
AW-1992
Posts: 18
Joined: 6. Mar 2023, 02:41

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by AW-1992 »

I included logs for my main vm and the backup vm. I need the main and backup vms to be able to ping each other through the NAT network as well, although it isn't working.

Bridged networking pings between host and vms work, just not nat network. Also when I try to ipconfig /renew it says 'the operation failed beacuse no adapater is in the state permissable for this operation'.

Would be appreciated if answers were in simple text.
Attachments
Logs2Vms.rar
(197.23 KiB) Downloaded 6 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by scottgus1 »

AW-1992 wrote:I can't get the first client VM to connect to the network.
scottgus1 wrote:For the VM that cannot connect:
AW-1992 wrote:I included logs for my main vm and the backup vm.
Which one cannot connect? :wink:
AW-1992
Posts: 18
Joined: 6. Mar 2023, 02:41

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by AW-1992 »

Backup cannot connect to internet via bridged adapter. Main can connect to internet via bridged adapter.

Neither can connect to each other or the internet via NAT network.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by scottgus1 »

Thanks for the clarification.

The NAT Network is bunged up:
AW-1992 wrote:Host IP address: 192.168.1.196. On DHCP. If I set it to static, it loses internet, even if I set it to the same IP address as before.
Host's router: 192.168.1.1
NAT Network IP: Tried setting it to 192.168.1.11. Set subnet mask to 255.255.255.0 and default gateway to 168.192.1.1 and DNS to 192.168.1.1. Tried obtain ip address automatically and didn't work.
Per the linked tutorial, NAT Network behaves like a router. Since routers are designed to work correctly when the private-side LAN IP range is different than the public-side WAN IP range, setting the LAN side same as the WAN side may have unintended operation. (The WAN side of NAT Network is the host's IP address and physical LAN).

Additionally, changing the NAT Network IP address range after you've used it breaks internet access in the NAT Network, due to the orphaned DHCP server, see the tutorial.

So, to use NAT Network with a non-default-10.0.2.#/24 IP range, you need to set the custom IP range before you use it for the first time. And don't set it same as the host LAN's IP range.

You can start a new NAT Network with a different name and abandon/delete the first bunged one.
AW-1992 wrote:Tried using a virtualbox host-only ehternet adapter to connect to internet like before, didn't work.
Host-Only will never connect the VMs to internet, because it's "host only".

Decide whether you want to use Bridged or NAT Network. (See the tutorial for what Bridged does, it's different behavior than NAT Network and requires different IP address ranges.)

Then provide this info:

1. Right-click each VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. Copy the VM's .vbox file (not the .vbox-prev file) to the desktop (Configure your host OS to show all extensions if the folder that opens does not show a .vbox file). Zip all the .vbox files and post the zip file, using the forum's Upload Attachment tab.

2. Get the VMs started, then try your pings. If a problem happens, show each VM's pings, and the host's pings to the VMs, whether successful or not. Post these as text, not pictures. Keep in mind that Windows Firewall is set to block Ping (ICMP Echo Request) by default, such needs to be unblocked in each Windows OS to respond to Ping.

3. In each OS, VMs and host, open a Command Prompt and run ipconfig /all. Post the command output. Label which is which.

4. In both host and VM Windows OS's, ping 8.8.8.8. Post the command output. Label which is which.

5. Please provide new logs again.
AW-1992
Posts: 18
Joined: 6. Mar 2023, 02:41

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by AW-1992 »

Per the linked tutorial, NAT Network behaves like a router. Since routers are designed to work correctly when the private-side LAN IP range is different than the public-side WAN IP range, setting the LAN side same as the WAN side may have unintended operation. (The WAN side of NAT Network is the host's IP address and physical LAN).

Additionally, changing the NAT Network IP address range after you've used it breaks internet access in the NAT Network, due to the orphaned DHCP server, see the tutorial.

So, to use NAT Network with a non-default-10.0.2.#/24 IP range, you need to set the custom IP range before you use it for the first time. And don't set it same as the host LAN's IP range.

You can start a new NAT Network with a different name and abandon/delete the first bunged one.
I removed the old DHCP servers using vboxmanage. I then confirmed they were gone.

Then I created a new NAT-Network called NatNetwork-AW2. Before opening any virtual machines, I set its ip address to 111.111.111.0/24 and unchecked DHCP, as I want to use a static IP address.
gus1.png
gus1.png (4.07 KiB) Viewed 10545 times
I then set the ip address settings in the VM to this:
gus2.PNG
gus2.PNG (15.27 KiB) Viewed 10545 times
After waiting about 5 minutes, the little icon in the bottom right says it has internet access. It can't use the browser to access google.com, but it can ping 8.8.8.8 interestingly enough.
Host-Only will never connect the VMs to internet, because it's "host only".

Decide whether you want to use Bridged or NAT Network. (See the tutorial for what Bridged does, it's different behavior than NAT Network and requires different IP address ranges.)

Then provide this info:

1. Right-click each VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. Copy the VM's .vbox file (not the .vbox-prev file) to the desktop (Configure your host OS to show all extensions if the folder that opens does not show a .vbox file). Zip all the .vbox files and post the zip file, using the forum's Upload Attachment tab.

2. Get the VMs started, then try your pings. If a problem happens, show each VM's pings, and the host's pings to the VMs, whether successful or not. Post these as text, not pictures. Keep in mind that Windows Firewall is set to block Ping (ICMP Echo Request) by default, such needs to be unblocked in each Windows OS to respond to Ping.

3. In each OS, VMs and host, open a Command Prompt and run ipconfig /all. Post the command output. Label which is which.

4. In both host and VM Windows OS's, ping 8.8.8.8. Post the command output. Label which is which.

5. Please provide new logs again.
For the sake of school I need to show that I can set up both a NAT network and bridged mode. But for now I just turned off the bridged mode adapters so it doesnt interfere with what im doing now. I'm also going to try just doing this for one virtual machine for now (the main one). The .vbox files are attached to this post.

Host ipconfig /all:

Code: Select all

Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 8:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 10:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter WiFi:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::2ba9:fd6b:4f89:fd3b%11
   IPv4 Address. . . . . . . . . . . : 192.168.1.196
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter vEthernet (Default Switch):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::475d:e0cd:a185:7f69%42
   IPv4 Address. . . . . . . . . . . : 172.23.48.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :
MainSvr-AW ipconfig /all:

Code: Select all

Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 8:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 10:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter WiFi:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::2ba9:fd6b:4f89:fd3b%11
   IPv4 Address. . . . . . . . . . . : 192.168.1.196
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter vEthernet (Default Switch):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::475d:e0cd:a185:7f69%42
   IPv4 Address. . . . . . . . . . . : 172.23.48.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :
Host pings to itself, VM and 8.8.8.8 (pinging to vm does not work):

Code: Select all

C:\Users\Alfred>ping 192.168.1.196

Pinging 192.168.1.196 with 32 bytes of data:
Reply from 192.168.1.196: bytes=32 time<1ms TTL=128
Reply from 192.168.1.196: bytes=32 time<1ms TTL=128
Reply from 192.168.1.196: bytes=32 time<1ms TTL=128
Reply from 192.168.1.196: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.1.196:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Users\Alfred>ping 111.111.11.10

Pinging 111.111.11.10 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 111.111.11.10:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

C:\Users\Alfred>ping 8.8.8.8

Pinging 8.8.8.8 with 32 bytes of data:
Reply from 8.8.8.8: bytes=32 time=3ms TTL=117
Reply from 8.8.8.8: bytes=32 time=25ms TTL=117
Reply from 8.8.8.8: bytes=32 time=3ms TTL=117
Reply from 8.8.8.8: bytes=32 time=10ms TTL=117

Ping statistics for 8.8.8.8:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 3ms, Maximum = 25ms, Average = 10ms
VM pings to itself, host and 8.8.8.8 (ping to host works):

Code: Select all

C:\Users\Alfred>ping 192.168.1.196

Pinging 192.168.1.196 with 32 bytes of data:
Reply from 192.168.1.196: bytes=32 time<1ms TTL=128
Reply from 192.168.1.196: bytes=32 time<1ms TTL=128
Reply from 192.168.1.196: bytes=32 time<1ms TTL=128
Reply from 192.168.1.196: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.1.196:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Users\Alfred>ping 111.111.11.10

Pinging 111.111.11.10 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 111.111.11.10:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

C:\Users\Alfred>ping 8.8.8.8

Pinging 8.8.8.8 with 32 bytes of data:
Reply from 8.8.8.8: bytes=32 time=3ms TTL=117
Reply from 8.8.8.8: bytes=32 time=25ms TTL=117
Reply from 8.8.8.8: bytes=32 time=3ms TTL=117
Reply from 8.8.8.8: bytes=32 time=10ms TTL=117

Ping statistics for 8.8.8.8:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 3ms, Maximum = 25ms, Average = 10ms
Attachments
xboxs.rar
(5.22 KiB) Downloaded 2 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by scottgus1 »

You got to step 4, good. There was a step 5:
5. Please provide new logs again.
This was necessary to tell us if the cable was connected in the VMs. Since this data was not provided, the below is subject to being wrong. In school, full compliance with given directions will mean better grades and better preparation for life. See viewtopic.php?f=6&t=108853#p533381 above for another example of incomplete data.

***************************
As best I can see, the two VMs report being connected to NAT Networks, but they're on different NAT Networks:
MainSvr-AW:
<Adapter slot="0" enabled="true" MACAddress="080027B55FEF" type="82540EM">
<NATNetwork name="NatNetwork-AW2"/>
<Adapter slot="1" MACAddress="0800270FA6FB" type="82540EM">

BackupSvr-AW
<Adapter slot="0" enabled="true" MACAddress="0800278DB404" type="82540EM">
<NATNetwork name="NatNetwork-AW"/>
</Adapter>
I understand you're providing data for only one VM, the "Main one". But the "Backup" one was the one having problems, yes?

NAT Network works out of the box if no changes were made to it or to the OS in the VM. So the inability for the network to work is because of manual changes to the network.

*******************************
I created a new NAT-Network called NatNetwork-AW2. Before opening any virtual machines, I set its ip address to 111.111.111.0/24
NAT Network behaves like a router. A router has Private IP addresses on the LAN side. The side you're changing in the NAT Network is its "LAN side", and 111.111.111.0/24 is not a valid private IP address range. It might work, but it's out of the normal setup for a router. Theoretically, 111.111.111.something is a valid internet IP address, so those websites using that range won't be accessible in your NAT Network.

You're showing the VM OS set to a static IP address of 111.111.111.10. And it is set to look to itself 111.111.111.10 for DNS. This may explain why the VM can't find google.com but can ping 8.8.8.8.

Curiously, the "MainSvr-AW ipconfig /all" is identical to the "host ipconfig /all". Mis-paste? It doesn't show the 111.111.111.10 IP address.

The Host cannot ping the VM because Ping cannot traverse a router from the WAN side to the LAN side. This is expected.

So the data needs some updating and doublechecking. Also a good skill for school and life.

*******************

Here is an idea to get a working NAT Network between the host and the two VMs:

1. Clear off everything you've done regarding static IP addresses in the VMs.

2. Delete the "NatNetwork-AW2" NAT Network and make a new NAT Network "forumtest". Don't change anything in it. Let it pick its own IP range and leave the DHCP server on.

3. Set each VM to use the "forumtest" NAT Network.

4. Start each VM. If the static IP stuff from before has been cleared correctly, and the VM "cables" are connected, the VMs should get IP's from the NAT Network DHCP server and should get name-based access to the internet, and be able to ping the host.

5. If the VMs don't connect, please provide again everything asked for above in viewtopic.php?f=6&t=108853#p533449
AW-1992
Posts: 18
Joined: 6. Mar 2023, 02:41

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by AW-1992 »

You got to step 4, good. There was a step 5:

5. Please provide new logs again.


This was necessary to tell us if the cable was connected in the VMs. Since this data was not provided, the below is subject to being wrong. In school, full compliance with given directions will mean better grades and better preparation for life. See viewtopic.php?f=6&t=108853#p533381 above for another example of incomplete data.
My apologies, I was under the impression that I attached the logs into my post. I try my best to make my questions clear. aI am not trying to make other's lives more difficult.
I understand you're providing data for only one VM, the "Main one". But the "Backup" one was the one having problems, yes?
They both have problems but I was trying to deal with only one problem at a time.
You're showing the VM OS set to a static IP address of 111.111.111.10. And it is set to look to itself 111.111.111.10 for DNS. This may explain why the VM can't find google.com but can ping 8.8.8.8.
What should the DNS ip address be? No google searches have answered this question. My teacher told me to simply direct the DNS server to itself, though I'm not sure why. Something about it being the server so it can assign it for itself.
Curiously, the "MainSvr-AW ipconfig /all" is identical to the "host ipconfig /all". Mis-paste? It doesn't show the 111.111.111.10 IP address.
Yes it was a mispaste. My apologies.
Here is an idea to get a working NAT Network between the host and the two VMs:

1. Clear off everything you've done regarding static IP addresses in the VMs.

2. Delete the "NatNetwork-AW2" NAT Network and make a new NAT Network "forumtest". Don't change anything in it. Let it pick its own IP range and leave the DHCP server on.

3. Set each VM to use the "forumtest" NAT Network.

4. Start each VM. If the static IP stuff from before has been cleared correctly, and the VM "cables" are connected, the VMs should get IP's from the NAT Network DHCP server and should get name-based access to the internet, and be able to ping the host.

5. If the VMs don't connect, please provide again everything asked for above in viewtopic.php?f=6&t=108853#p533449
1. Checked that nothing is in vboxmanage list dhcpservers for both VMs:
gus3.PNG
gus3.PNG (10.67 KiB) Viewed 10473 times
Set the adapter in both VMs to obtain IP address automatically and DNS automatically

Flushed DNS and released IP address: (releasing IP address failed, do not know why, google offers answers not related to VMs and which do not fix the problem)
gus4.PNG
gus4.PNG (18.52 KiB) Viewed 10473 times
Disabled then re-enabled the network adapter

Waited 5 minutes

When doing this, when I set it to obtain IP and DNS automatically, they both gained access to the internet.

Pinging from the VM to itself, the host, 8.8.8.8 and the other VM works. Pinging from the host to either VM does not work (which you said is to be expected).

Now the question is, how can I use a custom IP for each VM? Heres my guess:

My home computer's IP is 192.168.1.196. So I assume that I cannot use any ip address in the range of 192.168.1.x.
I set my NAT network IP to 192.168.2.0/24. I turn off DHCP.
I go into each vm and set the adapter settings as:
IP address: 192.168.2.10 or 192.168.2.11
Subnet mask: 255.255.255.0 for both
Default gateway: 192.168.2.1
DNS server address: 192.168.2.10

Did I guess correct?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by scottgus1 »

AW-1992 wrote:My apologies, I was under the impression that I attached the logs into my post.
No problems! I'm not feeling aggregated, I actually like diagnosing network issues. When I was in school, I found that I didn't double check and proofread my work enough. So I try to do that in my CAD drafting job now, keeps the architect's redlines down.
AW-1992 wrote:When doing this, when I set it to obtain IP and DNS automatically, they both gained access to the internet.

Pinging from the VM to itself, the host, 8.8.8.8 and the other VM works. Pinging from the host to either VM does not work (which you said is to be expected).
Great! I'm glad that's up and running.
AW-1992 wrote:how can I use a custom IP for each VM? Heres my guess:

My home computer's IP is 192.168.1.196. So I assume that I cannot use any ip address in the range of 192.168.1.x.
I set my NAT network IP to 192.168.2.0/24. I turn off DHCP.
I go into each vm and set the adapter settings as:
IP address: 192.168.2.10 or 192.168.2.11
Subnet mask: 255.255.255.0 for both
Default gateway: 192.168.2.1
Yes, that all looks good. The LAN side and WAN side of the NAT Network "router" need to be different IP ranges. You've got that. The host's physical network (the WAN side) is 192.168.1.0/24, and you have 192.168.2.0/24 for the NAT Network LAN side. Subnet mask and gateway are also correct. And you've picked correct static addresses that fall in the range set by the subnet mask. Good setup!
AW-1992 wrote:DNS server address: 192.168.2.10
AW-1992 wrote:My teacher told me to simply direct the DNS server to itself
In my meager experience setting up Windows servers, I have only seen one situation where a Windows server is going to get DNS pointed at itself, and that is when the server will be a domain controller with a DNS role activated, and the other PCs on the network will be clients on the domain:
https://social.technet.microsoft.com/Fo ... inserverDS
https://learn.microsoft.com/en-us/troub ... t-settings
If you're simply going to have the two server OS's side-by-side on a network, like two PCs on the same router, without a domain, then the DNS should be what the DHCP-set DNS addresses were, or the gateway IP address of the physical network's router.

Example: An XP VM running under NAT (NAT Network's single-port cousin) gets these IP addresses from NAT's DHCP:
IP Address. . . . . . . . . . . . : 10.0.2.15
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.2.2
DHCP Server . . . . . . . . . . . : 10.0.2.2
DNS Servers . . . . . . . . . . . : 209.18.47.61
                                    209.18.47.62
                                    192.168.0.1
The two 209.18.47.# addresses are from my Internet company, and they're also set the same on my host and network. The 192.168.0.1 address is the house network's gateway address. These are fed in by NAT's DHCP server.

Another PC in my house that has a static IP address I set up also has the 192.168.0.1 address for DNS.
Both the VM and the PC can ping Google.com successfully.

On your VMs, if you use the host network's gateway address for DNS:
AW-1992 wrote:Default Gateway . . . . . . . . . : 192.168.1.1
Then you should get internet in the VMs.

However,
AW-1992 wrote:My teacher told me to simply direct the DNS server to itself, though I'm not sure why.
You might doo good to ask the teacher. They may have a goal in mind where self-directed DNS is important.
AW-1992
Posts: 18
Joined: 6. Mar 2023, 02:41

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by AW-1992 »

In my meager experience setting up Windows servers, I have only seen one situation where a Windows server is going to get DNS pointed at itself, and that is when the server will be a domain controller with a DNS role activated, and the other PCs on the network will be clients on the domain:
https://social.technet.microsoft.com/Fo ... inserverDS
https://learn.microsoft.com/en-us/troub ... t-settings
If you're simply going to have the two server OS's side-by-side on a network, like two PCs on the same router, without a domain, then the DNS should be what the DHCP-set DNS addresses were, or the gateway IP address of the physical network's router.
The assignment that im creating these virtual machines for says that MainSvr-AW needs to be the domain controller, yes. Though I'm not exactly sure what that means.

I configured IP settings as described in my previous post.
With DNS set to 192.168.2.10 (MainSvr-AW's ip address) I can still ping 8.8.8.8 on both VMs, but visiting google via the browser doesn't work. However if I set the DNS server to 192.168.1.1, then it works. Not sure why one works and the other doesn't.

Also I cannot a) release/renew ip addresses on each VM, nor can b) I ping from host to the VM. Is this because a) I set my ip address settings as static, and static cant change? b) because on a NAT network, you need to set up port forwarding to allow host to ping VM?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by scottgus1 »

AW-1992 wrote:The assignment that im creating these virtual machines for says that MainSvr-AW needs to be the domain controller, yes.
OK, good. So the domain controller (DC) VM needs its DNS pointing at itself. I remember vaguely that there's a lot more to setting up a domain controller, and when the whole setup is complete, the DC & clients will have name-based internet access. You'll probably have to ask your teacher, though. Your setup above:
AW-1992 wrote:I set my NAT network IP to 192.168.2.0/24. I turn off DHCP.
I go into each vm and set the adapter settings as:
IP address: 192.168.2.10 or 192.168.2.11
Subnet mask: 255.255.255.0 for both
Default gateway: 192.168.2.1
DNS server address: 192.168.2.10
appears correct for a DC network setting. The client should not need special static IP settings, though. It should get its correct network settings from the DC when it joins the domain.
AW-1992 wrote:Not sure why one works and the other doesn't.
When the DC DNS points at itself, before it's fully set up, it doesn't have access to the internet's DNS data, so it can't find websites by name. When configured to look at the physical network gateway 192.168.1.1, it's now looking at the physical router for DNS, and the router can forward the DNS requests out to its DNS servers provided by the internet provider to get website addresses.

A DC is supposed to handle DNS name/address data for its own domain, so all the clients on the domain can find each other by name easily by looking to the DC. I vaguely recall there's some kind of DNS forwarding setting in a DC setup where the physical router's gateway is entered for a fallback if the DC's DNS data doesn't know the requested name. Check with your teacher or Microsoft's DC setup instructions.
AW-1992 wrote:I cannot a) release/renew ip addresses on each VM,
I'm not certain about how to do this, when it needs to be done, or what to do if it doesn't work, either. :lol: Although, I suspect that since renewing an IP address might have something to do with DHCP(?) it may not be necessary or possible with a static IP address? Just a guess.
AW-1992 wrote:nor can b) I ping from host to the VM.... because on a NAT network, you need to set up port forwarding to allow host to ping VM?
Yes, to get access to services inside a NAT or NAT Network, port forwarding is used. However, Ping doesn't use a port. So Ping can't be forwarded past a router-covered VM.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by fth0 »

scottgus1 wrote:I suspect that since renewing an IP address might have something to do with DHCP(?) it may not be necessary or possible with a static IP address?
Release/renew/rebind are DHCP negotiations, yes, and the "re" in those English language terms relates to a previous negotiation:

If the guest OS simply set the static IP address without using its DHCP client initially, then those negotiations cannot work. If the guest OS used its DHCP client to request the static IP address from the DHCP server initially, then those negotiations should work. I think that the latter case is rarely used in practice, since you'd rather configure the DHCP server to serve fixed IP addresses to DHCP clients with known MAC addresses.
AW-1992
Posts: 18
Joined: 6. Mar 2023, 02:41

Re: Constantly unable to connect client to internet via NAT network no matter what I do

Post by AW-1992 »

Thanks for the help everyone, my connection issues are fixed on my virtual machines. Only problem is the network adapter icon says 'no internet access' even though there actually is, but thats not a big issue.
Post Reply