Trouble installing OpenNDS on SlateAXT1800

Hi guys/gals.

I have spent many hours attempting to install OpenNDS as a captive portal system on the GL-AXT1800. I am heading out to the Australian bush with my Starlink dish, and I KNOW that there are lots of people in the more remote areas who would be willing to pay for some of my ‘spare’ bandwidth. I’ve been out there in the last six months and there is quite a need.

When I go to install OpenNDS there is only one library that is not already loaded and that is libmicrohttpd-no-ssl.

The issue is as soon as I install the system it just bricks the router :frowning_face: I have to press the rest button and start again.

Also tried to install nodogsplash (which installs the same library) and again, one bricked router. VERY frustrating!

I am running firmware OpenWrt 21.02-SNAPSHOT r16399+157-c67509efd7 / LuCI openwrt-22.03 branch git-21.284.67084-e4d24f0

Kernel version 4.4.6

BTW I tried using the Applications drop down from the left menu (and then plugins), selecting the OpenNDS and installing that way, and I also tried using the Luci interface. Same result for both methods.

Any suggestions/help VERY much appreciated.

iMac

Just to add more grist to the mill… I decided to have ‘fun’ and downloaded Putty and SSH’d into the router and try that method of install to see if there was anything showing under that method.

No joy! It appeared to install fine (ended with database updated), but when I try to get back into the router to do a bit more config I end up with “Error 403 - Forbidden - Access Denied to this Client!”. :frowning:

I am hardwired to the router.

iMac

Taken from here: Installing openNDS — openNDS v10.2.0
“openNDS may or may not work on older versions of OpenWrt”

Which slate firmware version are you using? 4.0.3 or 4.1.0?

Hope this works…

Firmware: OpenWrt 21.02-SNAPSHOT r16399+157-c67509efd7 / LuCI openwrt-22.03 branch git-21.284.67084-e4d24f0

Kernel: 4.4.60

Might have something to do with GL.iNet own captive portal system and Guest authentication.

This is firmware version 4.0.3
It seems, this OpenWrt version is not supported, when you have to reset after the installation.
You could try to use an older or newer version (4.1.0 beta5) of the firmware, to see if it bricks the router as well.
Did you try to install using the latest OpenNDS version? Releases · openNDS/openNDS · GitHub

Thanks for the tip. Will try a previous version. And yes I did use the latest version :slight_smile:

OK, no joy :frowning:

I tried firmware version 4.0.0, version 4.0.2 and version 4.1.0 (that’s all that’s available on the site). Now back at 4.0.3

I suppose I could try installing an older version of opennds.

I am out of ideas :frowning:

If you have something then I am all ears :slight_smile:

This great unit is going to be a centerpiece in my caravan network, and I would LOVE to get the OpenNDS going if at all possible.

Ciao

That’s not good. I have one last idea: Did you try to install an older version of openNDS?
https://opennds.readthedocs.io/en/stable/faq.html#what-s-the-difference-between-versions

There is another user who ran openNDS on a Gli Net router. Try contacting him:

And I found this: OpenWRT - Captive Portal - WiFi Splash Page - YouTube

Thanks. Also got some info from the OpenWRT forum that I am chasing. Will keep you posted as to results.

An update…

I have made MAJOR progress and the system is working beautifully with one small exception. I want to use a USB drive for the voucher file and logs (as suggested in the documentation). I saw in the doco that you can use option log_mountpoint '/logs', so I tried option log_mountpoint '/mnt/sda1/logs' - the location for the USB drive - but for some reason it would not work. I checked permissions; 766 on the log file and the voucher file. But it kept telling me the voucher was invalid :frowning: As soon as I went back to the default it worked again (for which I breathed a sigh of relief :slight_smile: ). Obviously, I am a knucklehead doing something wrong! Can someone please point me in the right direction?

I have been documenting the install as I have been going along and will share that when I am finished.

PS. Kudos to all involved. The system is a cracker, and perfectly meets what I need!!

Jerji

1 Like

Installing OpenNDS on gl.1800ATX Router

Introduction

The process below worked for me, but may change over time as the firmware for the modem is updated and the application is changed.

There was a fair bit of trial and error to get here.

In general terms the things you need to look out for include:

  • The wireless interface for the web gets closed when you install the software making it appear that you have bricked the device. Plow on!!
  • You MUST have an SSH client BEFORE you start – I used Putty.
  • You need an Internet connection
  • You need to know how to use a command line editor in linux (nano, vi, vim, etc) – google it if you need to know how.

A good resource is Installing openNDS — openNDS v9.9.1

The install

I recommend going from a fresh install (hold the reset button down for over 10 seconds until the blue light on the top is flashing fast). This ensures that other extensions are not going to impact/interfere.

I started with a WIRED CONNECTION. For that you will need a fixed IP address of 192.168.8 100 and a Netmask of 255.255.255.0 on your PC/Mac/X/X. I will assume a PC from here on in.

In a browser on your PC, open the web interface at http://192.168.8.1 Set up the language and the password (if you reset).

I used the repeater setting on the router to join onto my existing network.

On the router set up the two MAIN wireless interfaces (give them a name and a password you can remember).

Set up the guest wireless networks with open security (OpenNDS will be your security)!

Open putty as root (uses same password as the web interface) and connect to 192.168.8.1 and enter the root password.

Type opkg update and press enter

Type opkg install opennds and press enter

Type service opennds stop and press enter – what this does is to stop the service so we can configure it :blush: This is where I ran into some issues to start with as the running service stopped me from connecting wirelessly to manage/configure the newly installed service – a bit of a catch 22.

OK at this point you can disconnect the ethernet and connect to the main wireless interface – do this now so your putty session can continue over the air (you may have to restart the session).

You now need to work out the interface to which you need to connect. The interface which the system runs on by default is br-lan.

To find yours type ifconfig and press enter

The list is longer than shown below…

The one I wanted it to run on was br-guest. To modify this (in putty) edit the file /etc/config/opennds (using VIM or VI or your choice of editor). You need to scroll down uncomment the line (by removing the #) that says #option gatewayinterface ‘br-lan’ and change br-lan to br-guest. See the corrected line below.

Next, we may as well change the gateway name while we are here. Scroll down to find GatewayName. Read the comments and then change the name to suit.

OK at this point we can restart the service. Type service opennds start and press enter

And now we can test to see if our magic works :blush:

Notice at this stage there is no voucher details being asked for. That comes later… The main thing is the captive portal is working.

We can customise the landing page.

Now because there is currently no protection on that connection, I suggest you go into putty and type service opennds stop and press enter and also go back into the web interface and stop the guest networks. What comes next takes a while and we don’t want others using our network in the meantime.

It should now be running with a simple “click to continue” splash page sequence.
Test it by connecting with your smartphone or tablet and you should get the “popup” login screen.

Now you need to download the Community “Voucher script” and “Voucher Roll”
Use the following commands:

cd /usr/lib/opennds
wget https://raw.githubusercontent.com/openNDS/openNDS/master/community/themespec/theme_voucher/theme_voucher.sh
cd /tmp/ndslog
wget https://raw.githubusercontent.com/openNDS/openNDS/master/community/themespec/theme_voucher/vouchers.txt

Now you need to activate the voucher script.
Use the following commands:

chmod 744 /usr/lib/opennds/theme_voucher.sh
uci set opennds.@opennds[0].login_option_enabled='3'
uci set opennds.@opennds[0].themespec_path='/usr/lib/opennds/theme_voucher.sh'
uci commit opennds
service opennds restart

OpenNDS should now be running the voucher script.
Test it by connecting again with your phone or tablet.
You will need a voucher code from the example vouchers.txt file you downloaded.

At this point it is safe to leave the system running as there is some form of protection (albeit the standard vouchers copied over from the Internet)

Now to customise it a bit…

First go to /usr/lib/opennds and modify theme.voucher.sh

Search for portal and replace Blue Wave Projects and Services 2015 with your domain (insert it in an HREF if desired). Save.

Upload a new splash screen image to /etc/opennds/htdocs/images/splash.jpg and it becomes…

You need to test it with some of the vouchers and check that it lets you in. The user should now accept the terms and enter the voucher… Ok it SHOULD now be working.

The next step (yes, the story continues) is to generate your vouchers…

Vouchers

In order to generate new vouchers, you need two things:

  • a script
  • a program to run the script.

In both cases they are very easy to get from the internet.

The script you can get from https://raw.githubusercontent.com/openNDS/openNDS/master/community/themespec/theme_voucher/voucher_generator.py

The program, I recommend downloading the python application from Download Python | Python.org . Hint – you may need to install it as an administrator.

Below is a copy of the script with a few explanations (comments are after the #):
`

Hotspot Voucher Generator

import random
import string
rate_down=5120 # in Bits so this is 5Mb/s download (plenty for youtube)
rate_up=1024 # in bits so this is 1Mb/s upload
quota_down=5120 # in MB so this is 5GB
quota_up=0
validity=7200 #minutes
voucher_qty=20 # adjust as needed

def randomstring(length=4):
    letters = string.ascii_uppercase + string.digits
    return "".join(random.choice(letters) for i in range(length))

def new_voucher():
    voucher_code = f"{randomstring()}-{randomstring()}"
    return f"{voucher_code},{rate_down},{rate_up},{quota_down},{quota_up},{validity},0\n"

filepath="vouchers.txt"

with open(filepath, "a") as voucher_file:
    for i in range(voucher_qty):
        voucher_file.write(new_voucher())

To run the script, open an administrator level command prompt. Navigate to where you have the script and type python voucher_generator.py

It only takes a second and a new file called voucher.txt is created. Copy the contents to the voucher.txt file on the router and you are good to go.

If you want to get fancy then you can open the voucher.txt file in excel and use that to create a maailmerge/form letter that you can give/sell to clients with the details. Over to you for that!

Terms of Service

One important step to do is to review the provided Terms of Service. They are hidden in a script so…

Using an ssh session on the router open /usr/lib/opennds/theme_voucher.sh

You will need to scroll down a fair way and read the terms. Don’t like them, then edit/create your own and follow the same format.

Storage of Logs and Voucher.txt file

We need to have a system that protects the logs and the voucher.txt file from the RAM of the router. For that we use a USB. In order to get the USB ready, follow the instructions at [OpenWrt Wiki] Using storage devices

Set up USB for vouchers and logs – A work in progress!

Backup

Now that you have finished the setup and everything is working – BACKUP!!!

4 Likes

I reformated the text, can you pls check if everything is correct?

Looks good. Thanks iMac

It looks interesting.
I will try installing it on Flint tonight.
It’d be great if GL could integrate it in future firmware release.

@bowow99 May I ask for your assistant.

I have not reset my router.
I have made the two WIFI interfaces to be “OPEN” security.
“opkg install opennds”, modified “br-guest”, “service opennds start”
Connected to the guest WIFI, there was no captive portal.
Internet access was normal.

Run the “wget theme_voucher.sh”, “chmod”, “uci set”, etc and “opennds restart”, same.
No captive portal. Internet access was normal.

Thanks.

Okay I have tried it on another GL router. AdGuard is conflicting with OpenNds.