mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2025-12-08 23:04:35 +00:00
Network setup handbook updates
This commit is contained in:
@@ -10,46 +10,29 @@
|
||||
|
||||
<h1>Hut Network Configuration</h1>
|
||||
|
||||
<div align=center>
|
||||
<p>If the internet is not working, the <b>first thing to check</b> is that<br>the black WiFi antennae are
|
||||
still upright and have not been knocked sideways.
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<h2>Networking Software - configuration nerding</h2>
|
||||
|
||||
<p>First, make sure you understand the physical cabling:
|
||||
|
||||
<figure align=center >
|
||||
<a href="../l/hut-cables.html"><img border=1 src="../t/hut-cables-small.jpg"></a>
|
||||
<br><figcaption>Hut Network - click for instructions</figcaption>
|
||||
<img border=1 src="./new-potato-hut-network.svg">
|
||||
<br><figcaption>Hut Network</figcaption>
|
||||
</figure>
|
||||
|
||||
<p>The Wavlink antenna sits on the outside of the potato hut and picks up the Gasthof WiFi. This is wired via ethernet cable and PoE (Power over Ethernet adapter) to the Netgear router, which acts as a switch and wireless access point. DHCP is done by the antenna. The antenna should be wired to one of the black LAN ports on the router, not the yellow WAN port. The Wavlink antenna is set up in "Repeater" & "WISP" mode. This is the only device seen by the Gasthof WiFi as it performs NAT for devices connected to its network. A device must manually login to the Gasthof network every so often, which autheticates for all devices on our network. In the past there has been an automated login script, but this is currently broken.
|
||||
|
||||
<p>The ethernet cable to the outisde is run into the ceiling vent above the kitchen and then out of the wall vent above the sink outside the tatty hut. The antenna is mounted to a screw on the wall near there. In 2025 the download speed achieved from this setup was 50-60Mbps.
|
||||
|
||||
|
||||
<h3>Expo laptops</h3>
|
||||
<p>Both expo laptops Crowley and Aziraphale use DHCP to get an IP4 address and the identity of a DNS nameserver. Neither laptop has any other configuration.
|
||||
<p>If you connect your laptop or phone to the potato hut wifi you will connect in the same way.
|
||||
|
||||
<h3>The Gasthof Wifi</h3>
|
||||
|
||||
<p>The Gasthof WiFi - which you can use if you are close enough to the main building - is "StaudnGast" and has no WiFi password but there is a login webpage. It allocates IP addresses in the range <samp>192.168.2.x</samp> etc. The antenna is now on the first-floor balcony within sight of the tatty hut window. You can get the password from the Gasthof front desk, or during expo it is usally written on the whiteboard in the potato hut. In the scripts published in this handbook we use the word GASTSECRET instead of the real password.
|
||||
<p>If you are not actively using the internet, the Gasthof system will close the connection after a few minutes and you will have to re-login again, typing the password into the login page.
|
||||
|
||||
|
||||
<h3>The potato hut wifi</h3>
|
||||
<p>The potato hut wiFi has <a href="https://www.howtogeek.com/334935/what-is-an-ssid-or-service-set-identifier/">SSID</a> "potatohut" with our usual cavey:beery password. Like almost every other wifi anywhere it is running DHCP and allocating IP addresses to your device.
|
||||
<p>The DHCP system is issuing IP4 addresses of the form <samp>192.168.200.x</samp> or <samp>192.168.250.x</samp> where x is a number between 50 and 199
|
||||
with a lifetime of 12 hours. (The Netgear router uses <samp>192.168.200.x</samp> and the tp-link WRT41N router iuses <samp>192.168.250.x</samp>.
|
||||
In 2023 we are using the tp-link router.)
|
||||
<p>The <em>Expo laptops</em> acquire a dynamic local address of this form,
|
||||
as does any other laptop or phone connecting to this wifi. (Apart from Crowley, which has a reserved address of <samp>192.168.z.200</samp>.)
|
||||
<p>The potato hut WiFi has <a href="https://www.howtogeek.com/334935/what-is-an-ssid-or-service-set-identifier/">SSID</a> "potatohut" with our usual cavey:beery password. Like almost every other wifi anywhere it is running DHCP (done by the Wavlink) and allocating IP addresses to your device.
|
||||
|
||||
<h3>How it works - in words</h3>
|
||||
<p>The <a href="https://en.wikipedia.org/wiki/Acer_Aspire_One">Acer Aspire One</a> netbook is running Debian Linux operating system
|
||||
(<em>Bookworm</em> stable v12.6 in 2024)
|
||||
with the lightweight <a href="https://xfce.org/">[xfce]</a> window mananger. It runs a script once every 60s which checks whether it can access the internet. If it can't, it attempts a re-login to the Gasthof wifi system, which takes 5-10 seconds. If it still can't access the internet it deletes nearly all the configuration and reloads everything - which takes about 30s. The mere fact that it accesses the internet every minute is enough for the Gasthof system to keep the connection open - until it times out completely which it does after an hour or so.
|
||||
<h3>Automated Login Script</h3>
|
||||
<p>The old script ran a script once every 60s which checks whether it can access the internet. If it can't, it attempts a re-login to the Gasthof wifi system, which takes 5-10 seconds. If it still can't access the internet it deletes nearly all the configuration and reloads everything - which takes about 30s. The mere fact that it accesses the internet every minute is enough for the Gasthof system to keep the connection open - until it times out completely which it does after an hour or so.
|
||||
|
||||
<p>The <str>used</str> scripts on the netbook live in <var>/root/fakenet</var> so that the cron job (running as root) can access them and things work even if /home is not mounted. [This is not the usual Linux place to keep such things.] The cron file lives in the usual place in <var>/etc/cron/cron.d/fakenet</var>.
|
||||
<p>The <str>used</str> scripts on the netbook live in <var>/root/fakenet</var> so that the cron job (running as root) can access them and things work even if /home is not mounted. [This is not the usual Linux place to keep such things.] The cron file lives in the usual place in <var>/etc/cron/cron.d/fakenet</var>.
|
||||
Ignore the backup copy in /home/expo/fakenet.
|
||||
<p>When the netbook powers up, the script <var>/etc/init.d/fakenet</var> runs which sets everything going for the first time.
|
||||
|
||||
@@ -65,8 +48,9 @@ Ignore the backup copy in /home/expo/fakenet.
|
||||
</figure>
|
||||
|
||||
<p>In 2023 we have an alternative wifi/router in Austria, a <a href="https://www.expertreviews.co.uk/tp-link/1401766/tp-link-tl-wr841n-review">TL-WR841N</a> belonging to Wookey which is configured identically to the Netgear device except that the username is 'root' not 'admin'. It would be good to test this so we could give ARM their WNDR4000 back, and the TP-link router can become expo's.
|
||||
<p>One important difference is that the ethernet cable from the netbook is plugged into the blue socket on the WR841N (it is yellow on the Netgear), and the 4 white sockets on the Netgear are 4 yellow sockets on the WR841N. A word of warning: the WR841N has been flashed with new firmware (openWRT) and so any documentation you may read in online manuals for it will be wrong: notably the reset and wifi on/off buttons don't have any effect, and the lights don't flash in the way the manuals say they do. There is also no USB socket, no 5Ghz, slower ethernet (100Mbps not 1Gbps) and the wifi range out to the tents is probably worse than the Netgear wifi.
|
||||
<s><p>One important difference is that the ethernet cable from the netbook is plugged into the blue socket on the WR841N (it is yellow on the Netgear), and the 4 white sockets on the Netgear are 4 yellow sockets on the WR841N.</s> A word of warning: the WR841N has been flashed with new firmware (openWRT) and so any documentation you may read in online manuals for it will be wrong: notably the reset and wifi on/off buttons don't have any effect, and the lights don't flash in the way the manuals say they do. There is also no USB socket, no 5Ghz, slower ethernet (100Mbps not 1Gbps) and the wifi range out to the tents is probably worse than the Netgear wifi.
|
||||
|
||||
<s>
|
||||
<h4>Alfa wifi device</h4>
|
||||
<p>The Alfa AWUS036ACH is a high-power external wifi aerial to connect across the campsite to the gasthof.
|
||||
It uses the Realtek RTL8812AU chipset.
|
||||
@@ -78,68 +62,43 @@ then running <tt>/home/expo/alfa-driver/morrownr/install-driver.sh NoPrompt</tt>
|
||||
<p>I recommend not updating the kernel for the duration of expo.
|
||||
We are getting 15-30 Mbit/s download speed with this device at the Acer Aspire netbook (3 July 2023).
|
||||
<p>Note that this dual-antenna WiFi thing is a <em>high power</em> device: it won't work if plugged in via an unpowered USB hub. It is also fussy about which USB port it is plugged into on the netbook.
|
||||
</s>
|
||||
|
||||
<h4>IP6</h4>
|
||||
<p>While you can use 5Ghz wifi and IP6 to connect within the hut (if the Netgear router is being used),
|
||||
there is no IP6 connectivity to the external internet. Sorry. We are dependent on the Gasthof system for this. Use a phone and data roaming if you want it.
|
||||
|
||||
<h3>4 different 'networks'</h3>
|
||||
<p>To understand how the network is configured, you need to realise that we have to manage these different 'networks':
|
||||
<ul>
|
||||
<li><samp>192.168.2.x</samp> The Gasthof wifi network
|
||||
<li><samp>192.168.200.x</samp> The potato hut wifi network (or <samp>192.168.250.x</samp>)
|
||||
<li><samp>10.0.1.x</samp> The network on the short bit of cable connecting the netbook with the router.
|
||||
<li>The network on the longer length of cable connecting the router with the <var>expo laptop</var> (and sometimes the printer).
|
||||
</ul>
|
||||
We bridge the hut wifi with the hut ethernet cable to the <var>expo laptop</var> so they are both <samp>192.168.200.x</samp>, but this is a matter of choice. This is configured inside the wifi/router using the webpage control panel.
|
||||
|
||||
<h4>Where the DNS happens</h4>
|
||||
<s><h4>Where the DNS happens</h4>
|
||||
<p> DNS is what connects a computer name (such as <var>expo.survex.com</var>) with an internet address (such as <samp>78.129.164.125</samp>). To make the internet work, we need to tell every laptop and phone where to find a DNS nameserver, or what machine to ask in order to get DNS queries forwarded to a DNS nameserver.
|
||||
<p>The DNS configuration happens in the netbook, using dnsmasq. The router just forwards DNS queries to the netbook, and tells laptops connected to the hut wifi to use that too.
|
||||
<p>The DNS configuration happens in the netbook, using dnsmasq. The router just forwards DNS queries to the netbook, and tells laptops connected to the hut wifi to use that too.</s>
|
||||
|
||||
<h4>Where the DHCP happens</h4>
|
||||
<p>DHCP is what decides what the <samp>x</samp> is when the wifi issues an address that a laptop must use when it connects to the wifi as <samp>192.168.200.x</samp>.
|
||||
<p>We have done this in two different ways:
|
||||
<ol>
|
||||
<li>2017-2019 : in the netbook.
|
||||
<li>2022-2024 : in the router (Netgear or tp-link) box.
|
||||
<li>2017-2019 : in the netbook.
|
||||
<li>2022-2024 : in the router (Netgear or tp-link) box.
|
||||
<li>2025 : in the Wavlink antenna.
|
||||
</ol>
|
||||
<p>1. The benefit of doing it in the router box is that you get to play with a graphical web interface not text files. But also you can test that the router is working separately from everything else.
|
||||
<p>2. The benefit of doing it in the netbook is that all the configuration is in the same place, and you only have to learn one way of doing things instead of having to use text files <em>and</em> a web interface. Also, by making the router completely dumb, it is swap-replaceable if it dies with no reconfiguration required.
|
||||
<p>The DHCP is configured to issue IP addresses with <samp>x</samp> between 50 and 199, i.e. laptops and phones will get IP addresses between <samp>192.168.250.50</samp> and <samp>192.168.250.199</samp>. These may change after 12 hours.
|
||||
<p>The router itself is <samp>192.168.250.1</samp>
|
||||
|
||||
<p>We also have the address <samp>192.168.250.200</samp> reserved for the expo laptop <em>crowley</em> in both routers.
|
||||
<s><p>We also have the address <samp>192.168.250.200</samp> reserved for the expo laptop <em>crowley</em> in both routers.</s>
|
||||
|
||||
|
||||
<h4>Interfaces</h4>
|
||||
|
||||
<p>The netbook has two network interfaces: the Alfa wifi antenna (which is 'wlan1' and has an address 192.168.2.x issued by the Gasthof wifi system using DHCP)
|
||||
plugged into a USB socket, and the netbook's ethernet cable socket (eth0) which is configured to have the address <samp>10.0.1.2</samp>.
|
||||
|
||||
<p>The netbook also has a defunct interface 'wlan0' which is the internal wifi which is broken and unused.
|
||||
However it can cause configuration problems (notably for the first few days of expo 2023). These are the runes to type on the netbook to stop it interfering:
|
||||
<pre><code>sudo ip addr add 10.0.42.1/24 dev wlan0
|
||||
sudo ip addr del 10.0.1.1/24 dev wlan0</code></pre>
|
||||
|
||||
<p>The router has its WAN (yellow or blue ethernet cable socket) set to the address <samp>10.0.1.1</samp>. The four other ethernet sockets are all on the address range <samp>192.168.250.x</samp> and the wifi network interface is set to <samp>192.168.250.1</samp> also in the network <samp>192.168.250.x</samp>.
|
||||
|
||||
<p>So the ethernet cable between the router and the netbook is <samp>10.0.1.1</samp> at the router end and <samp>10.0.1.2</samp> at the netbook end. Nothing else uses any number like <samp>10.0.1.x</samp>.
|
||||
|
||||
<p>The line
|
||||
<pre><code>sudo ip addr del 10.0.1.1/24 dev wlan0</code></pre>
|
||||
has been added to the end of the runfakenet script as this setting does not seem to persist after a reboot (8 July 2023).
|
||||
|
||||
<h4>Printer</h4>
|
||||
<p>
|
||||
We have a Samsung C430W printer with broken ethernet and wirless networking, but the USB cable works.
|
||||
<p>From a clean Debian install on the expo laptop, the missing thing for making the printer work was: apt-get install libcupsimage2
|
||||
<p> We have a Samsung C430W printer, which can be connected to the network via ethernet, giving everyone printing access on their own device (2025).
|
||||
|
||||
<h5>Making the printer work with the expo laptop</h5>
|
||||
<p>From a clean Debian install on the expo laptop, the missing thing for making the printer work was: apt-get install libcupsimage2
|
||||
|
||||
Also you need the Samsung driver installation from the Samsung website (see below).
|
||||
<p>To share the printer:<br>
|
||||
cupsctl --share-printers<br>
|
||||
lpadmin -p C43x-Series -o printer-is-shared=true<br>
|
||||
this should be one-time config.
|
||||
|
||||
<h4>Samsung Unified Printer Driver</h4>
|
||||
<p>We have our own archive copy of this driver at
|
||||
<a href="/expofiles/documents/uld.zip">expofiles/documents/uld.zip</a>.
|
||||
@@ -198,44 +157,18 @@ and add it to your system.</p>
|
||||
</ol>
|
||||
|
||||
|
||||
<h4 style="color: red">When it all goes wrong</h4>
|
||||
<p>If everything is working between devices in the hut, but there is no internet access, then the <b>first thing to check</b> is that
|
||||
the black WiFi antennae on the small black Alfa box are still upright and have not been knocked sideways.
|
||||
<h4 style="color: red">Troubleshooting</h4>
|
||||
<p>Sometimes the WiFi may break and fail to allow devices to connect to the network. The first thing to try when this happens it to power cycle the Wavlink antenna. The can be done using the power button on the PoE adapter. The Gasthof network will likely have to be manually authenticated again afterwards, using any device.
|
||||
|
||||
<p>The next thing is to take a phone out to the road and try to connect directly to the Gasthof wifi. This is to check that the Gasthof is on the internet and that the problem is not between the Gasthof and the rest of the world.
|
||||
<p>If the local network is working but doesn't have internet access, take a phone out to the road and try to connect directly to the Gasthof wifi. This is to check that the Gasthof is on the internet and that the problem is not between the Gasthof and the rest of the world.
|
||||
|
||||
<p>You test whether the internet is running by trying to visit <a href="http://www.google.com">www.google.com</a> or
|
||||
<a href="https://github.com">github.com</a>.
|
||||
|
||||
<p>The netbook attempts a reconnection every 60 seconds, so wait at least 2 minutes before doing anything. That is because when the netbook attempts a full reconnection it can take nearly a minute to rebuild everything.
|
||||
|
||||
<p>Test whether the netbook is actually running and responding by sitting at the <var>expo laptop</var> and logging into the netbook remotely. Do this in a terminal window:
|
||||
<pre><code>ssh expo@tclaspire3.potatohut</code></pre>
|
||||
or
|
||||
<pre><code>ssh tclaspire3</code></pre>
|
||||
|
||||
<p>If you get a login prompt, the netbook is running. It is a slow machine so do not expect this to be instant. (You are logged in as 'expo' on the expo laptop so it automatically logs you in as 'expo' on the netbook.)
|
||||
<p>Login to the netbook (as user 'expo' using the cavey:beery password) and type this at a prompt:
|
||||
<pre><code>/root/fakenet/runfakenet</code></pre>
|
||||
which will run the script to reconnect. This may take a minute to have the desired effect.
|
||||
|
||||
<p>If you didn't get a prompt when you attempted to login from the <var>expo laptop</var> then you will need to do the same thing but actually on the netbook keyboard.
|
||||
[This happens if the netbook has lost its routing config (which is set up by runfakenet) and so there is no communication between the netbook and the router.]
|
||||
<p>While you are at it, it would be a good idea to re-boot the netbook first by typing this on the netbook keyboard first, and waiting for it to re-boot:
|
||||
<pre><code>sudo shutdown --reboot</code></pre>
|
||||
<p>You may also need to re-enable wicd, see below.
|
||||
|
||||
<p>If it keeps failing, then maybe the <var>cron</var> system which re-triggers it every 60s is not working. That is probably a symptom of something more much more serious wrong with the netbook if you have already re-booted it. Try re-booting it again and this time be more patient. <em>Report this</em> to a nerd, <em>write a record of the problem in the expo logbook</em> and <em><a href="https://app.element.io/#/room/#LoserExpoWebsite:matrix.org">post a request for help</a></em> to the expo Matrix chat system.
|
||||
|
||||
<h4>wicd</h4>
|
||||
<p>In 2024 this may be entirely different...</p>
|
||||
|
||||
<p>The netbook needs to have its persistent networking set up correctly <i>in addition to the other scripts</i>. This
|
||||
is the <a href="https://launchpad.net/wicd">wicd</a> gui program that has an icon in the top-right of the sceen in the
|
||||
system panel. (Or search in all applications in the Internet section for the <var>wicd</var> application). Set the checkboxes so
|
||||
that the netbook does not connect to any network except the StaudnGast wifi network, and also tick the 'automatically
|
||||
reconnect' checkbox for the "StaudnGast" network.
|
||||
|
||||
<hr><hr>
|
||||
<h1>Script information (out of date)</h1>
|
||||
<h2 id="scripts">The scripts</h2>
|
||||
<p>For the curious or desperate, here is how the scripts actually work.
|
||||
<p>The master copy of the scripts in on the expo server in <var>/home/expo/config/netbook</var> which includes the files
|
||||
@@ -466,36 +399,6 @@ someone does a debian upgrade. The scripts use the <a href="https://wiki.debian.
|
||||
|
||||
<p>So all this will need reimplementing for expo 2024.
|
||||
|
||||
<h2>Historical Notes</h2>
|
||||
|
||||
<p>Prior to 2017 we used to run an unconnected local network with our own DNS domain
|
||||
name "potato.hut", our own server holding all the website and survey data, and published WiFi as SSID "potatohut".
|
||||
Updates to the rest of the world were done by taking an up-to-date laptop which had been in
|
||||
the tatty hut to a real internet connection and
|
||||
pushing the changes to the distributed version control system on
|
||||
<span style="font-family:monospace">expo.survex.com</span> to be merged.
|
||||
</p>
|
||||
|
||||
<p>In 2017 we arrived on expo to discover that our hard-drive in the hut had died (taking the music collection with it) which triggered the general reconfiguration to connect the tattyhut to
|
||||
the internet continuously and not to have our own local server. This coincided with a much-improved WiFi service at
|
||||
the Gasthof. We continued with the wifi service in the hut but now it also connects to the external internet instead of to a 'pretend' internet (which is why the system is called 'fakenet').
|
||||
|
||||
<p>In 2018 and 2019 we had good Internet access at basecamp, but the high-gain system (old Alfa) was returned to its owner (Sam) during Covid (2020-21). Wookey bought a new one, which proved to not live up to its advertising.
|
||||
<p>In 2022 Wifi reception from the Gasthof was very poor. The connection script was improved so that dropped connections were restored more quickly. However the basic bandwidth with the new cheap antenna was not enough.
|
||||
<p>During winter 2023/23 Wookey upgraded the operating system on the Acer Aspire One netbook
|
||||
from the ancient Debian Wheezy it had been running to a decently almost-modern Debian distribution. This required much coaxing.
|
||||
<p>In 2023 a new Wifi device (the new Alfa) has restored decent connectivity: this is an external USB wifi which plugs into the netbook.
|
||||
We hope this will improve everything to how it was in 2019.
|
||||
However this new Alfa has proved to be a right bastard to find the right drivers for and
|
||||
Wookey has had to be inventive in using an Ubuntu PPA to make it work with the netbook. Also
|
||||
some ancient configuration of the (dead and unused) internal wifi system on the netbook caused 2 solid days of work early in the 2023 expo.
|
||||
|
||||
|
||||
|
||||
<h4>History of the scripts</h4>
|
||||
<p>The structure of the system was created by Wookey in 2013 who used the fakenet principle and the netbook to run training sessions in caving huts with no internet connection for the Cave Survey Group in the UK. [This is why the script has an extra level of parameter setting that might seem unnecessary: it has 'csg' and 'expo' options, but the two configurations have diverged so much over the years that this is merely a fossil.]
|
||||
<p>The part of the script that logs into the Gasthof wifi was written by Mark Shinwell in 2017 and re-edited by Sam Wenham in 2019. Wookey made it more robust on expo in 2022.
|
||||
|
||||
<hr />
|
||||
Go back to
|
||||
<a href="../l/hut-cables.html">Hut cabling</a><br />
|
||||
|
||||
1
handbook/computing/new-potato-hut-network.svg
Normal file
1
handbook/computing/new-potato-hut-network.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 43 KiB |
Reference in New Issue
Block a user