Step 2: Router software setup
In this setup, the router has three jobs:
-
Run a DHCP server
-
Run a DNS server (technically optional, but how many IPs are you willing to remember?)
-
Route packets (duh)
Every router is different, but most modern ones can do these three things out of the box. If your router can’t run a DNS server in the factory configuration (like my Linksys wrt160n from 2007), there is almost certainly open-source firmware (I use DW-WRT) that can.
A very, very brief networking primer
If you aren’t a networking person, here’s what you need to know to understand what jobs the router does in this setup, and maybe have a starting point if you need to debug something.
-
DHCP (Dynamic Host Configuration Protocol) is a way of assigning IP addresses dynamically (i.e. not statically). When a client (like your vehicle or laptop) connects to a network, the DHCP server gives it an IP.
-
If your laptop or your vehicle isn’t getting an IP address, DHCP is probably configured wrong.
-
This could mean the DHCP server isn’t running (correctly) on the router, or that your vehicle isn’t configured to be a DHCP client.
-
A DNS Server (Domain Name System Server) handles translating between domain names (like “google.com”) and IP addresses (“142.251.167.138”). The DNS server in our system is only responsible for translating the addresses of our vehicles.
-
If you can ping your vehicle by its IP, but not its name, DNS is probably borked.
-
You can debug DNS issues with tools like “nslookup” (simple) “dig” (a bit complex, but more powerful)
Step 2.1: Setup DHCP
Login to your router configuration page, and ensure that “DHCP Type” is DHCP server and/or that “DHCP Server” is “enabled”. Chances are, you won’t need to change anything.
Step 2.1.1: Make your vehicles DHCP clients
Go into the network menu, choose the ethernet interface, and select “dynamic IP”. Note: do not select the DHCP server option, as this will create a server to compete with the one on the router. This can bring your network to a halt.
Step 2.1.2: Make your BaseStation(s) a DHCP client(s)
By default, your BaseStation is an access point with a static IP address. Log in to the BaseStation web interface, and change “address acquisition” from “Static” to “Automatic”. Since the BaseStation is an access point, it will happily pass DHCP messages to and from your boats without any extra configuration.
Step 2.1.3: (optional; recommended) Create static DHCP reservations
Optionally (and I recommend this), you can also give your vehicles DHCP reservations. This means that each vehicle will get the same IP every time it joins the network. While this may sound like “static IPs with extra steps”, it gives you the advantage of being able to configure each one from a central location if you ever want to reallocate. Additionally, you can add new devices to the network, and they will get dynamic addresses without any special configuration.
In DDWRT, this requires adding the MAC address of the vehicle along with the IP you desire for it (make sure it’s in the range of your DHCP server; usually 192.168.1.101-151 by default)
Step 2.2: Setup DNS
If your router has friendly firmware, setting up DNS should be as easy as adding a hostname next to a static reservation. I recommend using the “.lan” TLD. If you use a TLD that is used for websites, you might not be able to connect to your vehicles while also connected to the internet, as the DNS server your ISP provides will handle that request and return an “idk who that is”.
NOTE: modern browsers might try to google “.lan”, as “.lan” is not a TLD that is used on the internet. To circumvent this, type “.lan**/**”. This will make the browser ask that address for a webpage.
To actually be able to access the DNS server (eg ping a domain) from a client, you’ll need to set the “static DNS server” on the router to be the router’s IP.