首先来两个配置文件 vi /etc/network/interfaces # The primary network interface auto eth0 iface eth0 inet static address 172.16.19.222 gateway 172.16.19.1 netmask 255.255.255.0 #network 172.16.19.0 #broadcast 172.16.19.255 修改dns在vi /etc/resolv.conf 加入nameserver 114.114.114.114 重启 service networking restart 2.centos vi /etc/sysconfig/network-scripts/ifcfg-eth0 eth0是网卡的名字。也有可能是其他的如有一个版本的centos7安装以后为ens33 DEVICE=eth0 HWADDR=00:0C:29:FD:4A:32 TYPE=Ethernet ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=static IPADDR=172.16.19.221 NETMASK=255.255.255.0 GATEWAY=172.16.19.1 修改dns在vi /etc/resolv.conf 加入nameserver 114.114.114.114 重启 centos7以下的版本 service network restart centos7 systemctl restart network.service 也可以输入setup试试。有些自带setuptools会出现图形化配置界面. 或者安装 yum install setuptool #注系统服务配置的命令是 yum install ntsysv
输入setup (责任编辑:IT) |