-
Notifications
You must be signed in to change notification settings - Fork 1.4k
route-map encapsulation gretap #19786
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
base: master
Are you sure you want to change the base?
route-map encapsulation gretap #19786
Conversation
|
ci:rerun |
zebra/interface.c
Outdated
| } else if (IS_ZEBRA_IF_VXLAN(ifp)) { | ||
| zebra_vxlan_if_dump_vty(vty, zebra_if); | ||
| } else if (IS_ZEBRA_IF_GRE(ifp)) { | ||
| } else if (IS_ZEBRA_IF_GRE(ifp) || IS_ZEBRA_IF_GRETAP(ifp)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure looks like you are missing this code in the json portion ( and this is EXACTLY why I didn't want a json specific function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right. I completely forgot the json part. Adding the support for it.
| case ZEBRA_IF_GRE: | ||
| type = "frr-zebra:zif-gre"; | ||
| break; | ||
| case ZEBRA_IF_GRETAP: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no changes in zebra/zapi_msg.c. Shouldn't we just change the IS_ZEBRA_IF_GRE to encompass a GRETAP interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a change in zebra/zapi_msg.c... or I did not understand the question.
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -77,6 +77,7 @@ static void zserv_encode_interface(struct stream *s, struct interface *ifp)
stream_putl(s, ifp->mtu6);
stream_putl(s, ifp->bandwidth);
stream_putl(s, zif->link_ifindex);
+ stream_putl(s, ifp->zif_type);
I agree that GRE and GRETAP interfaces are similar.
But what about users that already have GRETAP interfaces used today for an other purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are tests of if (IS_ZEBRA_GRE) in zapi_msg.c that you did not include the new test for to test if it is IS_ZEBRA_GRETAP`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha ok. yes, I need to clarify. today, only NHRP uses it, so NHRP is only GRE. But we have to take care of remaining code. Later GRE_SOURCE_SET and GRE_GET zapi messages should cover other kind of tunnels too.
So I added a comment.
|
|
||
| /* Set nexthop to object */ | ||
| struct rmap_l3vpn_nexthop_encapsulation_set { | ||
| uint8_t protocol; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we completely dropping the protocol?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About protocol, I need to think..
Link layer protocol is not precise enough to know I am over a GRETAP (LLT ETHERNET) or a GRE interface (LLT_IPGRE).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it was storing protocol and allowing matches against it, who have you broken with this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IP protocol of the 'rmap_l3vpn_nexthop_encapsulation_set'
structure is replaced by the zif_type, as interfaces used as backbone
for mpls ca either be ptp L3 GRE interfaces or ptp L2 GRE (GRETAP)
interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was considering IP6GRE and GRE equal for BGP.
I will use the same mechanism for IP6GRETAP and GRETAP interfaces.
So one new keywords: gretap
|
a) Documentation update |
1e3f3a9 to
1b0243e
Compare
|
ci:rerun |
0505ea9 to
a326503
Compare
|
ci:rerun |
a326503 to
2962f58
Compare
|
ci:rerun |
|
@vayetze , there is a topotest added. |
ba6605d to
6b82fe6
Compare
82def60 to
22bb12c
Compare
Add gretap interface information. > Interface l2gre0 is up, line protocol is up > Link ups: 0 last: (never) > Link downs: 0 last: (never) > vrf: default > index 8 metric 0 mtu 1462 speed 0 txqlen 1000 > flags: <UP,LOWER_UP,BROADCAST,RUNNING,MULTICAST> > MPLS Not specified by CLI > Multicast config is Not specified by CLI > Shutdown config is Not specified by CLI > Type: Ethernet > HWaddr: 2e:dd:45:c2:12:44 > inet6 fe80::2cdd:45ff:fec2:1244/64 > Interface Type GRETAP > Interface Slave Type None > VTEP IP: 192.168.0.10 , remote 192.168.0.103 > protodown: off Some ZAPI code is GRE-specific for now, as only NHRP uses GRE information. Signed-off-by: Philippe Guibert <[email protected]>
The interface kind is needed by some daemons in order to apply some filtering rules. The struct interface is shared between daemons via the ZAPI socket. Signed-off-by: Philippe Guibert <[email protected]>
Add new defines to detect ip6gre and ip6gretap interfaces. Signed-off-by: Philippe Guibert <[email protected]>
Use the zebra interface type for the bgp route-map encapsulation gre command. The IP protocol of the 'rmap_l3vpn_nexthop_encapsulation_set' structure is replaced by the zif_type, as interfaces used as backbone for mpls ca either be ptp L3 GRE interfaces or ptp L2 GRE (GRETAP) interfaces. Signed-off-by: Philippe Guibert <[email protected]>
Add support for gretap encapsulation type. Signed-off-by: Philippe Guibert <[email protected]>
The bgp_vpnv4_gre test validates imported routes as ok when route-map is detached. Whereas, The nexthop of MPLS paths must either be a labelled nexthop or point to a GRE interface (by using route-map). The case where this check does not matter is when local importation is performed by using the 'import vrf' command. Fix this by applying the automatic validation only when this command is used to import VPN paths. Enforce the current topotest by really checking the invalidity of the path. Apply black style to modified topotest. Fixes: 93fd9cb ("bgpd: Validate imported routes next-hop that is in a default VRF") Signed-off-by: Philippe Guibert <[email protected]>
The previous commit broke the bgp_vpn_import_nexthop_default_vrf test. This test reproduced issue FRRouting#12502. By default, BGP imported MPLS paths can not be selected, while the nexthop is not located under an MPLS backbone, except for some exceptions. One of them is that the path is learned by an eBGP peer located in a connected network segment. This is what is described in [0], section b). For that, the per-interface 'mpls bgp forwarding' command aims at helping validating the incoming BGP path. Add config command for test 'vpnv4_import_allowas_in' and for 'vpnv4_import_nexthop_default_vrf' that have been implemented on the same model. [0] https://datatracker.ietf.org/doc/html/rfc4364#section-10 Link: FRRouting@34f7a57 Link: FRRouting#12502 Signed-off-by: Philippe Guibert <[email protected]>
Add a test that demonstrates that an MPLS path can be installed over a GRETAP interface, if a route-map autorises it. Signed-off-by: Philippe Guibert <[email protected]>
The previous commit broke some IGP tests that were not using MPLS paths. Move the test to be an eBGP peering, and use the interAS option that allows bgp paths to be imported. Signed-off-by: Philippe Guibert <[email protected]>
Like it has been done on previous commits, use the inter-AS option B mechanism to autorise ebgp connection to convey directly MPLS paths without any MPLS backbone support. Signed-off-by: Philippe Guibert <[email protected]>
Signed-off-by: Philippe Guibert <[email protected]>
22bb12c to
5dc35cb
Compare
|
@ton31337 @donaldsharp , any updates? |
Add ability to encapsulation L3VPN traffic directly into GRETAP interface, by using route-map.