I assume you have already figured out how many network connections you need on your home server, and which IP address to assign to them.
You will need at least two network connections on your home server. I mean at least two physical network Ethernet card. You could use one WiFi link, but i strongly advise against such choice for stability and bandwith reasons.
Depending on your setup, you might have more than two NICs (Nework Interface Cards) and they might be PCI/Express or USB-3/C.
For more information on your network setup, refer to this page and this page.
This setup is provided according to the simple approach.
I will assume you have the following network assets:
Without commenting on the weird naming of the ethernet devices, let's see the IP assignments (you can list all your network devices under /sys/class/net):
This setup is provided according to the advanced approach.
I will assume you have the following network assets:
Without commenting on the weird naming of the ethernet devices, let's see the IP assignments (you can list all your network devices under /sys/class/net):
Since i am going all static on the home server, network setup is simple and traightforward. I will be using the basic Netifrc scripts from Gentoo, you should check this page for additional details. You will not need NetworkManager for the home server.
If you plan to use WiFi with WPA or more complex setups (PPP or such) please refer to the Gentoo Handbook.
You should double check the actual names of your network devices under /sys/class/net of course and identify them properly or the following will not work for you.
The choice to go fully static instead of using DHCP to get IP addresses on the ISPs side of network is to enable SNAT instead of MASQUERADING later on.
The first step is to populate your /etc/conf.d/net configuration file, follow this example and adapt to your needs:
# LAN on eno1 config_eno1="10.20.30.1/24" routes_eno1="default via 10.20.30.254" # default route here only for advanced approach! # The following ONLY for advanced approach! # DMZ on eno1 config_enp2s0="10.20.254.1/24" routes_enp2s0="" # The following ONLY for simple approach! # Main ISP on eno1 #config_enp2s0="192.168.1.10/24" #routes_enp2s0="default via 192.168.1.1" # Failback ISP on enp0s20f0u9u4c2 config_enp0s20f0u9u4c2="192.168.1.10/24"
Now, create the needed symlinks and start the networks:
for i in eno1 enp2s0 enp0s20f0u9u4c2 do ln -s /etc/init.d/net.lo /etc/init.d/net.$i rc-upate add net.$i default done
Now you need to tell Gentoo that only one of these needs to be up for networking to be ready. If you don't do this, then all your services will fail as soon as one goes down. Edit the file /etc/rc.conf and change the following line to “NO”:
rc_depend_strict="NO"
Reboot your home server and ensure all networks are up and running by pinging the ISP gateways and some internal network host.