ip
アドレス操作
デバイスに対するバインド状態を出力
# ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:5f:94:78 brd ff:ff:ff:ff:ff:ff inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic eth0 valid_lft 86096sec preferred_lft 86096sec inet6 fe80::5054:ff:fe5f:9478/64 scope link valid_lft forever preferred_lft forever 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 08:00:27:06:e6:9e brd ff:ff:ff:ff:ff:ff inet 192.168.33.10/24 brd 192.168.33.255 scope global eth1 valid_lft forever preferred_lft forever inet6 fe80::a00:27ff:fe06:e69e/64 scope link valid_lft forever preferred_lft forever
192.168.0.10 を eth0 のエイリアス(eth0:1)として追加する
nmcli を利用しましょう
# ip addr add local 192.168.0.10/24 dev eth0 label eth0:1
192.168.0.10 の eth0 のエイリアス(eth0:1)を削除する
nmcli を利用しましょう
# ip addr del local 192.168.0.10/24 dev eth0 label eth0:1
近隣キャッシュ操作
ARP テーブルの状態表示
# ip neigh show 10.0.2.2 dev eth0 lladdr 52:54:00:12:35:02 REACHABLE 10.0.2.3 dev eth0 lladdr 52:54:00:12:35:03 STALE
- REACHABLE
- 到達可能
- STALE
- 失効状態
- DELAY
- 猶予期間中
- PERMANENT
- 永続的設定
- REACHABLE
デバイス操作
状態表示
# ip link show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 52:54:00:5f:94:78 brd ff:ff:ff:ff:ff:ff 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 08:00:27:06:e6:9e brd ff:ff:ff:ff:ff:ff
統計情報の表示
# ip -s link show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 RX: bytes packets errors dropped overrun mcast 0 0 0 0 0 0 TX: bytes packets errors dropped carrier collsns 0 0 0 0 0 0 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 52:54:00:5f:94:78 brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped overrun mcast 190526 1505 0 0 0 0 TX: bytes packets errors dropped carrier collsns 127639 962 0 0 0 0 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 08:00:27:06:e6:9e brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped overrun mcast 1180 2 0 0 0 0 TX: bytes packets errors dropped carrier collsns 1984 18 0 0 0 0
ルーティングテーブルの確認
# ip route show default via 10.0.0.1 dev eth0 proto static metric 100 10.0.0.0/8 dev eth0 proto kernel scope link src 10.0.12.10 metric 100