2

I'm migrating old ubuntu install to 18 version, but it seems to have some static routing issues when using different networks.

First, I tried using NetPlan. I configured TWO NICS with different networks on each one, but, I dont know if this is a kernel issue (maybe missing some module) or if its a ubuntu 18 problem (doubt that).

The sympton is that only default route is working. I can add multiple NICs with different networks and static routes and gateways, but only the default route will work.

Here is my NetPlan config file:

network:
    version: 2
    renderer: networkd
    ethernets:
        ens32:
            addresses:
                - 177.185.x.66/29
                - 177.185.x.67/29
                - 177.185.x.68/29
                - 177.185.x.69/29
                - 177.185.x.70/29
            gateway4: 177.185.x.65
            nameservers:
                addresses:
                - 8.8.8.8
                search:
                - mydomain.net
            routes:
                    - to: 0.0.0.0/0
                      via: 177.185.x.65
            optional: true
        ens34:
            addresses:
                - 168.96.x.2/24
            routes:
                    - to: 168.96.x.0/24
                      via: 168.96.x.1

The NetPlan works almost fine: no issue when applying new config. Routing table looks normal:

default via 177.185.x.65 dev ens32 proto static 
168.96.x.0/24 via 168.96.x.1 dev ens34 
168.96.x.0/24 dev ens34 proto kernel scope link src 168.96.x.10 
177.185.x.64/29 dev ens32 proto kernel scope link src 177.185.x.66

But I can only ping the 177.185.x.64/29 network. The other one doesn't respond.

When I change the default route to the secondary network (168.96.x.0/24), the other one stops responding.

I first thought that it might be related to IP routing kernel modules, but I couldn't find the same options from older kernels on the 4.15 one.

Any help would be much appreciated.

Thanks in advance.

BR, Rafael

1 Answers1

0

First, ifupdown package is deprecated and won't work anymore. So you would better avoid that.

Second, apparently you didn't understand what I wrote you before on my thread: the us of routing table.

As mentioned here, any given OS has only one possible gateway. same for router or any other devices. If you want multiple gateways, you need then a duplicate system because the metadata of any given network packages transmitted on the network can't mention multiple gateways. That's why we need different routing tables. And I don't see anywhere on your file a line with the creation of another routing table. That's why you don't have any acknowledgements of arriving packets on the second interface... simple as that. The packages are arriving, they are just not be acknowledged because they can't be.

If you look at my solution which I linked earlier, you clearly see the tables and so the system know what to create and how to create it. Simple as that. And I frankly don't see why you are resisting about it....

  routes:
   - to: 0.0.0.0/0
     via: 192.168.3.1
     metric: 100
     table: 101

That's a creation of a routing policy + the specific table attached to it.

  routing-policy:
   - from: 192.168.3.0/24
     table: 101

that's the creation of the rule who specifies the need to register all incoming packets and sending packets in that table.

Plus I would strongly advise you, to do a vector/table of your static addresses in place of a list. So more something like that [.../..,.../..,.../..]. Again, like in my example.

vigilian
  • 854