When working with Linux systems in VMware virtual machines, both bridge and NAT modes can be switched temporarily with immediate effect, so there's no need to worry about wich one is better. This guide focuses on how to properly configure bridge mode.
-
After installing Linux in your virtual machine, open the VMware menu and click on
Edit > Virtual Network Editor. Select theHost Virtual Network Mappingtab, then manually selectVMnet0to map to your physical network adapter (choose the active adapter - if you're using wireless, bridge to the wireless card; if using wired, bridge to the wired card). Do not select automatic configuration. Click OK to save. -
Enter the virtual machine's operating system and open a terminal. Use the
ip addr show eth0command to check the network configuration. Verify that both the host and virtual machine are on the same subnet. For example, if the host IP is192.168.1.5, the virtual machine should have an IP in the range of192.168.1.1to192.168.1.254. -
The most critical step: set the virtual machine's gateway to the host's physical IP address. This is essential for network connectivity, as many connectivity issues stem from incorrect gateway settings. Use the host's IP as the virtual machine's gateway.
-
Configure security policies:
-
Disable host firewall; (omitted)
-
Disable virtual machine firewall: ``` sudo systemctl disable ufw # Permanent disable, takes effect after reboot sudo ufw status # Check firewall status
-
Disable virtual machine SELinux: ``` sudo nano /etc/selinux/config # Change SELINUX=enforcing to SELINUX=disabled, save and exit, reboot to apply sestatus # Check SELinux status
-
-
Test the configuration:
- From the host, ping the virtual machine's eth0 IP. If it fails, check that the virtual machine's firewall or SELinux is disabled.
- From the virtual machine, ping the host IP. If it fails, check that the host firewall is disabled.
- If both pings succeed, the configuration is complete.
If you encounter issues, verify that all firewall settings are correct and that any changes requiring reboot have been applied. At this point, you should have no further problems. Restart the virtual machine, and it should have internet access. For users with dial-up connections, only one system (host or virtual machine) can be online at a time.