Network card status confuses me
ifconfig output is as follows
[root@localhost ~]# ifconfig -a enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.7.48.160 netmask 255.255.224.0 broadcast 10.7.63.255 inet6 fe80::e160:a350:7997:8e66 prefixlen 64 scopeid 0x20 ether 52:54:00:05:0b:bd txqueuelen 1000 (Ethernet) RX packets 1719090 bytes 344162608 (328.2 MiB) RX errors 0 dropped 152019 overruns 0 frame 0 TX packets 113183 bytes 30701961 (29.2 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
tap0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether 5e:de:fe:68:41:65 txqueuelen 1000 (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
tap1: flags=4098<BROADCAST,MULTICAST> mtu 1500 ether a6:cf:9f:07:c1:0e txqueuelen 1000 (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 [root@localhost ~]#
node_exporter output as follows
node_network_transmit_queue_length{device="tap1"} 1000 # HELP node_network_up Value is 1 if operstate is 'up', 0 otherwise. # TYPE node_network_up gauge node_network_up{device="enp3s0"} 1 node_network_up{device="lo"} 0 node_network_up{device="tap0"} 0 node_network_up{device="tap1"} 0 # HELP node_nfs_connections_total Total number of NFSd TCP connections.
my confusion
Judging from the output of ifocnfig, the status of tap0 is "up" node_export considers the status value tap0 to be 0 I analyzed that node_export takes the value from the file , which is also consistent with the output of node_exporter. I I think this is very conflicting, it seems that the value should be read from ifconfig
[root@localhost ~]# cat /sys/class/net/tap0/operstate down [root@localhost ~]#
ifconfig has been deprecated for a long time. I'd recommend checking ip link show.