一、作用
用于配置和显示Linux内核中网络接口的网络参数
*注:用ifconfig命令配置的网卡信息,在网卡重启后机器重启后,配置就不存在
```shell
[root@localhost ~]# ifconfig ens34 up
[root@localhost ~]# ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:4f:77:d7:78 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.11.101 netmask 255.255.255.0 broadcast 192.168.11.255
inet6 fe80::20c:29ff:fe17:f941 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:17:f9:41 txqueuelen 1000 (Ethernet)
RX packets 1435899 bytes 1836224033 (1.7 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1699000 bytes 4227442715 (3.9 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens34: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.137.179 netmask 255.255.255.0 broadcast 192.168.137.255
inet6 fe80::f1d5:f6ae:7457:f37e prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:17:f9:4b txqueuelen 1000 (Ethernet)
RX packets 416467 bytes 461130094 (439.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 165530 bytes 10038790 (9.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens40: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.137.181 netmask 255.255.255.0 broadcast 192.168.137.255
inet6 fe80::128f:ebc9:69d5:70b6 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:17:f9:69 txqueuelen 1000 (Ethernet)
RX packets 80822 bytes 73213737 (69.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 40281 bytes 2440248 (2.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 256 bytes 22272 (21.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 256 bytes 22272 (21.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0