Rules without to-net field miss table parameter in ip cli

Bug #1864801 reported by José Pekkarinen
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charm-advanced-routing
Fix Released
High
Alvaro Uria

Bug Description

Hi,

I tested this charm to pursue the effects of former policy routing charm,
where we used to set a couple of rules like the following:

from $my_net to $my_net lookup main priority 100
from $my_net lookup $my_net_table priority 101

Where $my_net_table contains a single route, a default via
for anything coming from a different net to be answered on
it.

The rules that goes to $my_net_table will be populated
like:

ip rule add from $my_net lookup $my_net_table priority 101

and the rule won't be visible in the ip rule s output. Executing
the command by hand will tell that table parameter is missing,
so executing he following will set the rule:

ip rule add from $my_net lookup table $my_net_table priority 101

Thanks!

Jose.

Related branches

Revision history for this message
Alvaro Uria (aluria) wrote :

In bug 1864800, it is also reported that the "main" (default) table is not allowed. That's true and will be also taken into account.

Changed in charm-advanced-routing:
assignee: nobody → Alvaro Uria (aluria)
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Alvaro Uria (aluria) wrote :

In the description of this bug, it is mentioned that the keyword "table" is needed or the "ip rule add" command output will tell that it is missing. However, this is what I see in Bionic:
"""
~# ip -4 -o a s | awk '/eth0/ {print $4}'
10.205.6.204/24
~# ip rule add from 10.205.6.0/24 lookup table test priority 101
Error: argument "table" is wrong: invalid table ID
~# ip rule add from 10.205.6.0/24 lookup test priority 101
~#
"""

If the issue mentioned in the bug description was tested in Xenial, iproute2 version is 4.3 and does not support /etc/iproute2/rt_tables.d/*.conf (the custom table needs to be added in the default configuration file, /etc/iproute2/rt_tables).

Revision history for this message
Alvaro Uria (aluria) wrote :

In addition to comment #2, "lookup" and "table" are aliases, so one or the other needs to be used.

Revision history for this message
Alvaro Uria (aluria) wrote :

Per bug description, the config for the change should be:
"""
advanced-routing:
  enable-advanced-routing: true
  advanced-routing-config: |
      [ {
          "type": "table",
          "table": "mytable"
      }, {
          "type": "route",
          "default_route": true,
          "gateway": "X.X.X.X",
          "table": "mytable"
      }, {
          "type": "rule",
          "from-net": "Y.Y.Y.Y/NN",
          "to-net": "Z.Z.Z.Z/NN",
          "priority": 100
      }, {
          "type": "rule",
          "from-net": "Y.Y.Y.Y/NN",
          "table": "mytable",
          "priority": 101
      } ]
"""

Alvaro Uria (aluria)
Changed in charm-advanced-routing:
status: Confirmed → In Progress
Revision history for this message
Alvaro Uria (aluria) wrote :

Xenial support has been removed. It is expected that charm-policy-routing will be used for Xenial environments. From Bionic onwards, charm-advanced-routing should be used.

Changed in charm-advanced-routing:
status: In Progress → Fix Committed
milestone: none → 20.02
Alvaro Uria (aluria)
Changed in charm-advanced-routing:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.