菜单
展开边栏 收起边栏

openwrt 通过命令查询IP分配

#安装ip-neigh
opkg update
opkg install ip-full

#查询IPV6 
ip -6 neigh show

#查询IPV4
ip -4 neigh show

#例如
ip -6 neigh show | grep 00:00:00:5a:9f:cb
ip -4 neigh show | grep 00:00:00:5a:9f:cb

#多线多拨获得指定前缀:grep -E ;只输出一个 head -n 1  ;输出第2个 sed -n '2p'
ip -6 neigh show | grep '00:00:00:5a:9f:cb' | grep -E '2409|240e' | head -n 1  | sed -n '2p'

收藏备用!

Copyright © 2008-. JiangFei.net all rights reserved
苏公网安备32048202001026号苏ICP备18062911号