### Download and Compile openNDS Source: https://opennds.readthedocs.io/en/stable/compile.html Download, extract, compile, and install the openNDS source code. This snippet also includes enabling the openNDS service to start on boot. ```bash wget https://codeload.github.com/opennds/opennds/tar.gz/v10.2.0 tar -xf v10.2.0 cd openNDS-10.2.0 ``` ```bash make sudo make install sudo systemctl enable opennds ``` -------------------------------- ### Autonomous Blocklist Example (YouTube) Source: https://opennds.readthedocs.io/en/stable/config.html Example of adding YouTube to the autonomous blocklist by specifying its FQDN. ```bash list blocklist_fqdn_list 'youtube.com' ``` -------------------------------- ### Install OpenWrt Packages Source: https://opennds.readthedocs.io/en/stable/walledgarden.html Install necessary packages for Walled Garden on OpenWrt. ipset is not required for OpenWrt 23.05.x and onwards. Ensure dnsmasq-full is installed. ```bash opkg update opkg install ipset (not required for OpenWrt 23.05.x and onwards) opkg remove dnsmasq opkg install dnsmasq-full ``` -------------------------------- ### Start openNDS service on OpenWrt Source: https://opennds.readthedocs.io/en/stable/install.html Use this command to start the openNDS service. Alternatively, rebooting the router will also start the service if it is enabled. ```bash service opennds start ``` -------------------------------- ### Install OpenWrt Build Dependencies Source: https://opennds.readthedocs.io/en/stable/compile.html Installs the necessary development tools and libraries on Debian/Ubuntu systems to build OpenWrt images. ```bash sudo apt-get install git subversion g++ libncurses5-dev gawk zlib1g-dev build-essential ``` -------------------------------- ### Install dnsmasq-full and ipset for Autonomous Walled Garden Source: https://opennds.readthedocs.io/en/stable/config.html Installs necessary packages for autonomous Walled Garden configuration on OpenWrt. Ensure dnsmasq is removed if upgrading from an older version. ```Shell opkg update opkg install ipset opkg remove dnsmasq opkg install dnsmasq-full ``` -------------------------------- ### Autonomous Blocklist Example (Facebook) Source: https://opennds.readthedocs.io/en/stable/config.html Example of adding Facebook to the autonomous blocklist by specifying its FQDNs. ```bash list blocklist_fqdn_list 'facebook.com fbcdn.net' ``` -------------------------------- ### Configure Custom Images in ThemeSpec Source: https://opennds.readthedocs.io/en/stable/config.html Examples of configuring custom images for use in ThemeSpec files, including logos and banners. The image URL must start with http://, https://, or file://. ```bash list fas_custom_images_list 'logo_png=https://openwrt.org/_media/logo.png' ``` ```bash list fas_custom_images_list 'banner1_jpg=https://raw.githubusercontent.com/openNDS/openNDS/v9.0.0/resources/bannerbw.jpg' ``` ```bash list fas_custom_images_list 'banner2_jpg=https://raw.githubusercontent.com/openNDS/openNDS/v9.0.0/resources/bannerpickle.jpg' ``` ```bash list fas_custom_images_list 'banner3_jpg=https://raw.githubusercontent.com/openNDS/openNDS/v9.0.0/resources/bannerseawolf.jpg' ``` -------------------------------- ### Configure and Build OpenWrt Image with openNDS Source: https://opennds.readthedocs.io/en/stable/compile.html Clones the OpenWrt repository, updates and installs feeds, adds the openNDS package, configures the build, and compiles the image. ```bash git clone https://git.openwrt.org/openwrt/openwrt.git cd openwrt ./scripts/feeds update -a ./scripts/feeds install -a ./scripts/feeds uninstall opennds git clone git://github.com/opennds/opennds.git cp -rf opennds/openwrt/opennds package/ rm -rf opennds/ make defconfig make menuconfig ``` ```bash make ``` -------------------------------- ### Autonomous Blocklist Example (Specific Ports) Source: https://opennds.readthedocs.io/en/stable/config.html Example of denying access only to specific ports (443 and 80) for authenticated users, allowing other ports. ```bash list blocklist_port_list '443 80' ``` -------------------------------- ### Configure uhttpd for FAS with PHP Source: https://opennds.readthedocs.io/en/stable/fas.html Add these lines to `/etc/config/uhttpd` to enable FAS with PHP on port 2080. Ensure `php8-cgi` is installed. ```config list listen_http    0.0.0.0:2080 list interpreter ".php=/usr/bin/php-cgi" ``` -------------------------------- ### Download and Compile libmicrohttpd Source: https://opennds.readthedocs.io/en/stable/compile.html Download, extract, configure, and install the libmicrohttpd library, a dependency for openNDS. Ensure the version is compatible with your openNDS version. ```bash wget https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.71.tar.gz tar -xf libmicrohttpd-0.9.71.tar.gz cd libmicrohttpd-0.9.71 ``` ```bash ./configure --disable-https make sudo rm /usr/local/lib/libmicrohttpd* sudo make install sudo rm /etc/ld.so.cache sudo ldconfig -v cd .. ``` -------------------------------- ### Update package list and install openNDS on OpenWrt Source: https://opennds.readthedocs.io/en/stable/install.html Run these commands via SSH to install openNDS on OpenWrt 23.3.x or higher. Ensure your DHCP daemon is serving addresses on the intended interface before proceeding. ```bash opkg update ``` ```bash opkg install opennds ``` -------------------------------- ### is_nodog Source: https://opennds.readthedocs.io/en/stable/libraries.html Checks if nodogsplash is installed. It returns the string 'nodog_yes' and an exit code of 0 if installed, or 'nodog_no' and an exit code greater than 0 if not installed. ```APIDOC ## is_nodog ### Description Checks if nodogsplash is installed. ### Returns String 'nodog_yes' and exit code 0 if it is installed, 'nodog_no' and exit code >0 if it is not. ``` -------------------------------- ### Configure Use of Outdated libmicrohttpd (MHD) Source: https://opennds.readthedocs.io/en/stable/config.html Set this option to '1' to allow OpenNDS to attempt starting with older MHD versions (earlier than 0.9.71) and log an error. The default is '0', which causes NDS to terminate if MHD is too old. Use with caution due to potential instability. ```config option use_outdated_mhd '1' ``` -------------------------------- ### Get Specific Client Details Source: https://opennds.readthedocs.io/en/stable/ndsctl.html Retrieves detailed information about a specific client in JSON format, identified by MAC, IP, token, or HID. This is useful for integration with scripts. Clients not in a preauthenticated state may not be authenticated unless 'allow_preemptive_authentication' is enabled. ```bash /usr/bin/ndsctl json [mac|ip|token|hid] ``` -------------------------------- ### Set MHD WebRoot Directory Source: https://opennds.readthedocs.io/en/stable/config.html Specifies the local path for system CSS files and other static page content. For example, the splash.css file would be served from this directory. ```config option webroot '/etc/opennds/htdocs' ``` -------------------------------- ### Manage openNDS Service Source: https://opennds.readthedocs.io/en/stable/compile.html Commands to control the openNDS service, including starting, restarting, stopping, and disabling it. ```bash sudo systemctl start opennds ``` ```bash sudo systemctl restart opennds ``` ```bash sudo systemctl stop opennds ``` ```bash sudo systemctl disable opennds ``` -------------------------------- ### Configure OpenNDS for fas-aes.php Source: https://opennds.readthedocs.io/en/stable/fas.html These settings are added to the /etc/config/opennds file to configure OpenNDS to use the fas-aes.php script. Ensure PHP 8 or higher with php8-cgi is installed and the script is placed in the web root. ```text option fasport '2080' option faspath '/nds/fas-aes.php' option fas_secure_enabled '2' option faskey 'your_secret_hashed_key_string' ``` -------------------------------- ### Define Custom Files in OpenNDS Source: https://opennds.readthedocs.io/en/stable/config.html Configure custom files to be served by a local FAS. Ensure file names and URLs are properly encoded if they contain spaces or single quotes. The URL must start with http://, https://, or file://. For file:// URLs, ensure the path is a valid mountpoint accessible by OpenNDS. ```bash list fas_custom_files_list '' list fas_custom_files_list '' ``` ```bash list fas_custom_files_list 'advert1_htm=https://raw.githubusercontent.com/openNDS/openNDS/v9.0.0/resources/bannerpickle.htm' ``` -------------------------------- ### pre_setup Source: https://opennds.readthedocs.io/en/stable/libraries.html Creates and configures the base chains for OpenNDS nftables. Returns an exit code of 0 if successful, or 1 if failed. ```APIDOC ## pre_setup ### Description Creates and configures OpenNDS nftables base chains. ### Returns Exit code 0 if successful, 1 if failed. ``` -------------------------------- ### Enable Pre-Installed Dynamic User/Email Login Source: https://opennds.readthedocs.io/en/stable/customize.html Enable the pre-installed dynamic login page sequence by setting the login_option_enabled to '2'. ```shell option login_option_enabled '2' ``` -------------------------------- ### Configure Pre-emptive Clients Source: https://opennds.readthedocs.io/en/stable/config.html Use this command to add clients to the pre-emptive authentication list. Parameters like session timeout, bandwidth rates, and quotas can be specified. A value of '0' or omission sets the parameter to the global default. ```bash list preemptivemac 'mac=00:00:C0:01:D0:01;sessiontimeout=1200;uploadrate=200;downloadrate=0;uploadquota=0;downloadquota=0;custom=custom string for preemptivemac1' ``` ```bash list preemptivemac 'mac=00:00:D0:01:D0:02;sessiontimeout=1000;uploadrate=200;downloadrate=800;uploadquota=0;downloadquota=0;custom=custom string for preemptivemac2' ``` ```bash list preemptivemac 'mac=00:00:E0:01:D0:03;sessiontimeout=4200;uploadrate=100;downloadrate=0;uploadquota=0;downloadquota=0;custom=custom_string_for_preemptivemac3' ``` -------------------------------- ### Prepare Local openNDS Development Environment for OpenWrt Source: https://opennds.readthedocs.io/en/stable/compile.html Sets up a local development environment for openNDS within an OpenWrt build. This involves cloning the openNDS repository, committing local changes, and creating a symbolic link. ```bash git clone git://github.com/opennds/opennds.git cd opennds … apply your changes git commit -am "my change" ln -s /my/own/project/folder/opennds/.git openwrt/package/opennds/git-src ``` -------------------------------- ### Show Full openNDS Configuration (OpenWrt) Source: https://opennds.readthedocs.io/en/stable/customize.html Use this UCI command to display the complete current configuration of openNDS. ```bash uci show opennds ``` -------------------------------- ### Get openNDS Daemon Status Source: https://opennds.readthedocs.io/en/stable/ndsctl.html Prints the current status of the openNDS daemon to standard output. ```bash /usr/bin/ndsctl status ``` -------------------------------- ### Get Gateway Name (OpenWrt) Source: https://opennds.readthedocs.io/en/stable/customize.html Retrieve the current Gateway Name setting for openNDS using the UCI command. ```bash uci get opennds.@opennds[0].gatewayname ``` -------------------------------- ### Enable BinAuth Support Script Source: https://opennds.readthedocs.io/en/stable/config.html Enable BinAuth support by specifying the path to the BinAuth script. This script handles post-authentication processing and client database generation for re-authentication. ```config option binauth '/usr/lib/opennds/binauth_log.sh' ``` -------------------------------- ### Define FAS Generic Variables Source: https://opennds.readthedocs.io/en/stable/config.html Configure generic FAS variables for use in custom FAS or ThemeSpec scripts. Examples include 'membership_number' and 'access_code'. ```bash list fas_custom_variables_list 'membership_number=number' ``` ```bash list fas_custom_variables_list 'access_code=password' ``` -------------------------------- ### Enable openNDS Service Source: https://opennds.readthedocs.io/en/stable/config.html Set to 1 to enable openNDS. Set to 0 to disable. ```config option enabled 1 ``` -------------------------------- ### Configure Autonomous Blocklist (FQDNs) Source: https://opennds.readthedocs.io/en/stable/config.html Configures an autonomous blocklist using a list of FQDNs. Requires dnsmasq-full and potentially ipset. If no ports are specified, all protocols and ports for the FQDNs are blocked. ```bash list blocklist_fqdn_list 'fqdn1 fqdn2 fqdn3 .... fqdnN' ``` ```bash list blocklist_fqdn_list 'fqdn1' ``` ```bash list blocklist_fqdn_list 'fqdn2' ``` ```bash list blocklist_fqdn_list '....... etc.' ``` ```bash list blocklist_fqdn_list 'fqdnN' ``` -------------------------------- ### Configure Ndsctl Socket Path Source: https://opennds.readthedocs.io/en/stable/config.html Sets the name for the ndsctl socket, relative to the tmpfs mountpoint. Ensure the specified directory exists. The example shows a custom path within /tmp. ```config option ndsctlsocket 'sockets/ndsctl.sock' ``` -------------------------------- ### List Clients and Trusted Devices Source: https://opennds.readthedocs.io/en/stable/ndsctl.html Outputs a JSON formatted list of all clients and trusted devices managed by openNDS. ```bash /usr/bin/ndsctl json ``` -------------------------------- ### Configure Remote Image Refresh Interval Source: https://opennds.readthedocs.io/en/stable/clientstatus.html Set the remotes_refresh_interval option to define how often custom images and files are refreshed from their remote sources. Example sets the interval to 10 minutes. ```config option remotes_refresh_interval '10' ``` -------------------------------- ### Enable Default Dynamic Click to Continue Source: https://opennds.readthedocs.io/en/stable/customize.html Enable the default dynamic click to continue page sequence by setting the login_option_enabled to '1'. ```shell option login_option_enabled '1' ``` -------------------------------- ### Add Custom Image to Status Page Source: https://opennds.readthedocs.io/en/stable/clientstatus.html Include custom images in the status page by configuring the fas_custom_images_list option. The image will be stored in /etc/opennds/htdocs/ndsremote/. Example shows how to display the OpenWrt logo. ```config list fas_custom_images_list 'logo_png=https://openwrt.org/_media/logo.png' ``` -------------------------------- ### List All iptables Rules Source: https://opennds.readthedocs.io/en/stable/debug.html To investigate potential conflicts with iptables, list all rules across all chains using the 'iptables -L' command. ```bash iptables -L ``` -------------------------------- ### Set Upload Bucket Ratio Source: https://opennds.readthedocs.io/en/stable/config.html Configure the ratio for upload bucket size. Used with MaxUploadBucketSize to control upload rate limiting. Large values may consume significant memory. ```config option upload_bucket_ratio ‘1’ ``` -------------------------------- ### Enable Custom Dynamic ThemeSpec Pages Source: https://opennds.readthedocs.io/en/stable/customize.html Enable custom ThemeSpec page sequences by setting login_option_enabled to '3' and specifying the path to your ThemeSpec script. ```shell option login_option_enabled '3' ``` ```shell option themespecpath '/path/to/themespec_script' ``` -------------------------------- ### Set Custom Client Status Path Source: https://opennds.readthedocs.io/en/stable/config.html Specify a custom script to generate the client status page. Ensure the script path is correctly set. ```config option statuspath '/mycustomscripts/custom_client_params.sh' ``` -------------------------------- ### Configure Autonomous Blocklist (Ports) Source: https://opennds.readthedocs.io/en/stable/config.html Specifies ports to be blocked for all FQDNs listed in 'blocklist_fqdn_list'. If 'blocklist_port_list' is not specified, all ports are blocked. ```bash list blocklist_port_list 'port1 port2 port3 .... portN' ``` -------------------------------- ### Define Custom Files for ThemeSpec Source: https://opennds.readthedocs.io/en/stable/customize.html Specify custom HTML files for ThemeSpec pages, providing the URL for each file. ```shell list fas_custom_files_list 'advert1_htm=https://raw.githubusercontent.com/openNDS/openNDS/9.0.0/resources/bannerpickle.htm' ``` -------------------------------- ### Check dnsmasq Compile Time Options Source: https://opennds.readthedocs.io/en/stable/walledgarden.html Verify dnsmasq compile time options on generic Linux platforms. This command helps determine if an upgrade to dnsmasq-full is necessary. ```bash dnsmasq --version | grep -m1 'Compile time options:' | cut -d: -f2 ``` -------------------------------- ### Configure Global Data Volume Quotas (UCI) Source: https://opennds.readthedocs.io/en/stable/traffic.html Set global data volume quotas in kB. A value of 0 means no limit. These can be overridden for individual clients. ```uci option uploadquota '0' option downloadquota '0' ``` -------------------------------- ### Configure Generic Linux Walled Garden Ports (Alternative) Source: https://opennds.readthedocs.io/en/stable/walledgarden.html Specify a restricted set of ports for Walled Garden access on generic Linux platforms by adding this line to the /etc/config/opennds file. This is an alternative syntax for port configuration. ```ini walledgarden_port_list [......] ``` -------------------------------- ### Authenticate Client Source: https://opennds.readthedocs.io/en/stable/ndsctl.html Authenticates a client using their IP or MAC address. ```bash /usr/bin/ndsctl auth IP|MAC ``` -------------------------------- ### Configure Gateway FQDN Source: https://opennds.readthedocs.io/en/stable/clientstatus.html Set the gatewayfqdn option to specify the URL for the client status page. Recommended format is two words separated by a period. Set to 'disable' to disable this feature. ```config option gatewayfqdn 'my.status' ``` ```config option gatewayfqdn 'disable' ``` -------------------------------- ### Set Local Log Mountpoint Source: https://opennds.readthedocs.io/en/stable/config.html Directs local logging to a specified mountpoint, such as '/logs'. Avoid using the router's built-in flash storage to prevent excessive wear and potential failure. ```config option log_mountpoint '/logs' ``` -------------------------------- ### Enable Users to Router Passthrough Source: https://opennds.readthedocs.io/en/stable/config.html Set this option to '1' to enable passthrough of user-to-router access rules to the system firewall. Use with caution as incorrect configuration can soft-brick the router. ```config option users_to_router_passthrough '1' ``` -------------------------------- ### Specify Deprecated Configuration File Path Source: https://opennds.readthedocs.io/en/stable/config.html This option is no longer supported and is ignored if present. It was previously used to specify a generic configuration file. ```config option config '/etc/opennds/nds.conf' ``` -------------------------------- ### Set Download Rate Limit Source: https://opennds.readthedocs.io/en/stable/config.html Configure the maximum download speed in kb/s for clients. A value of 0 means no limit. This can be overridden by FAS. ```config option downloadrate '800' ``` -------------------------------- ### Enable Firewall Restart Hook (OpenWrt) Source: https://opennds.readthedocs.io/en/stable/config.html Specific to OpenWrt, this option (defaulting to 1) enables openNDS to reinsert nftables into the FW4 ruleset when the firewall restarts. ```config option fwhook_enabled '1' ``` -------------------------------- ### Set Maximum Local Log Entries Source: https://opennds.readthedocs.io/en/stable/config.html Configures the maximum number of local log entries before rotation. Default is 100. Setting to '0' removes the limit. Be cautious with high values to avoid storage or RAM issues. ```config option max_log_entries '1000' ``` -------------------------------- ### Configure Data Rate Quotas (UCI) Source: https://opennds.readthedocs.io/en/stable/traffic.html Configure data rate quota thresholds and parameters for bursting intervals and bucket filter sizes. Defaults are provided for tuning. ```uci ratecheckwindow (Default 2) download_bucket_ratio (Default 10) upload_bucket_ratio (Default 10) max_download_bucket_size (Default 250) max_upload_bucket_size (Default 250) download_unrestricted_bursting (Default 0, disabled) upload_unrestricted_bursting (Default 0, disabled) downloadrate (Default 0, unlimited) uploadrate (Default 0, unlimited) ``` -------------------------------- ### Block Access for Authenticated Users (Manual) Source: https://opennds.readthedocs.io/en/stable/config.html Manually denies authenticated users access to specific external services by IP address or FQDN. Requires research for IP addresses and may be problematic with dynamic IPs. ```bash list authenticated_users 'block udp port 8020 to 112.122.123.124' ``` ```bash list authenticated_users 'block tcp port 443 to mywebsite.com' ``` -------------------------------- ### Set Upload Rate Limit Source: https://opennds.readthedocs.io/en/stable/config.html Configure the maximum upload speed in kb/s for clients. A value of 0 means no limit. This can be overridden by FAS. ```config option uploadrate '200' ``` -------------------------------- ### Set Download Bucket Ratio Source: https://opennds.readthedocs.io/en/stable/config.html Configure the ratio for download bucket size. Used with MaxDownloadBucketSize to control download rate limiting. Large values may consume significant memory. ```config option download_bucket_ratio ‘5’ ``` -------------------------------- ### Define Custom Parameters in OpenWrt UCI Source: https://opennds.readthedocs.io/en/stable/customparams.html Use the 'list fas_custom_parameters_list' command in OpenWrt UCI to define custom parameters. Ensure values with spaces or special characters are URL-encoded. ```bash list fas_custom_parameters_list 'location=main_building' list fas_custom_parameters_list 'admin_email=norman@bates-motel.com>' list fas_custom_parameters_list 'logo_message=openNDS:%20Perfect%20on%20OpenWrt!' list fas_custom_parameters_list 'banner1_message=BlueWave%20-%20Wireless%20Network%20Specialists' list fas_custom_parameters_list 'banner2_message=HMS%20Pickle' list fas_custom_parameters_list 'banner3_message=SeaWolf%20Cruiser%20Racer' ``` -------------------------------- ### Configure Rate Check Window Source: https://opennds.readthedocs.io/en/stable/config.html Sets the window size for calculating the client data rate using a moving average. The window size is equal to ratecheckwindow times checkinterval (seconds). ```config option ratecheckwindow '3' ``` -------------------------------- ### Define Custom Files for FAS Integration Source: https://opennds.readthedocs.io/en/stable/customparams.html Configure custom files for FAS using 'list fas_custom_files_list'. Similar to custom images, this maps a name to a URL for FAS to utilize. ```bash list fas_custom_files_list 'advert1_htm=https://raw.githubusercontent.com/openNDS/openNDS/v9.5.0/resources/bannerpickle.htm' ``` -------------------------------- ### Specify Custom Status Page Script Source: https://opennds.readthedocs.io/en/stable/clientstatus.html Use the statuspath configuration option to specify an alternate script for generating the client status page. Ensure the script is executable. ```config option statuspath '/usr/lib/opennds/custom_status.sh' ``` -------------------------------- ### Allow Access for Authenticated Users Source: https://opennds.readthedocs.io/en/stable/config.html Grants specific access to authenticated users. Rules are applied in order. Use for granting access to web sites or specific services. ```bash list authenticated_users 'allow all' ``` ```bash list authenticated_users 'allow tcp port 443' ``` ```bash list authenticated_users 'allow udp port 5000 to 123.1.1.1' ``` -------------------------------- ### Define Custom Images for ThemeSpec Source: https://opennds.readthedocs.io/en/stable/customize.html Specify custom image files for ThemeSpec pages, providing the URL for each image. ```shell list fas_custom_images_list 'logo_png=https://openwrt.org/_media/logo.png' ``` ```shell list fas_custom_images_list 'banner1_jpg=https://raw.githubusercontent.com/openNDS/openNDS/9.0.0/resources/bannerbw.jpg' ``` ```shell list fas_custom_images_list 'banner2_jpg=https://raw.githubusercontent.com/openNDS/openNDS/9.0.0/resources/bannerpickle.jpg' ``` ```shell list fas_custom_images_list 'banner3_jpg=https://raw.githubusercontent.com/openNDS/openNDS/9.0.0/resources/bannerseawolf.jpg' ``` -------------------------------- ### Add Firewall Rule for Service Access (OpenWrt) Source: https://opennds.readthedocs.io/en/stable/customize.html Add a new firewall rule using UCI to allow access from users to a specific TCP port on the router. ```bash uci add_list opennds.@opennds[0].users_to_router='allow tcp port 8888' ``` -------------------------------- ### Enable DHCP Option 114 (RFC8910) Source: https://opennds.readthedocs.io/en/stable/config.html This command enables DHCP option 114, which sends the 'default_url' in DHCP replies. This is required for RFC8910 Captive Portal Identification. Set to '1' to enable (default) or '0' to disable. ```bash option dhcp_default_url_enable '0' ``` -------------------------------- ### Configure Fair Usage Policy Throttle Rate (UCI) Source: https://opennds.readthedocs.io/en/stable/traffic.html Set upload/download throttle rates in kb/s for the Fair Usage Policy. If set to 0, clients are deauthenticated when volume quota is exceeded. ```uci option fup_upload_throttle_rate '0' option fup_download_throttle_rate '0' ``` -------------------------------- ### set_key Source: https://opennds.readthedocs.io/en/stable/libraries.html Adds the 'faskey' option to the configuration file with the provided key. Returns an exit code of 0 always. ```APIDOC ## set_key ### Description Adds option 'faskey' to the config file. ### Parameters #### Path Parameters - **arg1** (string) - Required - "set_key" - **arg2** (string) - Required - The key to set. ### Returns Exit code 0 always. ``` -------------------------------- ### Specify Custom Binauth Script Source: https://opennds.readthedocs.io/en/stable/binauth.html Use the `option binauth` to specify a custom script. This will disable default functionality like `auth_restore`. ```config option binauth '/usr/lib/opennds/my_binauth_script.sh' ``` -------------------------------- ### Configure fas-hid.php for HTTP Source: https://opennds.readthedocs.io/en/stable/fas.html Configure fas-hid.php for HTTP enforcement, suitable for devices with limited resources. This script uses a digest of the client token for security. Adjust 'fasport', 'fasremoteip', and 'fasremotefqdn' as needed. ```ini option fasport '80' option faspath '/nds/fas-hid.php' option fas_secure_enabled '1' option faskey 'your_secret_hashed_key_string' option fasremoteip '46.32.240.41' option fasremotefqdn 'blue-wave.net' ``` -------------------------------- ### Set Post-authentication Idle Timeout Source: https://opennds.readthedocs.io/en/stable/config.html Configure the time in minutes after which an idle client is disconnected if no network activity is detected. Default is 120 minutes. ```config option authidletimeout '60' ``` -------------------------------- ### Define Custom Parameters for ThemeSpec Source: https://opennds.readthedocs.io/en/stable/themespec.html Use 'list fas_custom_parameters_list' to define short text strings that can be used as titles for custom images within ThemeSpec HTML. ```bash list fas_custom_parameters_list 'logo_message=openNDS: Perfect on OpenWrt!' ``` ```bash list fas_custom_parameters_list 'banner1_message=BlueWave - Wireless Network Specialists' ``` ```bash list fas_custom_parameters_list 'banner2_message=HMS Pickle' ``` ```bash list fas_custom_parameters_list 'banner3_message=SeaWolf Cruiser Racer' ``` -------------------------------- ### Set ThemeSpec Path for Login Option 3 Source: https://opennds.readthedocs.io/en/stable/config.html Specify the path to the ThemeSpec file when login_option_enabled is set to '3'. The ThemeSpec script generates dynamic splash pages and can reside anywhere accessible to OpenNDS. ```config option themespec_path '/usr/lib/opennds/' ``` -------------------------------- ### Configure OpenWrt Walled Garden Ports Source: https://opennds.readthedocs.io/en/stable/walledgarden.html Optionally, specify a list of IP ports for Walled Garden access on OpenWrt using UCI. This restricts access to the specified ports. ```bash uci add_list opennds.@opennds[0].walledgarden_port_list=' [......] ' ``` -------------------------------- ### Check openNDS Status and Logs Source: https://opennds.readthedocs.io/en/stable/compile.html Commands to check the status of the openNDS service and view system logs for troubleshooting. ```bash sudo ndsctl status ``` ```bash sudo systemctl status opennds ``` ```bash sudo journalctl -e ``` -------------------------------- ### Set Maximum Client Connections Source: https://opennds.readthedocs.io/en/stable/config.html Configure the maximum number of clients allowed to connect. This value should not exceed the router's DHCP lease limit. ```config option maxclients '500' ```