4

Trying to setup multicast route to interface in Ubuntu 18.04.2 Netplan's syntax does not allow something like:

routes:
 - to: 224.0.0.0/4
   dev: eno1

this config does not work:

addresses:
 - 192.160.0.1/24
routes:
 - to: 224.0.0.0/4
   via: 192.168.0.1

how to set-up multicast route correctly?

2 Answers 2

2

On Ubuntu 20.04, If you only setup to: you would receive a warning saying:

Error in network definition: unicast route must include both a 'to' and 'via' IP

It seems to assume that the route is a unicast route. However via is not necessary when adding a multicast route.

The correct configuration is:

    ens224:
      addresses:
      - 192.160.0.1/24
      routes:
      - to: 224.0.0.0/4
        scope: link

This will result in the following route to be added:

224.0.0.0/4 dev ens224 proto static scope link

scope: is described at: http://manpages.ubuntu.com/manpages/focal/man5/netplan.5.html and more precisely at: http://manpages.ubuntu.com/manpages/focal/man8/ip-route.8.html

              scope SCOPE_VAL
                     the scope of the destinations covered by the route prefix.  SCOPE_VAL may be
                     a number or a string from the file /etc/iproute2/rt_scopes.  If this
                     parameter is omitted, ip assumes scope global for all gatewayed unicast
                     routes, scope link for direct unicast and broadcast routes and scope host
                     for local routes.
0

The docs are not super clear indeed but we've had some luck with the following:

routes:
  - to: 224.0.0.0/4
    via: 0.0.0.0
1
  • how will system decide in this case from which interface to send traffic?
    – user363600
    Commented Jul 25, 2019 at 5:56

You must log in to answer this question.

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