0

I have a setup where I use a 10G bond to work with a remote system, but it intermittently gets disconnected, as traffic will occasionally be routed over another interface. I think I have the problem solved with the following routing for 192.168.0.31:

    Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    1      0        0 nm-bond
0.0.0.0         192.168.1.1     0.0.0.0         UG    90000  0        0 eno2
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eno2
192.168.0.0     0.0.0.0         255.255.254.0   U     1      0        0 nm-bond
192.168.0.0     0.0.0.0         255.255.254.0   U     90000  0        0 eno2
192.168.0.31    0.0.0.0         255.255.255.255 UH    0      0        0 nm-bond

Seems to work so far. Is there a better approach? How do I make this permanent?

I have tried many variations of this netplan file: 01-network-manager-all.yaml

# Let NetworkManager manage all devices on this system
network:
    version: 2
    renderer: NetworkManager
    ethernets:
            nm-bond:
                addresses:
                    - 192.168.0.1/23
                routes:
                    - to: 192.168.0.31
                      via: 0.0.0.0
                      metric: 0

Probably the basic principal of converting the route -n table item to a netplan entry is where my problem is. Still learning...

Actually, my end goal is to have all traffic to/from the internet to use eno2 and intranet to use nm-bond. I have port forwarding on my router to forward https to the IP address assigned to eno3.

1 Answer 1

0

You can create persistent static routes with netplan.
See some examples:
https://netplan.io/examples#using-multiple-addresses-with-multiple-gateways
Also see : https://askubuntu.com/a/992641/77093

For your use case this should look like this:

network:
  version: 2
  renderer: networkd
  ethernets:
    eno2:
     addresses:
       - 192.168.1.x/24
     [ ... ]

    nm-bond:
     addresses:
       -  192.168.0.x/24
     [ ... ]
     routes:
       - to: 192.168.0.31/32
         via: 0.0.0.0
     [ ... ]
4
  • When I used sudo ip route add 192.168.0.31 dev nm-bond, the routing table is updated as expected. But when I add this to the netplan: network: version: 2 renderer: NetworkManager ethernets: nm-bond: addresses: - 192.168.0.x/24 routes: - to: 192.168.0.31/32 via: 0.0.0.0 metric: 0 and restart networking, I don't see the change with route -n
    – Rick
    Apr 20, 2020 at 9:16
  • @Rick : plz edit your question and paste your original netplan config file, i will be able to help more precisely
    – cmak.fr
    Apr 21, 2020 at 4:08
  • I just tried netplan try and got this error message Cannot determine operstate of nm-bond: [Errno 2] No such file or directory: '/sys/class/net/nm-bond/operstate'
    – Rick
    Apr 21, 2020 at 6:40
  • After some searching, I am concerned that using NetworkManager as renderer is why I can get this working. networkd makes sense, but I could not get screen sharing to work as described here
    – Rick
    Apr 21, 2020 at 10:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .