![如何在不使用 ip 命令的情况下知道 ipv6 addr 来解析 MAC?](https://linux22.com/image/61233/%E5%A6%82%E4%BD%95%E5%9C%A8%E4%B8%8D%E4%BD%BF%E7%94%A8%20ip%20%E5%91%BD%E4%BB%A4%E7%9A%84%E6%83%85%E5%86%B5%E4%B8%8B%E7%9F%A5%E9%81%93%20ipv6%20addr%20%E6%9D%A5%E8%A7%A3%E6%9E%90%20MAC%EF%BC%9F.png)
我在路由器上安装了 OpenWrt,我想获取连接到它的某些机器的 MAC 地址。对于 ipv4,我会使用arp
命令。但我想解析知道 ipv6 地址的硬件地址。我读过 ipv6 有国家发展计划协议替换ARP查找MAC表的命令是ip -6 neigh show
,但问题是我的OpenWrt中的BusyBox没有ip
命令,我不确定安装一些软件包是否可以带来它。所以我想知道是否有什么方法可以检查ipv6的MAC表?也许我可以只是cat
一些文件?
编辑:我安装了ip与管理器打包opkg
,所以现在我可以使用ip -6 neigh show
,但我仍然想知道是否可以使用 获得相同的信息cat somefile
?
答案1
您可以使用安装 ndpmon 包:
apt-get install ndpmon
ndpmon - IPv6 Neighbor Discovery Protocol Monitor
root@lvm:/home/mohsen# dpkg -L ndpmon
/.
/etc
/etc/init.d
/etc/init.d/ndpmon
/etc/default
/etc/default/ndpmon
/etc/ndpmon
/etc/ndpmon/config_ndpmon.dtd
/etc/ndpmon/config_ndpmon.xml
/usr
/usr/lib
/usr/lib/ndpmon
/usr/lib/ndpmon/plugins
/usr/lib/ndpmon/plugins/mac_resolv
/usr/lib/ndpmon/plugins/mac_resolv/README
/usr/lib/ndpmon/plugins/mac_resolv/wka.tmpl
/usr/lib/ndpmon/plugins/mac_resolv/manuf.tmpl
/usr/lib/ndpmon/plugins/mac_resolv/manuf
/usr/lib/ndpmon/plugins/countermeasures
/usr/lib/ndpmon/plugins/countermeasures/icmp_lib.dox
/usr/lib/ndpmon/plugins/countermeasures/countermeasures.dox
/usr/lib/ndpmon/create_html_table.py
/usr/share
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/config_ndpmon.xml.8.gz
/usr/share/man/man8/ndpmon.8.gz
/usr/share/doc
/usr/share/doc/ndpmon
/usr/share/doc/ndpmon/changelog.Debian.gz
/usr/share/doc/ndpmon/copyright
/usr/share/doc/ndpmon/examples
/usr/share/doc/ndpmon/examples/demopipeprogram.pl.sample
/usr/share/doc/ndpmon/README
/usr/share/doc/ndpmon/changelog.gz
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/ndpmon
/usr/share/python-support
/usr/share/python-support/ndpmon.private
/usr/sbin
/usr/sbin/ndpmon
/var
/var/lib
/var/lib/ndpmon
/var/lib/ndpmon/neighbor_list.xml
/var/lib/ndpmon/neighbor_list.dtd
/var/lib/ndpmon/alerts.xml
root@lvm:/home/mohsen# man ndpmon
root@lvm:/home/mohsen# apt-cache search ndpmon
ndpmon - IPv6 Neighbor Discovery Protocol Monitor