在VirtualBox
里安装CentOS
,配置静态IP
:
(1)CentOS 6
,修改/etc/sysconfig/network-scripts/ifcfg-eth0
文件:
......
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.9
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
(2)CentOS 7
,修改/etc/sysconfig/network-scripts/ifcfg-enp0s3
文件:
......
BOOTPROTO="static"
ONBOOT="yes"
IPADDR="192.168.1.5"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
DNS1="192.168.1.1"
DNS2="8.8.8.8"