Loading... 1.修改文件vim /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 TYPE=Ethernet UUID=95a8e1f5-44de-4b9c-ba42-d3cb797fbb08 ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=static DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME="System eth0" HWADDR=08:00:27:A4:05:C8 PEERDNS=yes PEERROUTES=yes LAST_CONNECT=1526813693 IPADDR=192.168.2.250 GATEWAY=192.168.2.2 NETMASK=255.255.255.0 DNS=114.114.114.114 2.重启服务 service network restart 3.验证 [root@localhost ~]# ifconfig eth0 Link encap:Ethernet HWaddr 08:00:27:A4:05:C8 inet addr:192.168.2.250 Bcast:192.168.2.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fea4:5c8/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:400 errors:0 dropped:0 overruns:0 frame:0 TX packets:300 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:42494 (41.4 KiB) TX bytes:46387 (45.2 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Last modification:May 20, 2018 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 如果觉得我的文章对你有用,请随意赞赏