Netplan lacks an option to add multicast routes

Bug #1833475 reported by Saverio
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Netplan
New
Undecided
Unassigned

Bug Description

Netplan lacks an option to add multicast routes.

Example:

I have a VM with 2 Ethernet nics, one for management and one for multicast streaming:

   ens3 ens7
   mgmt --[ HOST 1 ]--> mcast out

To route multicast out of the ens7 interface, you would add a route to 224.0.0.0/4 tied to the Ethernet device you want to use.

Using the cli, you would to this:

    ip route add 224.0.0.0/4 dev ens7

This is not possible with netplan; it is just missing the option to add multicast routes, i.e. with a device instead of a gateway.

Notes:

After checking the discussion on Bug #1767607, tried this config:

  network:
    version: 2
    renderer: networkd
    ethernets:
      ens3:
        addresses:
            - 10.0.5.40/24
      ens7:
        addresses:
            - 192.168.200.2/30
            - "2001::172.20.1.2/120"
        routes:
            - to: "224.0.0.0" <--- this
              via: "0.0.0.0"
              on-link: True

Other than being rather counter-intuitive, it passes validation but it does not work:

    root@jsec-server2:/home/lab# netplan try
    Warning: Stopping systemd-networkd.service, but it can still be activated by:
    systemd-networkd.socket
    Do you want to keep these settings?

    Press ENTER before the timeout to accept the new configuration

    Changes will revert in 120 seconds
    Configuration accepted.

    root@jsec-server2:/home/lab# ip route show
    10.0.5.0/24 dev ens3 proto kernel scope link src 10.0.5.40
    192.168.200.0/30 dev ens7 proto kernel scope link src 192.168.200.2
    root@jsec-server2:/home/lab#

The multicast route is missing.

Revision history for this message
Franco Albarracin (francofda87) wrote :

Estimated,
You have been able to solve this problem, I am having the same problem and I cannot find that netplan lift with the route.

I await your comments.
Cheers

Revision history for this message
Jimi Lindberg (originalzector) wrote :

I attempted to do this today and seem to have been successful using netplan.io version 0.105-0ubuntu2~22.04.1.
Running the following configuration, outgoing multicast traffic is being sent from ens256 as intended.

network:
  version: 2
  ethernets:
    ens192:
      addresses:
      - 192.168.212.111/23
      routes:
      - to: default
        via: 192.168.213.254
      nameservers:
        addresses:
        - 192.168.130.40
        - 192.168.130.2
        search: []
    ens224:
      addresses:
      - 192.168.216.111/23
      nameservers:
        addresses: []
        search: []
    ens256:
      addresses:
      - 192.168.218.111/23
      routes:
      - to: 224.0.0.0/4
      nameservers:
        addresses: []
        search: []

I hope this helps.

Revision history for this message
Lukas Märdian (slyon) wrote :

This should be fixed as of netplan v0.104 (https://github.com/canonical/netplan/pull/248)

Using something like this (see comment #2):
```
      routes:
      - to: 224.0.0.0/4
```

What version of Netplan are you using? (dpkg -l | grep netplan)

I'm closing this, please re-open if you're still affected.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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