This is an old revision of the document!
Today we are going to convert our raspberry pi into an effective router to create a new local subnet where we can safely host our servers and their services.
The device we are going to use is a Raspberry Pi 3b model with latest Raspbian installed, but any device with *nix, an ethernet adapter and 1 free usb slot (either 2.0, 3.0, usb c, micro usb) with usb-to-ethernet support compiled, should work (most systems have this compiled by default, so it should not be a problem).
a small device (in this case a Pi), a usb-to-ethernet cable (to create a new physical address), a switch (in case you want to extend your connections), ethernet cables (with different sizes, depends on your setup)
a usb hub just in case your device only has 1 usb slot.
I highly recommend you do this operations on a physical screen connected to your device, and a usb keyboard. Some operations over SSH could make you lose access.
I really recommend you to remove network-manager, netplan, or any networking auto-configuration software, as our server will be configured statically in a way that is supported by most *nix systems.
Start by installing `isc-dhcp-server` package, which is a dhcp server so we can automatically assign ips to our local sub-network on eth1.
apt-get install isc-dhcp-server
Modify /etc/default/isc-dhcp-server to tell isc-dhcp-server to use your eth1 interface. You can uncomment the ipv6 line if you need ipv6 on your local network (which usually is not required).
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server) # Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf). #DHCPDv4_CONF=/etc/dhcp/dhcpd.conf #DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf # Path to dhcpd's PID file (default: /var/run/dhcpd.pid). #DHCPDv4_PID=/var/run/dhcpd.pid #DHCPDv6_PID=/var/run/dhcpd6.pid # Additional options to start dhcpd with. # Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead #OPTIONS="" # On what interfaces should the DHCP server (dhcpd) serve DHCP requests? # Separate multiple interfaces with spaces, e.g. "eth0 eth1". INTERFACESv4="eth1" #INTERFACESv6="eth1"