Page MenuHomeVyOS Platform

Routing protocol and QoS templates are missing in the wireguard CLI
Closed, ResolvedPublic

Description

Because of the way the routing protocol options are added in VyOS (in the interface hierarchy) options to enable OSPF have not been converted over to the Wireguard library. That makes it impossible to add the Wireguard interface to OSPF and set the relevant options for it.

Wireguard (using allowed-ips 0.0.0.0/0) is fully capable of routing ospf and with manual config its possible to get it up and running:
eg: sudo vtysh -c "configure terminal" -c "interface wg1" -c "ip ospf cost 200"

I Would request a simple implementation of the mostly used options for at least ospf to be ported over somehow.
This could be a start of moving ospf config out of the interface subtree and into (where is "belongs") in the protocols/ospf subtree

Details

Difficulty level
Unknown (require assessment)
Version
1.2.0-rc10
Why the issue appeared?
Will be filled on close

Event Timeline

runar created this object in space S1 VyOS Public.
syncer added subscribers: hagbard, syncer.

@hagbard should be quick task (or not)

Implementation doesn't take long, testing it will take a little.

syncer triaged this task as Normal priority.Dec 1 2018, 6:16 PM

@runar How do you set it on other interfaces?

@runar How do you set it on other interfaces?

Sorry @hagbard this was completely forgotten from my part.

configuration for ospf is done inside the "ip ospf" submode on the interface.
(you also have ip rip, using rip as an example)

[edit interfaces ethernet eth3]
vyos@runar-gw# set ip ospf
Possible completions:
 > authentication
                OSPF interface authentication
   bandwidth    Bandwidth of interface (kilobits/sec)
   cost         Interface cost
   dead-interval
                Interval after which neighbor is dead
   hello-interval
                Interval between hello packets
   mtu-ignore   Disable Maximum Transmission Unit (MTU) mismatch detection
   network      Network type
   priority     Router priority
   retransmit-interval
                Interval between retransmitting lost link state advertisements
   transmit-delay
                Link state transmit delay

all of these commands are just configuring FRR directly with the vtysh commands when they change, or when they are deleted
example command: .... ip ospf cost ##

$ cat /opt/vyatta/share/vyatta-cfg/templates/interfaces/ethernet/node.tag/ip/ospf/cost/node.def
type: u32
help: Interface cost
syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "Must be between 1-65535"
val_help: u32:1-65535; OSPF interface cost

update:vtysh -c "configure terminal" \
	-c "interface $VAR(../../../@)" \
	-c "ip ospf cost $VAR(@)"
delete:vtysh -c "configure terminal" \
	-c "interface $VAR(../../../@)" \
	-c "no ip ospf cost"

a note for vyos 1.3: Personally i dont think this is the right placement for this configuration, and it's not the best way to duplicate all this into every interface submode as is done now. instead of duplicating this into the wireguard tree, maybe wireguard could be the first interface submode to have this moved into the protocol ospf submode

The easiest fix for this is to copy the configuration submode defs into the right place after all defs are generated. This will not create extra work for wireguard if we move this submode into the protocol subtree in vyos1.3.
The other solution is to convert all this into the new python config framework for wireguard, but this will be wasted time if things change in 1.3

Oh I see, so it would be then in /opt/vyatta/share/vyatta-cfg/templates/interfaces/wireguard/node.tag/ip/ospf/cost/node.def.
What do you mean with moving it into the protocol subtree?
I also would then handle it within the wireguard code, like I did for the firewall stuff.
(https://github.com/vyos/vyos-1x/commit/51f61991092a163f680e4ec8f122e73f4074ddf9)
Let me know what you think, would be just an extra node and leavenode to handle.

I can change it my repo if you want to test, maybe it's a good time to determine what way would be the best.

If the long term goal is to have it in protocols, I can write an extra script just handling the dynamic routing protocols, which would then later easier to remove.

After playing around with it, I think I create an extra script just for that task, it'll be easier to maintain until that parts are moved out to 'set protocol'.

hagbard changed the task status from Open to In progress.Dec 13 2018, 6:26 PM

@runar I should have something ready tomorrow or at the weekend at the latest you could test for IPv4. I basically started implementing the 'set interfaces <intf> ip' options including the kernel vars which you can set on other interfaces since wireguard is using that interface and looks like a normal network interface to the kernel.

dmbaturin renamed this task from Wireguard: Unable to add wireguard interface to a routing protocol (eg. ospf) to Routing protocol and QoS templates are missing in the wireguard CLI.Dec 16 2018, 2:58 PM
dmbaturin changed Version from 1.2.0-rc* to 1.2.0-rc10.
dmbaturin added a subscriber: dmbaturin.

@hagbard I've added it to all interface templates generators now, including that for QoS.