It is recommended that you set the network card NAT mode
Dynamic Network configuration:
1, be sure to open the local DHCP service
2. Select the NAT mode in the Virtual network editor to select the DHCP entry as shown below
3, Ifup eth0
Static network configuration:
Note: Ifcfg-eth0 part parameter description
device=eth0# describes the device alias corresponding to the network card
hwaddr=00:0c:29:42:dd:51# the corresponding physical address
type=ethernet# network type (usually Ethemet)
uuid= 514fda06-1fc6-4d19-8a74-74030ed83956
The network interface is valid when the onboot=yes# system starts (yes/no)
Nm_controlled=yes
Bootproto=static# set up the network card to obtain IP address, possible options for STATIC,DHCP or BOOTP, respectively, corresponding to the static specified IP address, IP address obtained through the DHCP protocol, IP address
obtained through the BOOTP protocol ipaddr=192.168.0.3# If you set up a network card to obtain an IP address as a static designation, this field specifies the IP address of the network adapter
netmask=255.255.255.0# the network mask corresponding to the NIC
gateway= 192.168.0.2# Gateway
1. Edit file Vi/etc/sysconfig/network-scripts/ifcfg-eth0 (take yourself as an example)
Before editing:
Edit:
onboot=yes# the network interface is valid when the system is started (yes/no)
bootproto=static# How to set the network card to obtain the IP address
Increase:
ipaddr=192.168.0.3# If you set up a network card to obtain an IP address as a static designation, this field specifies the IP address of the network adapter
netmask=255.255.255.0# the network mask corresponding to the NIC
gateway= 192.168.0.2# Gateway
After editing:
2: Restart the network:
3: Check:
Ping 192.168.0.2 (Gateway)
4: Setting up the DNS service
Edit:
NameServer 114.114.114.114
After cloning network settings: (after cloning from Eth0 to eth1, their own habit of eht0, to change it to eth0).
View information at this time:
View information at this time:
1, after cloning the operating system needs to reassign the physical address
A, remove the UUID and physical address in the/etc/sysconfig/network-scripts/ifcfg-eth0 file to set a new IP address
B, Vi/etc/udev/rules.d/70-persistent-net.rules
Because of the physical address that was reassigned after cloning, delete the eht0 information and modify the following eht1 to Eth0
2, modify the host name
Vi/etc/sysconfig/network (host name Centosbak modified to CentOSBAK1 before cloning) (change according to your needs)
3. Restart Linux
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.