Page MenuHomeVyOS Platform

Wireguard interface as GRE tunnel source causes configuration error on boot
Closed, ResolvedPublicBUG

Description

Having a wireguard interface as the source interface on a GRE tunnel causes a configuration error on boot. The tunnel interface is then left out from the running config, but can be added later by loading the saved config using the load command. This is observed in both 1.3 and rolling versions of 1.4.

My config for the interfaces are:

tunnel tun0 {
    address 10.68.1.17/30
    description "OSPF Encap"
    encapsulation gre
    ip {
        ospf {
            dead-interval 40
            hello-interval 10
            network point-to-point
            priority 1
            retransmit-interval 5
            transmit-delay 1
        }
    }
    mtu 1280
    remote 10.68.0.2
    source-address 10.68.0.9
    source-interface wg0
}
wireguard wg0 {
    address 10.68.0.9/30
    description "WG for OSPF"
    mtu 1420
    peer FR {
        address xx.xx.xx.xx
        allowed-ips 10.68.0.10/32
        allowed-ips 10.68.0.2/32
        persistent-keepalive 25
        port xxxxx
        preshared-key xxx
        pubkey xxxx
    }
    private-key xxx
}

The error outputted in the console:

image.png (208×1 px, 64 KB)

Details

Difficulty level
Unknown (require assessment)
Version
1.3-rolling-202304051608
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Related Objects

Mentioned In
1.3.4

Event Timeline

Wireguard is not yet exists in the system when tun is already exists due to priority

vyos@r14:~$ /opt/vyatta/sbin/priority.pl | match "tun|wireguard"
380 interfaces/tunnel
381 interfaces/wireguard

Try to change priority:

sudo nano -c +3 /opt/vyatta/share/vyatta-cfg/templates/interfaces/wireguard/node.def

replace priority: 381 to priority: 379
And reboot the reouter

That fixes it. It does seem like more of a band-aid solution though. I don't want to have to do that for every router I deploy using this setup

Viacheslav changed the task status from Open to In progress.Jul 1 2023, 6:31 AM
Viacheslav assigned this task to SrividyaA.