Score:0

Netplan Multiple NICS/VLANS

cn flag

I'm running Ubuntu Server 20.04 and having issues configuring Netplan for 2 nics on 2 different subnets. I'm getting constant random disconnects.

# This is the network config written by 'subiquity'
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    ens18:
      addresses:
      - 192.168.2.233/24
      dhcp4: no
      nameservers:
        addresses:
        - 1.1.1.1
      routes:
        - to: 192.168.2.0/24
          via: 192.168.2.1
          table: 100
      routing-policy:
        - from: 192.168.2.0/24
          table: 100
    ens19:
      addresses:
      - 192.168.1.233/24
      dhcp4: no
      nameservers:
        addresses:
        - 1.1.1.1
      routes:
        - to: 192.168.1.0/24
          via: 192.168.1.1
          table: 101
      routing-policy:
        - from: 192.168.1.0/24
          table: 101

I can reach the server from each network, but I lose connection intermittently. If I back down to one NIC, things stay connected.

The way the network is configured is that network 192.168.1.0/24 can talk to all subnets, but 192.168.2.0/24 can only talk to that subnet alone. The server should "live" on the .2 network and the .1 network will be assigned to certain docker containers.

Thanks for any assistance in advance!

Score:0
us flag

You mention that only the 192.168.2.0 network is reachable via the one interface, while all networks are reachable via the other interface; but you are using routing tables. Routing tables are usually only needed when you have multiple routes for the same target network which you want to use under different conditions. Also, you are declaring that all traffic to the local network should be set via the router on each network. A typical config would instead be:

network:
  version: 2
  renderer: NetworkManager
  ethernets:
    ens18:
      addresses:
      - 192.168.2.233/24
      nameservers:
        addresses:
        - 1.1.1.1
    ens19:
      addresses:
      - 192.168.1.233/24
      nameservers:
        addresses:
        - 1.1.1.1
      routes:
        - to: 0.0.0.0/0
          via: 192.168.1.1
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.