L. *_*mes 3 network-manager hot-spot
使用 Ubuntu 作为热点接入点是一个非常无缝的设置,尽管有许多步骤。但是,我找不到有关如何查看连接的任何参考资料……连接数、IP 和 MAC 地址。
我也在尝试确定一种管理连接的方法。我想控制谁连接并检查他们使用的带宽,以及 wifi 设置中可用的其他正常详细信息。
有时可能需要禁止或限制与某些 MAC 地址的连接。
有没有人有任何信息这些细节?
创建热点后,连接到它的其中一台计算机具有此私有 IP:10.42.0.18
。连接到http://10.42.0.1
会显示 Ubuntu 默认网页...与http://localhost
.
该命令netstat -n | less
不显示对10.42.0
网络的任何引用。它确实显示了一个条目 ( raw
),这是我在正常netstat
输出中没有看到的。
netstat -n | less
输出
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 36 192.168.16.24:22 192.168.16.26:41458 ESTABLISHED
tcp 0 0 192.168.15.136:55190 72.43.238.234:1723 ESTABLISHED
raw 0 0 192.168.15.136:47 72.43.238.234:* 1
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ] DGRAM 32734 /run/user/1001/systemd/notify
unix 2 [ ] DGRAM 10603 /run/systemd/journal/syslog
unix 7 [ ] DGRAM 10605 /run/systemd/journal/socket
Run Code Online (Sandbox Code Playgroud)
raw
无论与热点建立多少连接,条目都没有变化。
我发现我一直在使用这个脚本来监控我的hotspot
连接,尽管它不会以任何方式控制它们,至少我知道谁在任何时候连接过。我使用watch
命令查看我的hotspot
.
# modified by romano@rgtti.com from http://wiki.openwrt.org/doc/faq/faq.wireless#how.to.get.a.list.of.connected.clients
echo "# All connected wifi devices, with IP address,"
echo "# hostname (if available), and MAC address."
printf "# %-20s %-30s %-20s\n" "IP address" "lease name" "MAC address"
leasefile=/var/lib/misc/dnsmasq.leases
# list all wireless network interfaces
# (for MAC80211 driver; see wiki article for alternative commands)
for interface in `iw dev | grep Interface | cut -f 2 -s -d" "`
do
# for each interface, get mac addresses of connected stations/clients
maclist=`iw dev $interface station dump | grep Station | cut -f 2 -s -d" "`
# for each mac address in that list...
for mac in $maclist
do
# If a DHCP lease has been given out by dnsmasq,
# save it.
ip="UNKN"
host=""
ip=`cat $leasefile | cut -f 2,3,4 -s -d" " | grep $mac | cut -f 2 -s -d" "`
host=`cat $leasefile | cut -f 2,3,4 -s -d" " | grep $mac | cut -f 3 -s -d" "`
# ... show the mac address:
printf " %-20s %-30s %-20s\n" $ip $host $mac
done
done
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2464 次 |
最近记录: |