dd-wrt java_DD-WRT:获取DHCP租约时间而非过期客户端的命令行

本文档描述了如何通过SSH连接到DD-WRT路由器并使用命令行工具来查找未过期的DHCP客户端列表。作者目前能够查看ARP列表,但需要进一步获取DHCPClientsList。他们探讨了/proc/net目录下的多个文件,但不确定哪个包含所需信息。寻求一种方法通过命令行获取DHCP租约未过期的客户端列表。
摘要由CSDN通过智能技术生成

这是我的Buffalo WHR-HP-G54路由器(已安装 DD-WRT )的示例 connected devices 显示:

有源(传输)无线客户端 .

DHCP租用时间尚未到期的客户端(在我的情况下配置为180分钟) .

当我用来通过SSH进入设备时,我想开发一些 script 来获取第二个表: DHCP Clients List .

我现在能做的只是:

~# ssh root@192.168.8.202 -p 1022

root@192.168.8.202's password:

==========================================================

____ ___ __ ______ _____ ____ _ _

| _ \| _ \ \ \ / / _ \_ _| __ _|___ \| || |

|| | || ||____\ \ /\ / /| |_) || | \ \ / / __) | || |_

||_| ||_||_____\ V V / | _ < | | \ V / / __/|__ _|

|___/|___/ \_/\_/ |_| \_\|_| \_/ |_____| |_|

DD-WRT v24

http://www.dd-wrt.com

==========================================================

BusyBox v1.4.2 (2007-08-15 14:58:26 CEST) Built-in shell (ash)

Enter 'help' for a list of built-in commands.

~ # arp -a

? (192.168.11.104) at 78:40:E4:E6:4B:1C [ether] on br0

? (192.168.11.121) at 64:9A:BE:56:EC:7F [ether] on br0

? (192.168.11.126) at on br0

? (192.168.11.110) at 40:B3:95:F2:3A:1A [ether] on br0

? (192.168.11.112) at F0:25:B7:38:00:81 [ether] on br0

? (192.168.11.108) at on br0

? (192.168.8.1) at 00:24:A5:C7:DD:BC [ether] on vlan1

? (192.168.11.103) at F0:24:75:52:0B:27 [ether] on br0

? (192.168.11.125) at 04:4B:ED:6B:8E:73 [ether] on br0

? (192.168.11.125) at 04:4B:ED:6B:8E:73 [ether] on br0

~ # more /proc/net/arp

IP address HW type Flags HW address Mask Device

192.168.11.104 0x1 0x2 78:40:E4:E6:4B:1C * br0

192.168.11.121 0x1 0x2 64:9A:BE:56:EC:7F * br0

192.168.11.126 0x1 0x0 60:AF:6D:48:5E:E5 * br0

192.168.11.110 0x1 0x2 40:B3:95:F2:3A:1A * br0

192.168.11.112 0x1 0x2 F0:25:B7:38:00:81 * br0

192.168.11.108 0x1 0x0 58:7F:57:DB:BE:15 * br0

192.168.8.1 0x1 0x2 00:24:A5:C7:DD:BC * vlan1

192.168.11.103 0x1 0x2 F0:24:75:52:0B:27 * br0

192.168.11.127 0x1 0x2 48:5A:3F:47:3A:7C * br0

192.168.11.125 0x1 0x2 04:4B:ED:6B:8E:73 * br0

但路由器的ARP列表不是一回事 .

我在这里研究过:

~ # ls /proc/net/ -la

dr-xr-xr-x 6 root root 0 Dec 3 19:29 .

dr-xr-xr-x 34 root root 0 Jan 1 2000 ..

-r--r--r-- 1 root root 0 Dec 3 19:29 arp

-r--r--r-- 1 root root 0 Dec 3 19:29 dev

-r--r--r-- 1 root root 0 Dec 3 19:29 dev_mcast

dr-xr-xr-x 2 root root 0 Dec 3 19:29 drivers

-r--r--r-- 1 root root 0 Dec 3 19:29 igmp

-r--r----- 1 root root 0 Dec 3 19:29 ip_conntrack

-r--r--r-- 1 root root 0 Dec 3 19:29 ip_mr_cache

-r--r--r-- 1 root root 0 Dec 3 19:29 ip_mr_vif

-r--r--r-- 1 root root 0 Dec 3 19:29 ip_tables_matches

-r--r--r-- 1 root root 0 Dec 3 19:29 ip_tables_names

-r--r--r-- 1 root root 0 Dec 3 19:29 ip_tables_targets

dr-xr-xr-x 2 root root 0 Dec 3 19:29 ipt_recent

-rw-r--r-- 1 root root 0 Dec 3 19:29 layer7_numpackets

-r--r--r-- 1 root root 0 Dec 3 19:29 mcfilter

-r--r--r-- 1 root root 0 Dec 3 19:29 netlink

-r--r--r-- 1 root root 0 Dec 3 19:29 netstat

-r--r--r-- 1 root root 0 Dec 3 19:29 packet

-r--r--r-- 1 root root 0 Dec 3 19:29 pppoe

-r--r--r-- 1 root root 0 Dec 3 19:29 psched

-r--r--r-- 1 root root 0 Dec 3 19:29 raw

-r--r--r-- 1 root root 0 Dec 3 19:29 route

-r--r--r-- 1 root root 0 Dec 3 19:29 rt_cache

-r--r--r-- 1 root root 0 Dec 3 19:29 snmp

-r--r--r-- 1 root root 0 Dec 3 19:29 sockstat

-r--r--r-- 1 root root 0 Dec 3 19:29 softnet_stat

dr-xr-xr-x 2 root root 0 Dec 3 19:29 stat

-r--r--r-- 1 root root 0 Dec 3 19:29 tcp

-r--r--r-- 1 root root 0 Dec 3 19:29 udp

-r--r--r-- 1 root root 0 Dec 3 19:29 unix

dr-xr-xr-x 2 root root 0 Dec 3 19:29 vlan

-r--r--r-- 1 root root 0 Dec 3 19:29 wireless

-r--r--r-- 1 root root 0 Dec 3 19:29 wl0

但我还不知道其中一些文件是否包含我的数据 .

obtain this via command-line 有什么办法吗?

也许 DHCP Lease Not Expired Clients 的一些通用Linux方法可行,但我不知道 .

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值