编辑配置文件
[root@linuxidc network-scripts]# vi ifcfg-ens34 TYPE=Ethernet BOOTPROTO=none IPADDR=88.88.88.1 NETMASK=255.255.255.0 PREFIX=32 DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=no NAME=ens34 UUID=f0e4fffc-668c-4b3d-b1cf-ab2b0122dd7d DEVICE=ens34 ONBOOT=yes重启网络
[root@linuxidc network-scripts]# systemctl restart network [root@linuxidc network-scripts]# ifconfig ens34: flags=4163 mtu 1500 inet 88.88.88.1 netmask 255.255.255.255 broadcast 88.88.88.1 inet6 fe80::250:56ff:fea0:7e4c prefixlen 64 scopeid 0x20 ether 00:50:56:a0:7e:4c txqueuelen 1000 (Ethernet) RX packets 24804 bytes 2064784 (1.9 MiB) RX errors 0 dropped 25 overruns 0 frame 0 TX packets 57 bytes 8254 (8.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ens160: flags=4163 mtu 1500 inet 10.138.130.171 netmask 255.255.255.0 broadcast 10.138.130.255 inet6 fe80::250:56ff:feb1:260 prefixlen 64 scopeid 0x20 ether 00:50:56:b1:02:60 txqueuelen 1000 (Ethernet) RX packets 25331 bytes 2120003 (2.0 MiB) RX errors 0 dropped 11 overruns 0 frame 0 TX packets 767 bytes 84120 (82.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 0 (Local Loopback) RX packets 1480 bytes 113808 (111.1 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1480 bytes 113808 (111.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 virbr0: flags=4099 mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255 ether 52:54:00:88:ce:47 txqueuelen 0 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6 bytes 1172 (1.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 [root@linuxidc network-scripts]# ping linuxidc-priv PING linuxidc-priv (88.88.88.1) 56(84) bytes of data. 64 bytes from linuxidc-priv (88.88.88.1): icmp_seq=1 ttl=64 time=0.419 ms 64 bytes from linuxidc-priv (88.88.88.1): icmp_seq=2 ttl=64 time=0.227 ms ^C --- linuxidc-priv ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 0.227/0.323/0.419/0.096 ms配置完成。