[FROG] VRRP setup with netplan on Ubuntu 20.04

Oliver O'Boyle oliver.oboyle at gmail.com
Tue Jul 7 20:04:40 UTC 2020


To close the loop:

I ended up going down the /etc/networkd-dispatcher route. I put:

[ -e /etc/network/if-up.d ] && /bin/run-parts /etc/network/if-up.d
exit 0

into a script in that directory, then:

if ip link show vlan2049 | grep -sq 'state UP'; then
    ip link add vlan2049-4 link vlan2049 addrgenmode random type
macvlan mode bridge
    ip link set dev vlan2049-4 address 00:00:5e:00:01:01
    ip addr add 192.168.145.194/26 dev vlan2049-4
    ip link set dev vlan2049-4 up

    ip link add vlan2049-6 link vlan2049 addrgenmode random type
macvlan mode bridge
    ip link set dev vlan2049-6 address 00:00:5e:00:02:01
    ip addr add 2610:139:c001:3f:1801:f20a::5/64 dev vlan2049-6
    ip link set dev vlan2049-6 up
fi
exit 0

into /etc/network/if-ip.d/

I figured this would allow someone not familiar with the workaround to
perhaps more easily figure out what was happening.

It works well enough, but it's ugly AF... I'll probably make it a bit
smarter now, but it works.

Oliver

On Mon, 6 Jul 2020 at 16:31, Oliver O'Boyle <oliver.oboyle at gmail.com> wrote:
>
> Just confirming that I did get this to work. Because I already had a
> tagged vlan on that interface, I needed to keep it. I used the
> existing netplan config to define the vlan, then created the macvlans
> off of that. It looks like this:
>
> 3: ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state
> UP group default qlen 1000
>     link/ether 00:50:56:bd:d5:0f brd ff:ff:ff:ff:ff:ff
>     inet6 fe80::250:56ff:febd:d50f/64 scope link
>        valid_lft forever preferred_lft forever
> 4: vlan2049 at ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc
> noqueue state UP group default qlen 1000
>     link/ether 00:50:56:bd:d5:0f brd ff:ff:ff:ff:ff:ff
>     inet 192.168.145.195/26 brd 192.168.145.255 scope global vlan2049
>        valid_lft forever preferred_lft forever
>     inet6 2610:139:c001:3f:1801:f20a:0:2/64 scope global
>        valid_lft forever preferred_lft forever
>     inet6 fe80::250:56ff:febd:d50f/64 scope link
>        valid_lft forever preferred_lft forever
> 5: vlan2049-4 at vlan2049: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000
> qdisc noqueue state UP group default qlen 1000
>     link/ether 00:00:5e:00:01:01 brd ff:ff:ff:ff:ff:ff
>     inet 192.168.145.194/32 scope global vlan2049-4
>        valid_lft forever preferred_lft forever
>     inet6 fe80::200:5eff:fe00:101/64 scope link
>        valid_lft forever preferred_lft forever
> 6: vlan2049-6 at vlan2049: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000
> qdisc noqueue state UP group default qlen 1000
>     link/ether 00:00:5e:00:02:01 brd ff:ff:ff:ff:ff:ff
>     inet6 2610:139:c001:3f:1801:f20a:0:5/64 scope global
>        valid_lft forever preferred_lft forever
>     inet6 fe80::200:5eff:fe00:201/64 scope link
>        valid_lft forever preferred_lft forever
>
> Not the simplest config around....
>
> I still haven't decided how to persist the macvlans yet, but at least
> there are no conceptual issues with this level of subinterfaces.
>
> O.
>
> On Mon, 6 Jul 2020 at 13:09, Quentin Young <qlyoung at cumulusnetworks.com> wrote:
> >
> > NP. I imagine you could come up with a workaround by getting netplan to run some script with the appropriate "ip link" commands or some such.
> >
> > On Mon, Jul 6, 2020 at 12:48 PM Oliver O'Boyle <oliver.oboyle at gmail.com> wrote:
> >>
> >> Thanks, Quentin. I was hoping someone had a hidden trick. But alas, my
> >> day remains ruined!
> >>
> >> I appreciate the help.
> >>
> >> Oliver
> >>
> >> On Mon, 6 Jul 2020 at 12:41, Quentin Young <qlyoung at cumulusnetworks.com> wrote:
> >> >
> >> > Quick Google looks like there's no support for macvlan in netplan yet:
> >> >
> >> > https://bugs.launchpad.net/netplan/+bug/1664847
> >> >
> >> > The commands for doing it manually with "ip link add" are in the docs, and ifupdown2 has support for them.
> >> >
> >> >
> >> > On Mon, Jul 6, 2020, 12:27 PM Oliver O'Boyle <oliver.oboyle at gmail.com> wrote:
> >> >>
> >> >> Hello,
> >> >>
> >> >> I'm looking to set up VRRP via frr 7.3.1 as per
> >> >> http://docs.frrouting.org/en/latest/vrrp.html
> >> >>
> >> >> I'm using Ubuntu 20.04 which uses Netplan to configure interfaces.
> >> >>
> >> >> Can the macvlan devices be defined in the netplan config file or do I
> >> >> need to run a separate config/set of command to create the devices I
> >> >> need?
> >> >>
> >> >> Any help would be much appreciated.
> >> >>
> >> >> Oliver
> >> >>
> >> >> _______________________________________________
> >> >> frog mailing list
> >> >> frog at lists.frrouting.org
> >> >> https://lists.frrouting.org/listinfo/frog
> >>
> >>
> >>
> >> --
> >> :o@>
>
>
>
> --
> :o@>



-- 
:o@>



More information about the frog mailing list