Skip to content

Instantly share code, notes, and snippets.

@nasirhafeez
Created July 20, 2024 11:27
Show Gist options
  • Save nasirhafeez/017fd54af68a3b1d4cdab6355c1370c8 to your computer and use it in GitHub Desktop.
Save nasirhafeez/017fd54af68a3b1d4cdab6355c1370c8 to your computer and use it in GitHub Desktop.
OpenNDS Guide for OpenWRT - Youtube Companion

OpenNDS Guide for OpenWRT: Youtube Companion

This setup has been tested successfully on GL.iNet GL-MT300N-V2 device with OpenWRT v22.

Firewall Setup

By default OpenWRT firewall does not allow web or SSH access on WAN IP. As a captive portal blocks all traffic on LAN until user is authenticated so when we initially enable captive portal on OpenWRT we lose access to the router from LAN side. To manage our OpenWRT we should therefore open access from WAN side.

Access your OpenWRT router via Luci interface. Go to Network => Firewall => Traffic Rules and add a new rule for opening port 80 (HTTP):

Name: ALLOW_WEB
Source Zone: WAN
Destination zone: Device (input)
Destination port: 80

Similarly, add a rule for allowing SSH access on port 22. Click on the Save and Apply button.

OpenNDS Installation Commands

Run the following commands for installing OpenNDS and its dependencies:

opkg update
opkg install opennds nano
opkg install php8 php8-cli php8-mod-openssl

OpenNDS Setup

Open the OpenNDS config file:

nano /etc/config/opennds

Uncomment/set the following parameters in the config file with appropriate values:

option fasport '443'
option fasremotefqdn 'opennds.splashnetworks.co'
option fasremoteip '34.74.216.108'
option faskey '128bcddbf4df3e16147dbb31b3b1b16472a3d2608f10b5407c8cdc352433761f'
option fas_secure_enabled '3'

Save and exit.

Restart OpenNDS process for the changes to take effect.

service opennds restart

ndsctl Commands

OpenNDS comes with a utility to interact with it. Here are some useful commands:

Check status:

ndsctl status

Deauthorize a client:

ndsctl deauth IP|MAC

References

OpenNDS Documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment