- 追加された行はこの色です。
- 削除された行はこの色です。
#topicpath
/////////////////////////////////////////////////////////////////////////////
* 目次 [#z19ec9e5]
#contents();
/////////////////////////////////////////////////////////////////////////////
* ルータに繋がっている全ての機器の IP を調べる [#e042d1c4]
//---------------------------------------------------------------------------
** 手順 [#gc509bfb]
+ ifconfig で broadcast address を調べる
$ /sbin/ifconfig enp0s25
$ /sbin/ifconfig <interface-name>
0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 240d::69ff:9f00:cc21:ff25:aa05:311b prefixlen 64 scopeid 0x0<global>
inet6 fe80::d469:8fb1:6fd2:9a08 prefixlen 64 scopeid 0x20<link>
ether 22:80:99:5a:1c:b0 txqueuelen 1000 (イーサネット)
RX packets 746385 bytes 793514361 (756.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 593509 bytes 85367822 (81.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
-- この結果より、
--- IP address: 192.168.1.2
--- broadcast address: 192.168.1.255
+ broadcast address に ping を投げる
$ ping -b 192.168.1.255 # 意図的に broadcast address に ping を投げる場合は、 -b が必要になる
WARNING: pinging broadcast address
PING 192.168.1.255 (192.168.1.255) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=255 time=3.02 ms
64 bytes from 192.168.1.3: icmp_seq=1 ttl=64 time=42.7 ms (DUP!)
64 bytes from 192.168.1.1: icmp_seq=2 ttl=255 time=2.97 ms
64 bytes from 192.168.1.3: icmp_seq=2 ttl=64 time=61.2 ms (DUP!)
^C
+ root で arp コマンドを投げる
# arp -a
? (192.168.1.3) at 88:95:ad:45:aa:83 [ether] on enp0s25
? (192.168.1.6) at <不完全> on wlp3s0
hoge.fuga (192.168.1.1) at 00:f5:88:95:be:76 [ether] on enp0s25
? (192.168.1.4) at <不完全> on wlp3s0
? (192.168.1.7) at <不完全> on wlp3s0
? (192.168.1.5) at <不完全> on wlp3s0
-- これより、ルータ(192.168.1.1)、コマンド発行元(192.168.1.2)以外に繋がっている機器が1台(192.168.1.3)あることが分かる。
/////////////////////////////////////////////////////////////////////////////
* ツール [#fce7742d]
//---------------------------------------------------------------------------
** pktstat [#oe1b5a59]
- [[Debian6>Debian/ver6]]に入っている
- iptables によるフィルタリングの状況を、topコマンド風に表示する
- Debianでは、実行にroot権限が必要。
//---------------------------------------------------------------------------
** iptstate [#g1dac294]
- iptables によるフィルタリングの状況を、topコマンド風に表示する
- Debianでは、実行にroot権限が必要。
- [[Debian6>Debian/ver6]]には入っていない