|
This summer we'll do less presenting, and more discussing Network topics.
adblock on an OpenWrt routerThis month, we'll talk about IPv4 & IPv6 Host detection on your network using v6disc.sh open source script. The script runs anywhere there is bash, even on your router!
The script has help:
./v6disc.sh -h
./v6disc.sh - auto discover IPv6 hosts
e.g. ./v6disc.sh -D -p
-p Ping discovered hosts
-i use this interface
-L show link-local only
-D Dual Stack, show IPv4 addresses
-N Scan with nmap -6 -sT
-n disable neighbour table detection
-q quiet, just print discovered hosts
There's a IPv6 and an IPv4 version, which work in very different ways. The IPv6 version takes advantage of the multicast all-nodes address, and the IPv4 version does a ping sweep of the subnet.
$ ./v6disc.sh
-- Searching for interface(s)
Found interface(s): eth0
-- INT:eth0 prefixs: 2001:db8:815f:5600 2001:470:1d:489
-- Detecting hosts on eth0 link
-- Discovered hosts for prefix: 2001:db8:815f:5600 on eth0
2001:db8:815f:5600:129a:ddff:fe54:b634
2001:db8:815f:5600:203:93ff:fe67:4362
2001:db8:815f:5600:211:24ff:fece:f1a
2001:db8:815f:5600:211:24ff:fee1:dbc8
2001:db8:815f:5600::1
2001:db8:815f:5600:225:31ff:fe02:aecb
2001:db8:815f:5600:226:bbff:fe1e:7e15
2001:db8:815f:5600:256:b3ff:fe04:c8e5
2001:db8:815f:5600:280:77ff:feeb:1dde
2001:db8:815f:5600:a00:27ff:fe21:e445
-- Discovered hosts for prefix: 2001:470:1d:489 on eth0
2001:470:1d:489:129a:ddff:fe54:b634
2001:470:1d:489:203:93ff:fe67:4362
2001:470:1d:489:211:24ff:fece:f1a
2001:470:1d:489:211:24ff:fee1:dbd8
2001:470:1d:489::1
2001:470:1d:489:225:31ff:fe02:aecb
2001:470:1d:489:226:bbff:fe1e:7e15
2001:470:1d:489:256:b3ff:fe04:cbe5
2001:470:1d:489:280:77ff:feeb:1dde
2001:470:1d:489:a00:27ff:fe21:e445
-- Displaying avahi discovered hosts
2001:470:1d:489:211:24ff:fee1:dbd8 halaconia.local
2001:470:1d:489::46f hau.local
fe80::129a:ddff:feae:8166 kukui.local
2001:470:1d:489:4459:8014:e3db:c8fe xubuntu-VirtualBox.local
-- Pau
The script also has a dual-stack option, which will display hosts with both their v6 and v4 addresses.
$ ./v6disc.sh -D -i br
-- INT:br0 prefixs: 2001:db8:8011:fd00
-- Detecting hosts on br0 link
ping: Warning: source address might be selected on device other than: br0
-- Discovered hosts for prefix: 2001:db8:8011:fd00 on br0
2001:db8:8011:fd00::1 10.1.1.1
2001:db8:8011:fd00::11b 10.1.1.35
2001:db8:8011:fd00:216:3eff:fe03:3d0f 10.1.1.93
2001:db8:8011:fd00:216:3eff:fe19:1ee 10.1.1.136
2001:db8:8011:fd00:216:3eff:fe1c:1cf3 10.1.1.129
2001:db8:8011:fd00:216:3eff:fe7f:49f9 10.1.1.135
2001:db8:8011:fd00:216:3eff:fe84:8e3e 10.1.1.104
2001:db8:8011:fd00:216:3eff:fe97:71db 10.1.1.85
2001:db8:8011:fd00:216:3eff:fec6:3eb6 10.1.1.84
2001:db8:8011:fd00:216:3eff:fef7:e609 10.1.1.88
2001:db8:8011:fd00:2acf:daff:fee5:8070 10.1.1.128
2001:db8:8011:fd00:3029:e808:559e:9c96 10.1.1.23 10.1.1.73
2001:db8:8011:fd00:34b1:842:b6a2:38fd 10.1.1.38
2001:db8:8011:fd00::639 10.1.1.128
2001:db8:8011:fd00::a0b
2001:db8:8011:fd00:d66a:6aff:feb3:a31d 10.1.1.19
-- Displaying avahi discovered hosts
-- Pau
Getting OpenWrt on your router may be a challenge, as different vendors have differing requirements and limitations on what kind of router firmware their software will allow you to install. You can see that in the Ubiquity EdgeRouter X for example.
But once you are running OpenWrt on your router, there will be a time where you will want to upgrade it, to use a new feature, or make it more secure from a published exploit. Fortunately, upgrading OpenWrt is not difficult, and there are two methods, via CLI or via the Web Interface (called LuCI).
OpenWrt has an excellent how-to upgrade page to walk you through both methods.
Adverts while you are trying to read something on the internet are just irritating. Sure that is how Google has become a mulit-billion dollar company, but they are still irritating. Sure you can install an adblocker on your web browser, like uBlock Origin, to block ads, but not all devices support adblocking extensions.
By installing an adblocker at your router, all downstream devices will be ad-free. Fortunately, this is easy to do with adblock on an OpenWrt router. Here's more info on how to install adblock.
21 June 2022