openwrt ndsctl工具

ndsctl是通过unix socket与nodogsplash之间通过socket来实现进程之间的通信,显示信息与配置文件有关系,对于ndsctl 的操作,只是临时的,如果系统记录保存,还是需要写入配置文件。具有操作功能的参数,主要是用来对特定的MAC和IP地址进行操作,操作的结果就是通过iptables建立不同的数据包过滤机制来达到对用户的访问控制。

Usage: ndsctl [options] command [arguments]

options:
  -s <path>         Path to the socket
  -h                Print usage

commands:
  status            View the status of nodogsplash
  clients           Display machine-readable client list
  stop              Stop the running nodogsplash
  auth ip           Authenticate user with specified ip
  deauth mac|ip     Deauthenticate user with specified mac or ip
  block mac         Block the given MAC address
  unblock mac       Unblock the given MAC address
  allow mac         Allow the given MAC address
  unallow mac       Unallow the given MAC address
  trust mac         Trust the given MAC address
  untrust mac       Untrust the given MAC address
  loglevel n        Set logging level to n
  password pass     Set gateway password
  username name     Set gateway username


ndsctl 示例:

root@goldsunny:/# ndsctl status
==================
NoDogSplash Status
====
Version: 0.9_beta9.9.9    								#NoDogSplash版本号
Uptime: 0d 0h 4m 51s									#开启时间
Gateway Name: NoDogSplash								#网关名称
Managed interface: br-lan								#管理的网络设备接口 
Managed IP range: 0.0.0.0/0								#管理所有ip
Server listening: 192.168.20.1:2050						#监听端口
Splashpage: /etc/nodogsplash/htdocs/splash.html			#欢迎界面
Traffic control: no										#是否开启流量控制(限速)
Total download: 96 kByte; avg: 2.66526 kbit/s			#接口总的上行流量
Total upload: 101 kByte; avg: 2.77825 kbit/s			#接口总的下行流量
====
Client authentications since start: 1					# 通过验证之后的连接数
Current clients: 1										# 连接数(包含未认证的)

Client 0												# 连接的用户信息
  IP: 192.168.20.128 MAC: f4:9f:f3:80:af:de				
  Added:   Wed Aug  5 09:43:42 2015						# 连接时间
  Active:  Wed Aug  5 09:47:40 2015						# 活跃时间(截至这个时间用户还在线)
  Active duration: 0d 0h 3m 58s							# 在线时间(使用网络)
  Added duration:  0d 0h 3m 58s							# 连接到此接口的时间
  Token: 4778364b										# 令牌号
  State: Authenticated									# 是否通过验证
  Download: 36 kByte; avg: 1.21829 kbit/s				# 上行流量统计
  Upload:   16 kByte; avg: 0.540471 kbit/s				# 下行流量统计

====
Blocked MAC addresses: none								# 黑名单
Allowed MAC addresses: N/A								# 白名单
Trusted MAC addresses: none								# 信任名单(在此名单的不需要验证,而且也没有使用记录)
========



  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
openwrt命令行模式命令及其工具 需要学会用ssh登录路由器用linux命令查看。 ps 命令查看当前系统运行的进程信息 free 命令查看内存使用和swap挂载情况 ls 查看目录和文件 cd 进入退出目录 vi 查看编辑配置文件 安装命令: #opkg update #opkg install nano uci set network.lan.ipaddr=[lan ip] 使用pppoe设置 Shell代码 uci set network.wan.proto=pppoe //设置wan口类型为pppoe uci set network.wan.username=[上网帐户] uci set network.wan.password=[上网密码] //这两行设置pppoe用户名和密码 如果要挂在上级路由下面,就需要进行下面的设置 Shell代码 uci set network.wan.proto=none //关掉wan uci set network.lan.gateway=[上级路由ip] //网关指向上级路由 uci set network.lan.dns=[上级路由ip] //dns指向上级路由 uci set dhcp.lan.ignore=1 //关掉lan的dhcp 最后对无线网络进行配置 Shell代码 uci set wireless.@wifi-device[0].disabled=0 //打开无线 uci set wireless.@wifi-device[0].txpower=17 //设置功率为17dbm 太高会烧无线模块 uci set wireless.@wifi-device[0].channel=6 //设置无线信道为6 uci set wireless.@wifi-iface[0].mode=ap //设置无线模式为ap uci set wireless.@wifi-iface[0].ssid=[自己设置SSID] //设置无线SSID uci set wireless.@wifi-iface[0].network=lan //无线链接到lan上 uci set wireless.@wifi-iface[0].encryption=psk2 //设置加密为WPA2-PSK uci set wireless.@wifi-iface[0].key=[密码] //设置无线密码 提交应用配置 Shell代码 uci commit //应用 /etc/init.d/network restart //重启网络服务 安装luci管理界面 Shell代码 opkg update // 更新软件列表 opkg list-installed // 查看已安装软件 opkg install luci // 安装LUCI opkg install luci-i18n-chinese // 支持中文 luci-app-firewall - 0.10.0-1 luci-i18n-english - 0.10.0-1 luci-lib-core - 0.10.0-1 luci-lib-ipkg - 0.10.0-1 luci-lib-lmo - 0.10.0-1 luci-lib-nixio - 0.10.0-1 luci-lib-sys - 0.10.0-1 luci-lib-web - 0.10.0-1 luci-mod-admin-core - 0.10.0-1 luci-mod-admin-full - 0.10.0-1 luci-proto-core - 0.10.0-1 luci-proto-ppp - 0.10.0-1 luci-sgi-cgi - 0.10.0-1 luci-theme-base - 0.10.0-1 luci-theme-openwrt - 0.10.0-1 即可完成LUCI的安装。 输入以下命令开启支持web服务的uhttpd,并设置其为自启动: Shell代码 /etc/init.d/uhttpd enable # 开机自启动 /etc/init.d/uhttpd start # 启动uhttpd - Wifidog 你可以尝试执行以下命令安装Wifidog: opkg update # Optional opkg install wifidog --sftp安装 opkg update opkg install vsftpd openssh-sftp-server /etc/init.d/vsftpd enable /etc/init.d/vsftpd start 小米端口转发命令: 通过修改 /etc/config/firewall 这个文件来实现开放自己需要的端口到外网。 config rule 'httpdwan' option src 'wan' option dest_port '8088' option proto 'tcp' option target 'ACCEPT' option name ''\''httpd wan accept tcp port 8088'\''' 保存后,执行 /etc/init.d/firewall restart 重启防火墙。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值