Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static: T5398: do not mangle interface names in FRR #2110

Merged
merged 1 commit into from Jul 25, 2023

Conversation

jvoss
Copy link
Contributor

@jvoss jvoss commented Jul 25, 2023

Change Summary

This PR resolves an issue when configuring static routes involving interfaces containing a - in the name. When rendered to FRR, the interface is mangled to an underscore _. This is most noticeable when creating static VRF-leaked routes for container networks:

pod-TEST becomes pod_TEST

# VyOS
container {
  name TEST {
     image ubuntu:20.04
     network TEST {
     }
  }
  network TEST {
     prefix 192.168.1.0/24
  }
}
vrf {
  name TEST {
    protocols {
        static {
             route 192.168.1.0/24 {
                 interface pod-TEST {
                     vrf default
                 }
             }
         }
    }
  }

}
# FRR rendered configuration
!
vrf TEST
 ip route 192.168.1.0/24 pod_TEST nexthop-vrf default
exit-vrf
!

No static route is installed into the table due to the mismatching interface name:

jvoss@test-R1:~$ show ip route vrf TEST static
jvoss@test-R1:~$ 

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Component(s) name

  • protocols static

Proposed changes

Update the static configuration retrieval in protocols_static.py to not mangle node values by adding the no_tag_node_value_mangle=True option.

How to test

Perform the configuration changes as documented in the change summary. However after this change is applied and vyos-configd is restarted the interface name is no longer mangled:

# FRR rendered configuration
!
vrf TEST
 ip route 192.168.1.0/24 pod-TEST nexthop-vrf default
exit-vrf
!

The route is also installed into the routing table:

jvoss@test-R1:~$ show ip route vrf TEST static
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF TEST:
S>* 192.168.1.0/24 [1/0] is directly connected, pod-TEST (vrf default), weight 1, 00:00:45

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team July 25, 2023 20:59
@c-po c-po merged commit 688755a into vyos:current Jul 25, 2023
6 of 7 checks passed
@jvoss jvoss deleted the frr_static_interface_mangle branch July 27, 2023 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants