Centos7 configures static IP under vbox

Set the vbox virtual machine network connection mode to bridge mode
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3


quote

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=d2905048-74ea-4851-ad0c-0db53cc26c55
DEVICE=enp0s3 ONBOOT=yes IPADDR0=10.0.6.94 NETMASK=255.255.255.0 GATEWAY0=10.0.6.1 DNS1=222.85.85.85










The red position is the place to be modified, and the others can be left as default.

Restart the network service
service network restart


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326349233&siteId=291194637