使用ifconfig命令配置临时IP地址
[root@sre01 ~]# ifconfig ens36
ens36: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.156.128 netmask 255.255.255.0 broadcast 172.16.156.255
inet6 fe80::e778:fe94:3756:fa71 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:c0:78:db txqueuelen 1000 (Ethernet)
RX packets 3 bytes 746 (746.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 1496 (1.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@sre01 ~]# ifconfig ens36 172.16.156.100 netmask 255.255.255.0
[root@sre01 ~]# ifconfig ens36
ens36: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.156.100 netmask 255.255.255.0 broadcast 172.16.156.255
inet6 fe80::e778:fe94:3756:fa71 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:c0:78:db txqueuelen 1000 (Ethernet)
RX packets 3 bytes 746 (746.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 1496 (1.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@sre01 ~]#
清空临时配置的IP地址信息
[root@sre01 ~]# ifconfig ens36 0
[root@sre01 ~]# ifconfig ens36
ens36: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::e778:fe94:3756:fa71 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:c0:78:db txqueuelen 1000 (Ethernet)
RX packets 3 bytes 746 (746.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 1496 (1.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
标签:TX,Centos,RX,bytes,ifconfig,网卡,dropped,Linux,ens36
From: https://blog.51cto.com/zywqs/12127296