0

My apologies if this is dumb or redundant, but I have not found an accurate or complete answer to this question.

I have a fully current 18.04 server with multiple NICs across different networks. I have DHCP reservations set up for each adapter on its respective network, so I don't need or particularly want to configure static IPs / gateways for each adapter, but I do need for each adapter to respond to traffic through the correct gateway because (for instance) I do have traffic coming to a specific adapter on that server across an openVPN connection (so coming from a different subnet that is not duplicated anywhere else in the system). As I have things configured now, each adapter responds correctly within it's own subnet, so I know I have connectivity, but I need something more.

The problem is that all traffic from the server goes out through one gateway, so return traffic does not come back from the IP it is expected from (so is ignored). I've tried to use the information in the NetPlan man pages, but cannot find a clear answer for my configuration needs. My working 01-network-manager-all.yaml looks like this:

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: yes
      dhcp-identifier: mac
      dhcp4-overrides:
        route-metric: 100
    eno2:
      dhcp4: yes
      dhcp-identifier: mac
      dhcp4-overrides:
        route-metric: 100
    enp3s0f0:
      dhcp4: yes
      dhcp-identifier: mac
      dhcp4-overrides:
        route-metric: 100
    enp3s0f1:
      dhcp4: yes
      dhcp-identifier: mac
      dhcp4-overrides:
        route-metric: 10

This obviously pushes all non-adapter-local traffic out through the enp3s0f1 adapter, which isn't what I want. If I change the route-metric on that adapter to 100, I don't reliably get traffic out through any adapter. What I need are concrete examples of multiple adapters on DHCP with distinct subnets / routes, where traffic to each adapter goes out through its respective gateway. Can anyone help?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.