Virtual Machine Linux system Internet access settings
After the Linux system is installed on the virtual machine, the system is in the bridging mode. The following steps are edited in the new system environment. If you have modified it before, it may not apply.
Ifconfig # view the NIC information first
1. dhclient # automatically obtains the IP address, which is obtained by the dhcp service.
2. Configure static IP addresses (the red part needs to be modified)
[Root @ Linux ~] # Vim/etc/sysconfig/network-scripts/ifcfg-eth0 # modify eth0 Nic;
DEVICE = eth0
HWADDR = 00: 0C: 29: 5B: 40: E0
TYPE = Ethernet
UUID = 9315dbdf-ae02-4814-af4c-00e29504e82d
ONBOOT = yes # enable Nic upon startup;
NM_CONTROLLED = yes
BOOTPROTO = static # Set it to static mode;
IPADDR = 192.168.15.11 # the IP address here is the IP address automatically generated by dhclient.
NETMASK = 255.255.255.0 # Set the subnet mask;
GATEWAY = 192.168.15.1 # Set the GATEWAY;
DNS1 = 114.114.114.114 # Set DNS;
3. Restart the NIC
Service network restart
I should be able to access the Internet now.
This article permanently updates the link address: