aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2019-11-03 18:31:46 +0100
committerJonas Smedegaard <dr@jones.dk>2019-11-03 18:31:46 +0100
commit1f8d27f56428311323680b337a38dd7d1e19bb34 (patch)
treec19f9bd4d172e8bac3f7c9e80beec77a23441221
initial text
-rw-r--r--README.md27
-rw-r--r--SETUP.md127
2 files changed, 154 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..f3b2a88
--- /dev/null
+++ b/README.md
@@ -0,0 +1,27 @@
+# Gateway system features _(system-gateway)_
+
+> Handling general features of the gateway operating system
+
+
+## Contributing
+
+Help improving this documentation is much appreciated!
+
+You can simply [tell us][] in plain words what you suggest changed,
+or publish a set of proposed changes as a fork of this source git,
+and [tell us][] where we can get your fork.
+
+[tell us]: <mailto:partners@couchdesign.dk>
+ "Couchdesign a.k.a. Jonas Smedegaard and Siri Reiter"
+
+
+## License
+
+Copyright © 2019 Jonas Smedegaard <dr@jones.dk>
+
+This work is licensed
+under a Creative Commons Attribution-ShareAlike 4.0 International License
+([CC-BY-SA-4.0][]).
+
+[CC-BY-SA-4.0]: <https://creativecommons.org/licenses/by-sa/4.0/>
+ "Creative Commons Attribution-ShareAlike 4.0 International license"
diff --git a/SETUP.md b/SETUP.md
new file mode 100644
index 0000000..19ab44b
--- /dev/null
+++ b/SETUP.md
@@ -0,0 +1,127 @@
+# Installation of gateway system
+
+> Install Debian image for use as gateway for private network
+
+Download a suitable system image
+and load it onto the target computer box.
+
+Start the box,
+log in and finalize system-setup,
+include some addons,
+and enjoy your pure Debian gateway system.
+
+
+## Preparations
+
+### Hardware
+
+System requires a computer in a box box and with power supply,
+an additional network adapter,
+and a microSD chip:
+
+ * Box - [OLinuXino A20 LIME2][] or [OLinuXino A20 LIME][]
+ * USB network adapter - preferably 1 Gbit/s USB3
+ * MicroSD card - preferably speed rated "A1" or "A2", size 2GB is enough
+
+[OLinuXino A20 LIME2]: <https://www.olimex.com/wiki/A20-OLinuXino-LIME2>
+ "Olimex OLinuXino A20 LIME2"
+
+[OLinuXino A20 LIME]: <https://www.olimex.com/wiki/A20-OLinuXino-LIME>
+ "Olimex OLinuXino A20 LIME"
+
+
+## Get and install image
+
+Follow the guide at <https://box.redpill.dk/>.
+
+Finalize setup of the system:
+
+ sudo system-setup
+
+
+### Turn system into a network gateway
+
+Enable addon:
+
+ sudo box-add-gateway
+
+System is now configured like this:
+ * Built-in network adapter requests address via DHCP, and expects an internet connection
+ * Each USB adapter has a static private address, and serves DHCP to a private network
+
+If above is what you want
+then you are done!
+
+
+### Static public IP
+
+To use a fixed IP address for the built-in public-facing interface,
+first copy the file `/etc/systemd/network/90-dhcp.network`
+to `/etc/systemd/network/10-eth0.network`,
+then adapt the copy as needed,
+and finally restart network service.
+
+Example:
+
+ cp /etc/systemd/network/90-dhcp.network /etc/systemd/network/10-eth0.network
+ nano /etc/systemd/network/10-eth0.network
+ # Under [Match] change "Name":
+ # Name=eth0
+ #
+ # Under [Network] replace "DHCP" with "Address", "Gateway" and "DNS"
+ #
+ # Quit nano with CTRL+x and agree to save changes under proposed name
+ service systemd-networkd restart
+
+
+### Multiple internet connections
+
+When you have more than one internet connection,
+first identify the system device name of the interface,
+then copy the file `/etc/systemd/network/90-dhcp.network`
+to `/etc/systemd/network/10-XXX.network` (replace XXX with device name),
+then adapt the copy as needed (as minimum set Name to match device name),
+and finally restart network service.
+
+Example:
+
+ networkctl
+ # notice device name
+ cp /etc/systemd/network/90-dhcp.network /etc/systemd/network/10-enx00e04c688416.network
+ nano /etc/systemd/network/10-enx00e04c688416.network
+ # Under [Match] change "Name":
+ # Name=enx00e04c688416
+ #
+ # Under [Network] replace "DHCP" with "Address", "Gateway" and "DNS"
+ #
+ # Quit nano with CTRL+x and agree to save changes under proposed name
+ service systemd-networkd restart
+
+
+### Custom private network
+
+If you want a custom configuration for a private network,
+e.g. a specific static address or specific DHCP pool setup,
+first identify the system device name of the interface,
+then copy file `/etc/systemd/network/80-masq-dhcpserver.network`
+to `/etc/systemd/network/10-XXX.network` (replace XXX with device name),
+then adapt the copy as needed (as minimum set Name to match device name),
+and finally restart network service.
+
+Example:
+
+ networkctl
+ # notice device name
+ cp /etc/systemd/network/80-masq-dhcpserver.network /etc/systemd/network/10-enx00095be2dfe2.network
+ nano /etc/systemd/network/10-enx00095be2dfe2.network
+ # Under [Match] change "Name":
+ # Name=enx00095be2dfe2
+ #
+ # Under [Network] change "Address":
+ # Address=192.168.2.1/24
+ #
+ # Under section [DHCPServer] change "PoolSize":
+ # PoolSize=200
+ #
+ # Quit nano with CTRL+x and agree to save changes under proposed name
+ service systemd-networkd restart