1

Trying to configure an Ubuntu 18.04 machine with two IP addresses on different subnets on one ethernet port, each with a gateway so port forwarding works from different routers.

This was based on the Netplan documentation. The two IPs work, but no inbound or outbound internet access.

network:
  version: 2
  renderer: networkd
  ethernets:
    enp6s0:
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      addresses:
        - 192.168.13.200/24
        - 192.168.1.100/24
      routes:
        - to: 0.0.0.0/0
          via: 192.168.13.1
          metric: 200
        - to: 0.0.0.0/0
          via: 192.168.1.1
          metric: 300
    enp8s0:
      addresses: [192.168.2.100/24]
      dhcp4: false
      dhcp6: false

This next attempt was based on another answer, but when I try this I get an error: "ERROR: enp6s0: NetworkManager does not support non-default routing tables"

network:
  version: 2
  renderer: networkd
  ethernets:
    enp8s0:
      addresses: [192.168.2.100/24]
      dhcp4: false
      dhcp6: false
    enp6s0:
      dhcp4: no
      dhcp6: no
      addresses: 
        - 192.168.1.100/24
        - 192.168.13.200/24
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      routes:
        - to: 0.0.0.0/0
          via: 192.168.1.1
          metric: 150
        - to: 0.0.0.0/0
          via: 192.168.13.1
          metric: 150
          table: 102
      routing-policy:
        - from: 192.168.13.0/24
          table: 102
        - to: 192.168.13.0/24
          table: 102
    enp7s0:
      dhcp4: yes
Oscar M
  • 11
  • 2
  • 1
    Please clarify your release; you mention two different products. Ubuntu releases using the *year* format (eg. Ubuntu Core 18 Server) are different to those using the *year.month* format (eg. Ubuntu 18.04 LTS Server). Which are you using? the 18 you mention in your question, or the 18.04 you tagged? 18 != 18.04 – guiverc Feb 08 '22 at 00:10
  • Both of these netplan configurations should work to give you Internet access, with some differences in behavior. How have you established that the two IPs "work"? Are you able to ping the router IPs? Also, in your second example you show an error message about NetworkManager but nothing in the configuration you're pasting uses the NetworkManager backend. Are there other files under /etc/netplan not shown in your question? – slangasek Feb 08 '22 at 23:45

0 Answers0