Shutdown: shutdown-hnow restart: reboot network settings: vi/etc/sysconfig/network-sripts/ifcfg-eth0 # set network connection type, IP, Gateway, subnet mask vi/etc/sysconfig/network # Set host name vi/etc/resolv. conf # set DNSservicenetwork
Shutdown: shutdown-h now
Restart: reboot
Network Settings: vi/etc/sysconfig/network-sripts/ifcfg-eth0 # set network connection type, IP, Gateway, subnet mask
Vi/etc/sysconfig/network # set the host name
Vi/etc/resolv. conf # set DNS
Service network restart # restart the network service after the configuration is complete.
Virtual machine network settings:
Method 1: With bridging, set IP (same as the network segment of the host), subnet mask (255.255.255.0), Gateway (same as the host) in/etc/sysconfig/network-sripts/ifcfg-eth0 ), enable ONBOOT = yes and set BOOTPROTO = static. You can achieve two-way access to the host and virtual machine without moving anything else.
Method 2: Use network address translation NAT, set BOOTPROTO = dhcp in/etc/sysconfig/network-sripts/ifcfg-eth0, enable ONBOOT = yes, other do not need to set, to share the network access of the host. When the host uses a wired network, the virtual machine can access the host, and the host cannot access the virtual machine. When the host uses a Wi-Fi network, the virtual machine and the host can be accessed in two directions.
You do not need to set this parameter in/etc/sysconfig/network.
The DNS address in/etc/resolv. conf is automatically obtained, consistent with the host