What's new

ASUS BT10 - Knowing what's connected via SSH

Longtrail

New Around Here
Hi Folks,

It's my first post and I'm definitely a newbie as I read many threads and scratch my head so please be patient!... There's a lot I don't understand!

I'm slightly OCD and like to make sure that anything connected to my main network (not Guest or IOT) is known to me and is a recognized device. To do this I manually assign IP addresses in the Advanced Settings -> Lan -> DHCP Server page. I then reserve certain ip ranges for computers, phones, tablets. etc. I still allow connections but have the starting ip as 192.168.10.150, anything that connects and is above 150 then sets my alarm bells ringing!

We have a number of devices especially Apple products where I turn "Private W-Fi Address" off so that the registered mac address is used to assign an ip address within the given IP address range.

I have kids and so they often like to mess around with settings to try and get around parental controls, etc. and so I find things on the network that have ip addresses in the 192.168.10.150 to 192.168.10.255 range. I will often fix the devices but often times notice that the connected devices on the router admin page or through the web app are really out of date and I've really lost trust in the ways to display connected devices (there seem to be a few ways to display connected devices).

I have granted myself ssh access to the main router (I have two additional nodes) and I'm trying to find a good way to see what the connected devices are, I've been working on a shell script to do this (with mixed results) and so I'm wondering if anyone has tackled this problem with a similar approach? Based on my research /tmp/clientlist.json may contain the data I'm after but my results are still not quite there yet. Here's the script:

Code:
#!/bin/sh

JSON_FILE="/tmp/clientlist.json"

echo "IP Address        MAC Address          Node               Band"
echo "------------------------------------------------------------------"

jq -r '
  to_entries[] |               # each NODE_MAC
  .key as $node_mac |
  .value | to_entries[] |       # each BAND
  .key as $band |
  .value | to_entries[] |       # each CLIENT_MAC
  [.value.ip, .key, $node_mac, $band] |
  @tsv
' "$JSON_FILE" | sort -t. -k1,1n -k2,2n -k3,3n -k4,4n |
awk -F'\t' '{printf "%-16s %-20s %-18s %s\n", ($1==""?"-":$1),$2,$3,$4}'

I'm curious if anyone else has solved this issue? I've read some other posts but they seem to download other software and given I don't have Merlin I'm wondering if I can put something together... I get a response from my script but there are some entries where the ip address is not given.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Back
Top