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:
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