After the installation of the CentOS virtual machine is successful, the gateway is not enabled by default, and the network adapter is enabled by modifying the configuration file
After editing the system configuration file, the virtual machine completes, the system installs a default network card, namely eth0, its configuration file path is/etc/sysconfig/network-scripts/ifcfg-eth0, enters the command in the system terminal: vi/etc/ Sysconfig/network-scripts/ifcfg-eth0, start the VI editor to edit this file
Edit the default NIC configuration file, change Onboot from No to Yes, edit complete, press ESC to return to the command template, enter ": Wq", return, save the changes and exit
After modifying the configuration file, it does not take effect immediately and requires the network service to reload the configuration file for the modification to take effect. Enter the command in the system Terminal: Service Network Reload
- 5
Enter the command in Terminal: Ifconfig, can see the output information, the system default network card Eth0 has been started
If the restart failure occurs
- <ignore_js_op>
- The beginning of the time because it is dial-up Internet, no route only one IP selected bridge mode, so on the virtual machine can not surf the internet, also appeared the title said that situation, later changed to NAT in the configuration file to the static change to DHCP can be, and then to use the Development Board, the Development Board to ping with Linux , but also can be online add a route, and in the virtual machine added a network card, network card 1eth0 or NAT for the Internet, and Nic 2 eth1 for bridging, with the Development Board set up the same segment of the network, and then there can only be a network card connection problems, and then the configuration file/etc/sysconfig /network-scripts/ifcfg-eth0 and/etc/sysconfig/network-scripts/ifcfg-eth1 nm_controlled= "yes" changed to "No", and then run Chkconfig NetworkManager off
CentOS Virtual machine Enable NIC