Problem:
I’m unable to access the internet in my Red Hat 9.5 Enterprise VM, despite the VM having an IP address and being configured in VMware Workstation with NAT mode. The VM's network interface is configured correctly, but I’m unable to ping external websites or resolve DNS addresses.
VM Software: VMware Workstation
Host OS: Windows [version]
VM OS: Red Hat 9.5 Enterprise
Network Mode: NAT
IP Range: 192.168.50.x
The VM was previously hosted on a vCenter in a private network and has been exported to my local machine for use.
After exporting, I noticed the VM cannot connect to the internet, though it was functioning correctly in the previous environment.
Bridged Mode: When I switch the network mode to bridged, the VM gets stuck at obtaining a DHCP IP address. This might be because my company's network only allows one MAC address per IP, which could prevent the VM from receiving an IP address.
The VM has an IP address in the 192.168.50.x range.
On the host machine, ipconfig shows the default gateway as 192.168.50.1.
On the VM, the default gateway was initially set to 192.168.50.2, which I changed to 192.168.50.1 (matching the host’s gateway).
DNS servers are configured to 8.8.8.8 and 1.1.1.1, but DNS resolution is not working.
The network settings on the host machine and VMware appear to be correctly configured for NAT.
Checked the IP Address and Gateway:
Verified the VM has a valid IP in the correct range.
The gateway was set to 192.168.50.2, which I changed to 192.168.50.1 using ip route, to match the host's gateway.
Checked DNS Configuration:
Verified /etc/resolv.conf has the correct DNS servers (8.8.8.8 and 1.1.1.1).
Restarted the networking service (sudo systemctl restart networking and sudo systemctl restart NetworkManager).
Tried Pinging:
Ping to gateway (192.168.50.1): Successful.
Ping to external IP (e.g., 8.8.8.8): Fails.
Ping to domain (e.g., google.com): Fails.
Checked VMware Settings:
Verified that VMware’s VMnet8 (NAT) is correctly configured, and it provides the expected IP range and gateway.
Checked Windows Firewall on Host:
Temporarily disabled Windows firewall on the host machine.
Checked Network Interface and Restarted:
Ensured network interface was up (sudo ifconfig ens192 up).
Restarted both host machine and VM after changes.
Bridged Mode Issue:
When I switch to bridged mode, the VM is unable to get an IP address because DHCP is stuck. This could be due to my company's network allowing only one MAC address per IP address.
The VM should be able to ping external websites, resolve domain names, and access the internet with the current network configuration.
Could anyone suggest a solution to get internet access in either NAT mode or Bridged mode in this setup?
Challenge accepted; just a few quick questions, it seems to me the issue isn’t with Linux itself, but more likely something in the environment setup:
- is there a proxy server required for internet access?
- is outbound internet access restricted by IP, MAC, or application?
- is your VM expected to use a different proxy or route compared to the host?
- is the VM allowed to access the internet through the host’s security policies (Win Defender, AD group policy)?
- is a VPN is active on the host, is split tunneling enabled?
- is the correct DNS resolution path being followed from the VM? (run dig or nslookup on internal domains to verify)
- are there restrictions on MAC spoofing or duplicate MACs in your LAN or Wi-Fi settings?
- is your corporate endpoint protection solution interfering with VM networking?
Hello @xorya111
I work with VM's, I got internet access in Bridged mode using dhcp.
In your case.. since dhcp won't work, why don't you try with static ip ?
You can also add your VM's mac address to dhcp with help of your administrator...!
Thanks
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.