ネットワークインターフェイスの表示、設定。オプション無しの場合、アクティブなインターフェイスの情報を表示する。
書式
ifconfig [-v] [-a] [-s] [interface]
ifconfig [-v] interface [aftype] options | address ...
実行例
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet [IP] netmask 255.255.254.0 broadcast [IP]
inet6 [IP] prefixlen 64 scopeid 0x0<global>
inet6 [IP] prefixlen 64 scopeid 0x20<link>
ether 9c:a3:ba:01:d5:ca txqueuelen 1000 (Ethernet)
RX packets 1976379671 bytes 194934785545 (181.5 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 73610661 bytes 33345322057 (31.0 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 9c:a3:ba:03:5c:6a 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
eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 9c:a3:ba:04:e3:0a 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
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 0 (Local Loopback)
RX packets 226761 bytes 24572233 (23.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 226761 bytes 24572233 (23.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ ifconfig -s
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 1976381202 0 0 0 73610722 0 0 0 BMRU
eth1 1500 0 0 0 0 0 0 0 0 BMRU
eth2 1500 0 0 0 0 0 0 0 0 BMRU
lo 65536 226763 0 0 0 226763 0 0 0 LRU