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

BGP for 6VPE with FRR version 7.3 #6382

Closed
KaushikNiral opened this issue May 11, 2020 · 6 comments
Closed

BGP for 6VPE with FRR version 7.3 #6382

KaushikNiral opened this issue May 11, 2020 · 6 comments
Labels
bgp platform Issue in a specific platform

Comments

@KaushikNiral
Copy link
Member

FRR version 7.3
commit Id: c0038fc

We have been trying to use FRR as BGP for 6VPE. The BGP sessions were up and also received 6VPE routes from PE routers (Cisco router), however the FRR didn't show these received routes as valid and best path.

The topology diagram :-

6VPE-FRR-Diag

On the PE routers, we configured MP-BGP to exchange IPv6 prefixes and the LSP (Label Switched Path) is based on IPv4.

The BGP configuration used in FRR router (PE 2) is :-

router bgp 234
no bgp default ipv4-unicast
neighbor 2.2.2.2 remote-as 234
neighbor 2.2.2.2 update-source 4.4.4.4
!
address-family ipv6 vpn
neighbor 2.2.2.2 activate
exit-address-family
!
router bgp 234 vrf vrfipv6
no bgp default ipv4-unicast
neighbor 3333::5 remote-as 5
!
address-family ipv6 unicast
redistribute connected
neighbor 3333::5 activate
label vpn export 107
rd vpn export 234:1
rt vpn both 1:1
export vpn
import vpn
exit-address-family
!

Expected behavior
The routes received from PE router should be installed on the bgp table and rib table.
The BGP update sent from FRR router (PE 2) must have nexthop as IPv4 mapped IPv6 address.

Screenshots
Please find the screenshot attached for show bgp vrf <vrf-name>
6VPE_show_bgp_vrf

Versions

  • OS Kernel: Linux ubuntu 4.18.0-15-generic
  • FRR Version [7.3]
@KaushikNiral KaushikNiral added the triage Needs further investigation label May 11, 2020
@ton31337 ton31337 reopened this May 14, 2020
@KaushikNiral
Copy link
Member Author

This issue is resolved in BGP and ZEBRA.

The output of the BGP table and RIB table is attached below.
6VPE_show_bgp_table
6VPE_bgp_table_inaccessible_resolved
6VPE-FIB-Route

The BGP update issue is also resolved for 6VPE .
The packet capture is attached below.

6VPE_bgp_update_packet.pcapng.zip

Thanks,

@qlyoung qlyoung added bgp platform Issue in a specific platform and removed triage Needs further investigation labels May 19, 2020
@sworleys
Copy link
Member

Regarding the issue brought up in the meeting today, linux does indeed support ipv6 with ipv4 nexthops via encoding the ipv4 inside a ipv6 nexthop.

Looking at your ouput it seems somewhat correct?

via ::ffff:202:202 <--- this looks to be encoded as this: ::ffff:2.2.2.2 ?

i.e. linux supports this dddd::/128 via ::ffff:1.1.1.1 dev dummy1 where 1.1.1.1 is your ipv4 nexthop

An issue you could also be running into though from the looks of it, is nexthop resolution is not properly re-encoding the nexthop it resolved to back into an ipv6 addresss.

Now... all this assumes that the kernel mpls implementation ALSO supports this encoding...

KaushikNiral added a commit to Niral-Networks/frr-1 that referenced this issue May 25, 2020
BUG No. FRRouting#6341 and FRRouting#6382
lib   : Added a macro to validate the IPv4 Mapped IPv6 address.
bgp   : Modifications done for bgp receive and while sending updates
	for IPv4 Mapped IPv6 address.
zebra : Modifications done for installing IPv4 Mapped IPv6 address as nexthop
	in RIB. Minor correction done in fpm while sending the routes for
	nexthop as IPv4 Mapped IPv6 address.
KaushikNiral added a commit to Niral-Networks/frr-1 that referenced this issue May 25, 2020
BUG No. FRRouting#6341 and FRRouting#6382
lib : Added a macro to validate the IPv4 Mapped IPv6 address.
bgp : Modifications done for bgp receive and while sending updates
for IPv4 Mapped IPv6 address.
zebra : Modifications done for installing IPv4 Mapped IPv6 address as nexthop
in RIB. Minor correction done in fpm while sending the routes for
nexthop as IPv4 Mapped IPv6 address.

Signed-off-by: Kaushik <kaushik@niralnetworks.com>
KaushikNiral added a commit to Niral-Networks/frr-1 that referenced this issue May 25, 2020
BUG No. FRRouting#6341 and FRRouting#6382
lib : Added a macro to validate the IPv4 Mapped IPv6 address.
bgp : Modifications done for bgp receive and while sending updates
for IPv4 Mapped IPv6 address.
zebra : Modifications done for installing IPv4 Mapped IPv6 address as nexthop
in RIB. Minor correction done in fpm while sending the routes for
nexthop as IPv4 Mapped IPv6 address.

Signed-off-by: Kaushik <kaushik@niralnetworks.com>
@KaushikNiral
Copy link
Member Author

Closing this issue. It is fixed by PR #6821

@pguibert6WIND
Copy link
Member

Hi, by testing master, I fail to make this setup work.
I get the following dump from frr:

west-vm# show ipv6 route vrf vrf1
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

VRF vrf1:
C>* 2003::/64 is directly connected, ntfp3, 00:02:21
B>* 4004::1/128 [20/0] via fe80::dced:2ff:fe0e:7e0, ntfp3, 00:02:14
B>r 5005::1/128 [200/0] via ::ffff:303:303(vrf default) (recursive), label 16, 00:02:01
  r                       via 20.1.1.1, ntfp1(vrf default), label 16, 00:02:01
C>* fe80::/64 is directly connected, ntfp3, 00:02:21
west-vm#


2021/08/26 14:36:22 ZEBRA: netlink_route_multipath(): RTM_NEWROUTE 5005::1/128 vrf 7(10)
2021/08/26 14:36:22 ZEBRA: netlink_talk: netlink-dp (NS 0) type RTM_NEWROUTE(24), len=64 seq=33 flags 0x401
2021/08/26 14:36:22 ZEBRA: Extended Error: IPv6 routes can not use an IPv4 nexthop
2021/08/26 14:36:22 ZEBRA: [EC 4043309093] netlink-dp (NS 0) error: Invalid argument, type=RTM_NEWROUTE(24), seq=33, pid=2897855348
2021/08/26 14:36:22 ZEBRA: 7:5005::1/128: Route install failed

I found out that if FRR is programmed to insert a V6 route to a V6 nexthop under the form of ipv4 mapped ipv6 address, and the ipv4 mapped ipv6 address is filled in in appropriate interface, it works for a connected route.
But on my case, i have an IGP ipv4 setup.
@KaushikNiral , is there need to patch FRR or is there need to improve setup ?

@brajtar
Copy link

brajtar commented Sep 29, 2021

Hi, has there been any progress on this? I have the exact same issue, I'm receiving routes via BGP and the nexthop is learned via IGP:

sh ipv6 route vrf vrf1
B>r 2000:2::/64 [20/0] via ::ffff:a03:c80c (vrf default) (recursive), label 25, weight 1, 00:00:06
  r                      via 10.3.121.10, eth1.889 (vrf default), label 18/25, weight 1, 00:00:06
B>r 3000:0:3::/48 [20/0] via ::ffff:a03:c80c (vrf default) (recursive), label 36, weight 1, 00:00:06
  r                        via 10.3.121.10, eth1.889 (vrf default), label 18/36, weight 1, 00:00:06
sh ip route
O[1]>* 10.3.200.12/32 [110/10002] via 10.3.121.10, eth1.889, label 18, weight 1, 00:33:30

However, when I use the command no zebra nexthop kernel enable, the routes are installed, but I don't want to use this workaround. Please help @KaushikNiral :)

@pguibert6WIND
Copy link
Member

@KaushikNiral , it would be nice that you share frr and your linux setup.
I wonder how you configured on PE ipv4 mapped ipv6 addresses?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bgp platform Issue in a specific platform
Projects
None yet
Development

No branches or pull requests

6 participants