
RouterOS
1 前言
一个问题,一篇文章,一出故事。
最近笔者想通过MikroTik RouterOS的命令行查询某个用户是否在线,于是整理本章节。
2 最佳实践
2.1 查询当前活跃的IP-MAC映射
/ip arp print /ip arp print where address="192.168.0.201" /ip arp print where address="192.168.0.201" and complete
2.2 查询所有活跃连接
/ip firewall connection print /ip firewall connection print where src-address~"192.168.0.201" tcp-state~"established"
上面查到的连接很多是将死的连接,因此你需要查询是否有流量,
/ip firewall connection print where src-address~"192.168.0.201" and (orig-rate>0 or repl-rate>0)
2.3 查询无线连接用户
/interface wireless registration-table print
2.4 查询动态分配的在线用户
/ip dhcp-server lease print where status=bound
2.5 查询HotSpot在线用户
/ip dhcp-server lease print where status=bound
2.6 查询L2TP/PPTP/SSTP/VPN在线用户
/ppp active print
没有评论