Configuring a gateway

david david at daku.org
Wed Sep 16 22:11:47 UTC 2020


Folks

I'm using Ubuntu 20.04 server.  I'm trying to set up a gateway (a 
router) that will sit between my internal home computers and the 
internet.  The machine has two ethernet controllers.  One is 
connected to the internet and uses IPV4 only with dhcp.  It operates correctly.

The second controller is a lightning-connected NIC with nothing 
attached, and has a static address (192.168.100.1), and eventually 
when I connect it to a switch and then connect the internal machines 
to that switch, will use dhcp to award addresses in the 
192.168.100.(100-250) range, and will use Masquerading.  I have 
previously done this on a Redhat-style system, so it should work.

However, I haven't figured out how to define the second internal 
adaptor.  I have tried editing the netplan configuration:

/etc/netplan/00-installer-config.yaml
-----------------------------------
  # This is the network config written by 'subiquity'
  network:
    ethernets:
      enp2s0f0:
        dhcp4: true
      ens9:
        addresses: [192.168.100.1/24]
        dhcp4: no
        dhcp6: no
        gateway4: 192.168.100.1
    version: 2
-----------------------------------

I manually added the lines from ens9 up to but not including the version line.

After reboot, "ip a" shows the ens9 interface but with no ip 
addresses.  "ip route" does not mention ens9.  Furthermore, the boot 
hangs over 2 minutes waiting for the network.  Before I added the 
ens9 definition, that 2 minute hang did not occur.

What am I doing wrong?

David










More information about the ubuntu-users mailing list