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