Page MenuHomeVyOS Platform

BGP unnumbered - UnboundLocalError: local variable 'peer_group' referenced before assignment
Closed, ResolvedPublicBUG

Description

With VyOS 1.4-rolling-202102141111, I'm not able to create an unnumbered BGP peer (with interface name). The BGP peer configuration I use works with 1.3-rolling-202012291104.

Error:

VyOS had an issue completing a command.

Report Time:      2021-02-17 16:45:54
Image Version:    VyOS 1.4-rolling-202102141111
Release Train:    sagitta

Built by:         [email protected]
Built on:         Sun 14 Feb 2021 11:11 UTC
Build UUID:       dee0e5fa-d82c-4b73-8a5c-936df99094d6
Build Commit ID:  aec60effa4e36e

Architecture:     x86_64
Boot via:         installed image
System type:      KVM guest

Hardware vendor:  QEMU
Hardware model:   Standard PC (i440FX + PIIX, 1996)
Hardware S/N:     
Hardware UUID:    2bbf5b6c-9169-458e-ba86-0e2a46e8c52f

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/protocols_bgp.py", line 180, in <module>
    verify(c)
  File "/usr/libexec/vyos/conf_mode/protocols_bgp.py", line 130, in verify
    peer_group_as = dict_search(f'peer_group.{peer_group}.remote_as', asn_config)
UnboundLocalError: local variable 'peer_group' referenced before assignment

Even if I use a peer-group, I get the above error.

Used configuration (public IP addresses censcored):

  interfaces {
     ethernet eth0 {
         address fd00::35/48
         address 10.1.1.2/24
         policy {
             route OOB
         }
     }
     loopback lo {
         address 10.3.1.1/32
         address fd01::1/128
     }
     vxlan vxlan129 {
         address 10.3.1.1/32
         port 4789
         remote 10.2.1.1
         source-address 10.1.1.2
         vni 129
     }
 }
 policy {
     as-path-list 58057 {
         rule 1 {
             action permit
             regex _58057_
         }
     }
     as-path-list INVALID-ASNS {
         rule 1 {
             action permit
             regex ".* 0"
         }
         rule 2 {
             action permit
             regex 23456
         }
         rule 3 {
             action permit
             regex 64512..65534
         }
         rule 4 {
             action permit
             regex 65535
         }
         rule 5 {
             action permit
             regex 64512..65534
         }
         rule 6 {
             action permit
             regex 65552..131071
         }
         rule 7 {
             action permit
             regex 4200000000..4294967294
         }
         rule 8 {
             action permit
             regex ".* 4294967295"
         }
     }
     prefix-list BOGONS {
         rule 1 {
             action permit
             prefix 0.0.0.0/0
         }
         rule 2 {
             action permit
             prefix 0.0.0.0/8
         }
         rule 3 {
             action permit
             prefix 0.0.0.0/32
         }
         rule 4 {
             action permit
             le 32
             prefix 10.0.0.0/8
         }
         rule 5 {
             action permit
             le 32
             prefix 100.64.0.0/10
         }
         rule 6 {
             action permit
             le 32
             prefix 127.0.0.0/8
         }
         rule 7 {
             action permit
             le 32
             prefix 169.254.0.0/16
         }
         rule 8 {
             action permit
             le 32
             prefix 192.0.2.0/24
         }
         rule 9 {
             action permit
             le 32
             prefix 192.88.99.0/24
         }
         rule 10 {
             action permit
             le 32
             prefix 192.168.0.0/16
         }
         rule 11 {
             action permit
             le 32
             prefix 198.18.0.0/15
         }
         rule 12 {
             action permit
             le 32
             prefix 198.51.100.0/24
         }
         rule 13 {
             action permit
             le 32
             prefix 203.0.113.0/24
         }
         rule 14 {
             action permit
             le 32
             prefix 224.0.0.0/3
         }
     }
     prefix-list all {
         rule 1 {
             action permit
             le 32
             prefix 0.0.0.0/0
         }
     }
     prefix-list auto-AS-TOMSIEWERT {
         rule 1 {
             action permit
             prefix 45.86.126.0/24
         }
         rule 65535 {
             action deny
             le 32
             prefix 0.0.0.0/0
         }
     }
     prefix-list6 all {
         rule 1 {
             action permit
             le 128
             prefix ::/0
         }
     }
     prefix-list6 auto-AS-TOMSIEWERT {
         rule 1 {
             action permit
             prefix 2a0c:9a40:8040::/43
         }
         rule 2 {
             action permit
             prefix 2a0e:46c3:800::/40
         }
         rule 65535 {
             action deny
             le 128
             prefix ::/0
         }
     }
     route OOB {
         rule 10 {
             set {
                 table 100
             }
             source {
                 address 10.1.1.2
             }
         }
     }
     route-map ROUTES-IN {
         rule 4 {
             action deny
             match {
                 as-path 58057
             }
         }
         rule 10 {
             action permit
             match {
                 rpki valid
             }
             set {
                 local-preference 110
             }
         }
         rule 20 {
             action permit
             match {
                 rpki notfound
             }
             set {
                 local-preference 100
             }
         }
         rule 30 {
             action deny
             match {
                 rpki invalid
             }
         }
         rule 40 {
             action deny
             match {
                 ip {
                     address {
                         prefix-list BOGONS
                     }
                 }
             }
         }
         rule 50 {
             action deny
             match {
                 as-path INVALID-ASNS
             }
         }
     }
     route-map ROUTES-IN-PEER {
         rule 4 {
             action deny
             match {
                 as-path 58057
             }
         }
         rule 10 {
             action permit
             match {
                 rpki valid
             }
             set {
                 local-preference 140
             }
         }
         rule 20 {
             action permit
             match {
                 rpki notfound
             }
             set {
                 local-preference 130
             }
         }
         rule 30 {
             action deny
             match {
                 rpki invalid
             }
         }
         rule 40 {
             action deny
             match {
                 ip {
                     address {
                         prefix-list BOGONS
                     }
                 }
             }
         }
         rule 50 {
             action deny
             match {
                 as-path INVALID-ASNS
             }
         }
     }
     route-map all {
         rule 1 {
             action permit
         }
     }
     route-map none {
         rule 1 {
             action deny
         }
     }
 }
 protocols {
     bgp 213392 {
         address-family {
             ipv4-unicast {
                 aggregate-address 45.86.126.0/24 {
                 }
                 redistribute {
                     connected {
                     }
                 }
             }
             ipv6-unicast {
                 aggregate-address 2a0c:9a40:8040::/43 {
                 }
                 aggregate-address 2a0e:46c3:800::/40 {
                 }
                 redistribute {
                     connected {
                     }
                 }
             }
         }
+        neighbor vxlan129 {
+            address-family {
+                ipv4-unicast {
+                    nexthop-self {
+                        force
+                    }
+                    route-map {
+                        export all
+                        import all
+                    }
+                    route-reflector-client
+                    soft-reconfiguration {
+                        inbound
+                    }
+                }
+                ipv6-unicast {
+                    nexthop-self {
+                        force
+                    }
+                    route-map {
+                        export all
+                        import all
+                    }
+                    route-reflector-client
+                    soft-reconfiguration {
+                        inbound
+                    }
+                }
+            }
+            capability {
+                extended-nexthop
+            }
+            interface {
+                remote-as 213392
+                v6only {
+                }
+            }
+        }
         parameters {
+            default {
+                no-ipv4-unicast
+            }
             router-id 10.3.1.1
         }
     }
     ospf {
         area 0 {
             network 10.3.1.1/32
         }
         interface vxlan129 {
             network point-to-point
         }
         log-adjacency-changes {
         }
         mpls-te {
             enable
             router-address 10.3.1.1
         }
         parameters {
             abr-type cisco
             router-id 10.3.1.1
         }
         redistribute {
             connected {
                 metric-type 2
             }
         }
     }
     ospfv3 {
         area 0 {
             interface lo {
             }
             interface vxlan129 {
                 network point-to-point
             }
         }
         parameters {
             router-id 10.3.1.1
         }
         redistribute {
             connected {
             }
         }
     }
     rpki {
         cache 10.4.5.6 {
             port 8282
             preference 1
         }
     }
     static {
         table 100 {
             route 0.0.0.0/0 {
                 next-hop 10.1.1.1 {
                 }
             }
         }
     }
 }
 service {
     ssh {
         port 222
     }
 }
 system {
     config-management {
         commit-revisions 100
     }
     console {
         device ttyS0 {
             speed 115200
         }
     }
     flow-accounting {
         disable-imt
         interface vxlan129
         sflow {
             agent-address 10.3.1.1
             sampling-rate 100
             server 10.123.1.1 {
             }
         }
         syslog-facility syslog
     }
     host-name thisisarouter
     name-server 8.8.8.8
     name-server 8.8.4.4
     ntp {
         server 0.pool.ntp.org {
         }
         server 1.pool.ntp.org {
         }
         server 2.pool.ntp.org {
         }
     }
     option {
         ctrl-alt-delete ignore
         reboot-on-panic
     }
     sysctl {
         custom net.ipv4.conf.all.log_martians {
             value 0
         }
         custom net.ipv4.route.max_size {
             value 2097152
         }
         custom net.ipv6.route.max_size {
             value 262144
         }
     }
     syslog {
         global {
             facility all {
                 level info
             }
             facility protocols {
                 level debug
             }
         }
     }
 }

Details

Difficulty level
Unknown (require assessment)
Version
1.4-rolling-202102141111
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

I just tried to set up a new router using /31 transfer networks and this also fails with the same error (no BGP unnumbered).

Shortened configuration:

 interfaces {
     ethernet eth0 {
         address 10.240.4.1/32
     }
     vxlan vxlan122 {
         address 10.1.1.1/31
         port 4789
         remote 10.240.1.1
         source-address 10.240.4.1
         vni 122
     }
     loopback lo {
         address 10.0.0.1/32
     }
 }
 protocols {
     bgp 64501 {
         address-family {
             ipv4-unicast {
                 aggregate-address 10.1.1.0/24 {
                 }
                 redistribute {
                     connected {
                     }
                 }
             }
         }
+        neighbor 10.1.1.0 {
+            address-family {
+                ipv4-unicast {
+                    nexthop-self {
+                        force
+                    }
+                    route-reflector-client
+                    soft-reconfiguration {
+                        inbound
+                    }
+                }
+            }
+            remote-as 64501
+        }
         parameters {
             router-id 10.0.0.1
         }
     }
 }
c-po triaged this task as Normal priority.

Thank you for giving out bleeding edge codebase a spin - I will check this out.