Linux 在区网内,想要取得某个 IP 的 Mac Address 要怎么做呢?
Linux 要取得 远端IP 的 Mac Address(区网)
于 Linux 可以使用 arp、nmap、arping、arp-scan ... 等都可以查~
可以使用 arp -a / -n 来查:
- arp -a 192.168.1.1 # apt install net-tools # arp 需要安装 net-tools 套件
- 192.168.1.88 at ec:11:66:88:ec:10 [ether] on enp3s0
- arp -n 192.168.1.1
- Address HWtype HWaddress Flags Mask Iface
- 192.168.1.88 ether ec:11:66:88:ec:10 C enp3s0
- sudo nmap -n -sP 192.168.1.0/24 # 扫出目前网络的所有对照
- Nmap scan report for 192.168.1.1
- Host is up (0.0029s latency).
- MAC Address: EC:11:66:88:EC:10 (Unknown)
- Nmap scan report for 192.168.1.2
- Host is up (0.00014s latency).
- MAC Address: C8:66:CC:66:88:CF (Apple)
- Windows 可以使用 getmac 来查