frr icon indicating copy to clipboard operation
frr copied to clipboard

BGP L3VPN: Connected route not advertised to neighbors when using network cmd

Open fengshh1383 opened this issue 2 years ago • 17 comments


Describe the bug

My host is Ubuntu 18.04, using FRR 7.5. I have configured a BGP L3VPN environment, and I try to advertise a connected route used network cmd, but it doesn't works. But if I use redistribute connected cmd, it works correct. Is this a bug? Or am I using it incorrectly? I wish someone can help me.

  • [x] Did you check if this is a duplicate issue?
  • [x] Did you test it on the latest FRRouting/frr master branch?

To Reproduce

This is my topologic structure, the R1's 30.30.30.0/24 and R2's 20.20.20.0/24 are connected route. I want to advertise this route with network cmd. 拓扑图

Using network cmd

R1:

frr configure:

R1# do show running-config 
Building configuration...

Current configuration:
!
frr version 7.5-MyOwnFRRVersion
frr defaults traditional
hostname ubuntu-128
log syslog
service integrated-vtysh-config
!
debug zebra rib
debug zebra nht detailed
debug bgp neighbor-events
debug bgp nht
debug bgp update-groups
debug bgp updates in
debug bgp updates out
debug bgp vpn leak-from-vrf
debug bgp vpn leak-to-vrf
!
router bgp 200
 bgp router-id 1.1.1.1
 no bgp ebgp-requires-policy
 write-quanta 10
 neighbor 2.2.2.2 remote-as 200
 neighbor 2.2.2.2 update-source loop1
 !
 address-family ipv4 vpn
  neighbor 2.2.2.2 activate
 exit-address-family
!
router bgp 200 vrf vrf-vpn1
 no bgp ebgp-requires-policy
 write-quanta 10
 !
 address-family ipv4 unicast
  network 30.30.30.0/24
  label vpn export auto
  rd vpn export 100:1
  rt vpn both 100:1
  export vpn
  import vpn
 exit-address-family
!
line vty
!
end

bgp summary:

R1# show bgp summary 

IPv4 Unicast Summary:
BGP router identifier 1.1.1.1, local AS number 200 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 21 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
2.2.2.2         4        200       111       111        0    0    0 00:55:50            0        0

Total number of neighbors 1

IPv4 VPN Summary:
BGP router identifier 1.1.1.1, local AS number 200 vrf-id 0
BGP table version 0
RIB entries 1, using 192 bytes of memory
Peers 1, using 21 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
2.2.2.2         4        200       111       111        0    0    0 00:55:50            0        0

Total number of neighbors 1

vrf route:

R1# show ip route vrf vrf-vpn1
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, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup

VRF vrf-vpn1:
C>* 30.30.30.0/24 is directly connected, ens40, 01:30:00

interfaces:

R1# ip link show vrf-vpn1 
7: vrf-vpn1: <NOARP,MASTER,UP,LOWER_UP> mtu 65575 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 6a:6f:49:64:75:02 brd ff:ff:ff:ff:ff:ff
R1# ip link show ens40
5: ens40: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master vrf-vpn1 state UP mode DEFAULT group default qlen 1000
    link/ether 00:0c:29:56:03:c3 brd ff:ff:ff:ff:ff:ff

frr log:

bgpd[101480]: Allocated bnc 30.30.30.0/24(0)(VRF vrf-vpn1) peer 0x0
bgpd[101480]: bgp_static_update(30.30.30.0): Route not in table, not advertising
bgpd[101480]: vpn_leak_from_vrf_update: from vrf VRF vrf-vpn1
bgpd[101480]: vpn_leak_from_vrf_update: post merge static_attr.ecommunity{100:1}
bgpd[101480]: vpn_leak_from_vrf_update: new_attr->ecommunity{100:1}
bgpd[101480]: leak_update: entry: leak-to=VRF default, p=30.30.30.0/24, type=9, sub_type=1
bgpd[101480]: Allocated bnc 0.0.0.0/32(0)(VRF vrf-vpn1) peer 0x0
bgpd[101480]: leak_update: nexthop is not valid (in vrf VRF vrf-vpn1)
bgpd[101480]: leak_update: ->VRF default: 30.30.30.0/24: Added new route
bgpd[101480]: vpn_leak_to_vrf_update: start (path_vpn=0x5590c08cc530)
bgpd[101480]: vpn_leak_to_vrf_update_onevrf: skipping: import not set
zebra[101473]: rnh_register msg from client bgp: hdr->length=8, type=route vrf=7
zebra[101473]: 7: Add RNH 30.30.30.0/24 type Import
zebra[101473]: zebra_rnh_store_in_routing_table: 7:30.30.30.0/24 added for tracking on 0.0.0.0/0
zebra[101473]: 7:30.30.30.0/24: Evaluate RNH, type Import (force)
zebra[101473]: zebra_rnh_resolve_import_entry: 7:30.30.30.0/24 Resolved Import Entry to 30.30.30.0/24
zebra[101473]: zebra_rnh_remove_from_routing_table: 7:30.30.30.0/24 removed from tracking on 0.0.0.0/0
zebra[101473]: zebra_rnh_store_in_routing_table: 7:30.30.30.0/24 added for tracking on 30.30.30.0/24
zebra[101473]: 7:30.30.30.0/24: Route import check passed (state changed)
zebra[101473]: 7: Client bgp registers for RNH 30.30.30.0/24 type Import
bgpd[101480]: VRF vrf-vpn1(7): Rcvd NH update 30.30.30.0/24(0) - metric 0/0 #nhops 1/0 flags 0x32
bgpd[101480]:     nhop via if 5 (0 labels)
bgpd[101480]: NH update for 30.30.30.0/24(0)(VRF vrf-vpn1) - flags 0x33 chgflags 0x1 - evaluate paths
bgpd[101480]: ... eval path 1/1 30.30.30.0/24 VRF vrf-vpn1 flags 0x0
bgpd[101480]: group_announce_route_walkcb: afi=IPv4, safi=vpn, p=30.30.30.0/24

R2:

frr configure:

R2# do show running-config 
Building configuration...

Current configuration:
!
frr version 7.5-MyOwnFRRVersion
frr defaults traditional
hostname ubuntu-130
log syslog
service integrated-vtysh-config
!
debug zebra rib
debug zebra nht detailed
debug bgp neighbor-events
debug bgp nht
debug bgp update-groups
debug bgp updates in
debug bgp updates out
debug bgp vpn leak-from-vrf
debug bgp vpn leak-to-vrf
!
router bgp 200
 bgp router-id 2.2.2.2
 no bgp ebgp-requires-policy
 write-quanta 10
 neighbor 1.1.1.1 remote-as 200
 neighbor 1.1.1.1 update-source loop1
 !
 address-family ipv4 vpn
  neighbor 1.1.1.1 activate
 exit-address-family
!
router bgp 200 vrf vrf-vpn1
 no bgp ebgp-requires-policy
 write-quanta 10
 !
 address-family ipv4 unicast
  network 20.20.20.0/24
  label vpn export auto
  rd vpn export 100:1
  rt vpn both 100:1
  export vpn
  import vpn
 exit-address-family
!
line vty
!
end

bgp summary:

R2#show bgp summary 

IPv4 Unicast Summary:
BGP router identifier 2.2.2.2, local AS number 200 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 21 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
1.1.1.1         4        200       165       161        0    0    0 01:08:18            0        0

Total number of neighbors 1

IPv4 VPN Summary:
BGP router identifier 2.2.2.2, local AS number 200 vrf-id 0
BGP table version 0
RIB entries 1, using 192 bytes of memory
Peers 1, using 21 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
1.1.1.1         4        200       165       161        0    0    0 01:08:18            0        0

Total number of neighbors 1

vrf route:

R2# show ip route vrf vrf-vpn1
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, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup

VRF vrf-vpn1:
C>* 20.20.20.0/24 is directly connected, ens40, 02:31:00

interfaces:

R2# ip link show vrf-vpn1
7: vrf-vpn1: <NOARP,MASTER,UP,LOWER_UP> mtu 65536 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether ce:a7:87:4f:7e:6a brd ff:ff:ff:ff:ff:ff
R2# ip link show ens40
5: ens40: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master vrf-vpn1 state UP mode DEFAULT group default qlen 1000
    link/ether 00:0c:29:78:0c:89 brd ff:ff:ff:ff:ff:ff

frr log:

bgpd[5153]: Allocated bnc 20.20.20.0/24(0)(VRF vrf-vpn1) peer 0x0
zebra[5146]: rnh_register msg from client bgp: hdr->length=8, type=route vrf=7
zebra[5146]: 7: Add RNH 20.20.20.0/24 type Import
zebra[5146]: zebra_rnh_store_in_routing_table: 7:20.20.20.0/24 added for tracking on 0.0.0.0/0
zebra[5146]: 7:20.20.20.0/24: Evaluate RNH, type Import (force)
zebra[5146]: zebra_rnh_resolve_import_entry: 7:20.20.20.0/24 Resolved Import Entry to 20.20.20.0/24
zebra[5146]: zebra_rnh_remove_from_routing_table: 7:20.20.20.0/24 removed from tracking on 0.0.0.0/0
zebra[5146]: zebra_rnh_store_in_routing_table: 7:20.20.20.0/24 added for tracking on 20.20.20.0/24
zebra[5146]: 7:20.20.20.0/24: Route import check passed (state changed)
bgpd[5153]: bgp_static_update(20.20.20.0): Route not in table, not advertising
zebra[5146]: 7: Client bgp registers for RNH 20.20.20.0/24 type Import
bgpd[5153]: vpn_leak_from_vrf_update: from vrf VRF vrf-vpn1
bgpd[5153]: vpn_leak_from_vrf_update: post merge static_attr.ecommunity{100:1}
bgpd[5153]: vpn_leak_from_vrf_update: new_attr->ecommunity{100:1}
bgpd[5153]: leak_update: entry: leak-to=VRF default, p=20.20.20.0/24, type=9, sub_type=1
bgpd[5153]: Allocated bnc 0.0.0.0/32(0)(VRF vrf-vpn1) peer 0x0
bgpd[5153]: leak_update: nexthop is not valid (in vrf VRF vrf-vpn1)
bgpd[5153]: leak_update: ->VRF default: 20.20.20.0/24: Added new route
bgpd[5153]: vpn_leak_to_vrf_update: start (path_vpn=0x55a539b513c0)
bgpd[5153]: vpn_leak_to_vrf_update_onevrf: skipping: import not set
bgpd[5153]: VRF vrf-vpn1(7): Rcvd NH update 20.20.20.0/24(0) - metric 0/0 #nhops 1/0 flags 0x32
bgpd[5153]:     nhop via if 5 (0 labels)
bgpd[5153]: NH update for 20.20.20.0/24(0)(VRF vrf-vpn1) - flags 0x33 chgflags 0x1 - evaluate paths
bgpd[5153]: ... eval path 1/1 20.20.20.0/24 VRF vrf-vpn1 flags 0x0
bgpd[5153]: group_announce_route_walkcb: afi=IPv4, safi=vpn, p=20.20.20.0/24

Using redistribute connected cmd

R1:

frr configure:

R1# show running-config 
Building configuration...

Current configuration:
!
frr version 7.5-MyOwnFRRVersion
frr defaults traditional
hostname ubuntu-128
log syslog
service integrated-vtysh-config
!
debug zebra rib
debug zebra nht detailed
debug bgp neighbor-events
debug bgp nht
debug bgp update-groups
debug bgp updates in
debug bgp updates out
debug bgp vpn leak-from-vrf
debug bgp vpn leak-to-vrf
!
router bgp 200
 bgp router-id 1.1.1.1
 no bgp ebgp-requires-policy
 write-quanta 10
 neighbor 2.2.2.2 remote-as 200
 neighbor 2.2.2.2 update-source loop1
 !
 address-family ipv4 vpn
  neighbor 2.2.2.2 activate
 exit-address-family
!
router bgp 200 vrf vrf-vpn1
 no bgp ebgp-requires-policy
 write-quanta 10
 !
 address-family ipv4 unicast
  redistribute connected
  label vpn export auto
  rd vpn export 100:1
  rt vpn both 100:1
  export vpn
  import vpn
 exit-address-family
!
line vty
!
end

vrf route:

R1# show ip route vrf vrf-vpn1 
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, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup

VRF vrf-vpn1:
B>  20.20.20.0/24 [200/0] via 2.2.2.2 (vrf default) (recursive), label 16, weight 1, 00:00:23
  *                         via 10.10.10.128, ens39 (vrf default), label 16, weight 1, 00:00:23
C>* 30.30.30.0/24 is directly connected, ens40, 01:56:42

R2:

frr configure:

R2# show running-config 
Building configuration...

Current configuration:
!
frr version 7.5-MyOwnFRRVersion
frr defaults traditional
hostname ubuntu-130
log syslog
service integrated-vtysh-config
!
debug zebra rib
debug zebra nht detailed
debug bgp neighbor-events
debug bgp nht
debug bgp update-groups
debug bgp updates in
debug bgp updates out
debug bgp vpn leak-from-vrf
debug bgp vpn leak-to-vrf
!
router bgp 200
 bgp router-id 2.2.2.2
 no bgp ebgp-requires-policy
 write-quanta 10
 neighbor 1.1.1.1 remote-as 200
 neighbor 1.1.1.1 update-source loop1
 !
 address-family ipv4 vpn
  neighbor 1.1.1.1 activate
 exit-address-family
!
router bgp 200 vrf vrf-vpn1
 no bgp ebgp-requires-policy
 write-quanta 10
 !
 address-family ipv4 unicast
  redistribute connected
  label vpn export auto
  rd vpn export 100:1
  rt vpn both 100:1
  export vpn
  import vpn
 exit-address-family
!
line vty
!
end

vrf route:

R2# show ip route vrf vrf-vpn1 
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, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup

VRF vrf-vpn1:
C>* 20.20.20.0/24 is directly connected, ens40, 02:46:27
B>  30.30.30.0/24 [200/0] via 1.1.1.1 (vrf default) (recursive), label 16, weight 1, 00:04:55
  *                         via 10.10.10.130, ens39 (vrf default), label 16, weight 1, 00:04:55

Expected behavior

When using network cmd, it works like redistribute connected cmd.

Screenshots

Versions

  • OS Version: Ubuntu 18.04.4
  • Kernel: 4.15.0-112-generic
  • FRR Version: 7.5

Additional context

fengshh1383 avatar Dec 13 '22 09:12 fengshh1383