ipspace / netlab

Making virtual networking labs suck less
https://netlab.tools
Other
447 stars 66 forks source link

Use vtysh for configuring IP addresses on Cumulus #1345

Closed jbemmel closed 1 month ago

jbemmel commented 1 month ago

On FRR IP addresses are configured through vtysh. Cumulus uses FRR internally, but its IP configuration is done through configuration files under /etc/network/interfaces.d

The issue with this, is that the output of show run may only show a partial configuration. For example, if I set both a physical IP address and a VRRP gateway IP, only the latter is shown:

show run
...
interface vlan123
  vrrp 1
  vrrp 1 ip 10.0.0.1

while it also has 10.0.0.2 as an IP address on the same interface

Both are active, so technically this is not a "bug" - but it's very impractical. I am trying to generate the configuration to be applied to a physical device

Perhaps Cumulus could simply reuse the FRR templates, or at least import the basic routines for things like configuring IPs

ipspace commented 1 month ago

The problem is the interaction between vtysh and ifupdown. If the IP address is not defined in the /etc/network/interface.d/something, the next ifreload -a removes it. You can set the same IP address with ifupdown and vtysh to see it in "show running", but then weird things happen when you try to change it.

Anyway, Cumulus Linux documentation recommends using ifupdown to set IP addresses on interfaces, so if you want to apply the configuration to a physical Cumulus Linux switch, you'd be better off following those guidelines anyway:

https://docs.nvidia.com/networking-ethernet-software/cumulus-linux-42/Layer-1-and-Switch-Ports/Interface-Configuration-and-Management/#configure-ip-addresses

FWIW, the netlab collect command also collects the ifupdown2 configuration.