CentOS6.9配置静态IP

xiaoxiao2021-02-28  68

一 直接在配置文件修改

/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0" #描述网卡对应的设备别名 BOOTPROTO="static"   #通过不同协议设置网卡获得ip地址的方式,–静态static –bootp –dhcp**** HWADDR="08:00:27:29:2F:76"    #对应的网卡网卡地址,即mac地址 NM_CONTROLLED="no" ONBOOT="yes"  系统启动时自动加载eth0  **** TYPE="Ethernet"  #表示网络类型是以太网  UUID="86a741ef-e296-4366-8a31-631b45885425" IPADDR=192.168.88.71  #设置网卡IP地址  **** NETMASK=255.255.255.0 #设置网卡掩码地址  **** GATEWAY=192.168.88.1 #设置网卡对应的网络地址 ****

注意:

等号左右不要加空格,否则会报错;

单双引号要配对,否则会报错;

二 修改保存后,重启服务 service network restart

三 通过ping确认是否配置成功

[root@jing network-scripts]# ping blog.csdn.net PING blog.csdn.net (47.95.49.160) 56(84) bytes of data. 64 bytes from 47.95.49.160: icmp_seq=1 ttl=33 time=5.48 ms 64 bytes from 47.95.49.160: icmp_seq=2 ttl=33 time=7.01 ms 64 bytes from 47.95.49.160: icmp_seq=3 ttl=33 time=5.55 ms 64 bytes from 47.95.49.160: icmp_seq=4 ttl=33 time=5.48 ms 64 bytes from 47.95.49.160: icmp_seq=5 ttl=33 time=11.6 ms

转载请注明原文地址: https://www.6miu.com/read-35313.html

最新回复(0)