Skip to content

Commit 840a534

Browse files
authored
Merge pull request sonic-net#42 from BRCM-SONIC/hasan-brcm-patch-1
Add BGP VRF and route-leak section in SONiC command reference guide
2 parents 896df55 + cf7ae63 commit 840a534

File tree

1 file changed

+157
-0
lines changed

1 file changed

+157
-0
lines changed

release_documents/Command-Reference.md

+157
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ Table of Contents
6868
* [Configuration Commands](#bgp-error-handling-config-commands)
6969
* [Show Commands](#bgp-error-handling-show-commands)
7070
* [Clear Commands](#bgp-error-handling-clear-commands)
71+
* [BGP VRF Configuration And Show Commands](#bgp-vrf-configuration-and-show-commands)
72+
* [Configuration Commands](#bgp-vrf-config-commands)
73+
* [BGP VRF Route Leak](#bgp-vrf-route-leak)
74+
* [Show Commands](#bgp-vrf-route-leak-show-commands)
7175
* [EVPN Configuration And Show Commands](#evpn-configuration-and-show-commands)
7276
* [Enable EVPN between BGP Neighbors](#enable-evpn-between-bgp-neighbors)
7377
* [EVPN Configuration Commands](#evpn-configuration-commands)
@@ -2829,6 +2833,159 @@ To retry installation of failed routes from Zebra, a clear command has been prov
28292833
root@sonic:~# clear ip route not-installed
28302834
```
28312835

2836+
# BGP VRF Configuration And Show Commands
2837+
This section provides high level config and show commands for BGP VRF
2838+
configuration and VRF route leak via BGP.
2839+
2840+
Please refer to "VRF configuration and show commands" section for details on
2841+
how to create VRFs in SONiC.
2842+
2843+
## Configuration Commands
2844+
2845+
BGP VRF instance for a given VRF can be configured using IS-CLI as shown below.
2846+
Autonomous-System (AS) number for the BGP VRF instance is not mandated to same
2847+
as of default BGP VRF instance.
2848+
2849+
Below example configures BGP instance for Vrf-red, configures a neighbor, and
2850+
redistributes connected routes into BGP VRF instance.
2851+
2852+
```
2853+
sonic(config)# router bgp 65535 vrf Vrf-red
2854+
sonic(config-router-bgp)# router-id 192.168.1.1
2855+
sonic(config-router-bgp)# neighbor 10.20.30.40
2856+
sonic(config-router-bgp-neighbor)# remote-as external
2857+
sonic(config-router-bgp-neighbor)# address-family ipv4 unicast
2858+
sonic(config-router-bgp-neighbor-af)# activate
2859+
2860+
sonic(config-router-bgp)# address-family ipv4 unicast
2861+
sonic(config-router-bgp-af)# redistribute connected
2862+
```
2863+
2864+
It is recommended to configure router-id for the BGP VRF instance(s) in order
2865+
to avoid router-id reselection when IP addresses are unconfigured in the VRF.
2866+
2867+
IPv4 unicast, IPv6 unicast, and L2VPN EVPN address-families are
2868+
supported in the BGP VRF instances. Details on using L2VPN EVPN
2869+
address-family is described in the next BGP EVPN section.
2870+
2871+
BGP VRF instance can be created without creating default BGP VRF instance.
2872+
However, deletion of default BGP VRF instance is restricted if non-default BGP
2873+
VRF instance(s) are present. All non-default BGP VRF instances are required to
2874+
be deleted before deleting BGP default VRF instance.
2875+
2876+
2877+
## BGP VRF Route Leak
2878+
Routes can be leaked from one VRF to another using BGP VRF route leak feature
2879+
described in this section.
2880+
2881+
Use the 'import' command in corresponding address-family of BGP VRF instance to
2882+
import routes from the given source VRF. In the example below, BGP Vrf-red
2883+
instance is configured to import IPv4 and IPv6 routes from BGP Vrf-blue.
2884+
```
2885+
sonic(config)# router bgp 20 vrf Vrf-red
2886+
sonic(config-router-bgp)# address-family ipv4 unicast
2887+
sonic(config-router-bgp-af)# import vrf Vrf-blue
2888+
2889+
sonic(config-router-bgp)# address-family ipv6 unicast
2890+
sonic(config-router-bgp-af)# import vrf Vrf-blue
2891+
2892+
```
2893+
2894+
Import of routes from multiple BGP VRF instances is allowed.
2895+
2896+
Route-map can be applied for the imported leaked routes as shown below.
2897+
2898+
```
2899+
sonic(config)# router bgp 20 vrf Vrf-red
2900+
sonic(config-router-bgp)# address-family ipv4 unicast
2901+
sonic(config-router-bgp-af)# import vrf route-map my-import-filter
2902+
sonic(config-router-bgp-af)# import vrf Vrf-red
2903+
sonic(config-router-bgp-af)#
2904+
```
2905+
2906+
Configured import route-map filters routes from all of the configured
2907+
import-VRFs. In case specific routes from specific VRF are required to be
2908+
filtered, match-vrf clause in the route-map can be used.
2909+
2910+
Note that above BGP VRF import commands leak the prefixes, including connected
2911+
subnets, from one vrf to another. Leaking of connected subnets may incur
2912+
sub-optimal forwarding for the inter-vrf traffic through the CPU (slow) path.
2913+
It is therefore recommended to always leak the routes which have remote
2914+
next-hops instead of leaking the connected subnets.
2915+
2916+
2917+
## Show Commands
2918+
In order to show routes from a given VRF instance, 'vrf' option can be
2919+
specified to the regular bgp and ip route show commands.
2920+
2921+
Below commands show BGP routes in the given BGP VRF instance:
2922+
2923+
```
2924+
sonic# show ip bgp vrf Vrf-red
2925+
BGP table version is 9, local router ID is 169.100.1.1, vrf id 91
2926+
Default local pref 100, local AS 10
2927+
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, # not installed in hardware
2928+
i internal, r RIB-failure, S Stale, R Removed
2929+
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
2930+
Origin codes: i - IGP, e - EGP, ? - incomplete
2931+
2932+
Network Next Hop Metric LocPrf Weight Path
2933+
*> 1.1.1.1/32 0.0.0.0@0< 0 32768 ?
2934+
*> 1.2.1.1/32 0.0.0.0@0< 0 32768 ?
2935+
*> 4.1.1.1/32 fe80::5054:ff:fe8d:7741@0<
2936+
*> 8.0.0.0/24 fe80::5054:ff:fe8d:7741@0<
2937+
* 10.59.128.0/20 fe80::5054:ff:fe8d:7741@0<
2938+
*> 51.52.0.0/31 0.0.0.0@0< 0 32768 ?
2939+
*> 155.100.1.0/24 0.0.0.0 0 32768 ?
2940+
*> 169.100.1.0/24 0.0.0.0 0 32768 ?
2941+
*> 200.2.1.0/24 0.0.0.0@0< 0 32768 ?
2942+
2943+
Displayed 9 routes and 13 total paths
2944+
sonic#
2945+
2946+
```
2947+
2948+
```
2949+
sonic# show bgp vrf Vrf-red ipv6
2950+
BGP table version is 3, local router ID is 169.100.1.1, vrf id 91
2951+
Default local pref 100, local AS 10
2952+
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, # not installed in hardware
2953+
i internal, r RIB-failure, S Stale, R Removed
2954+
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
2955+
Origin codes: i - IGP, e - EGP, ? - incomplete
2956+
2957+
Network Next Hop Metric LocPrf Weight Path
2958+
*> 1550:100:1::/80 :: 0 32768 ?
2959+
*> 1690:100:1::/64 :: 0 32768 ?
2960+
*> 2000:200::/64 ::@0< 0 32768 ?
2961+
2962+
Displayed 3 routes and 3 total paths
2963+
sonic#
2964+
```
2965+
2966+
2967+
Below command shows routes from the RIB for the specified VRF:
2968+
```
2969+
sonic# show ip route vrf Vrf-red
2970+
Codes: K - kernel route, C - connected, S - static, R - RIP,
2971+
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
2972+
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
2973+
F - PBR, f - OpenFabric,
2974+
> - selected route, * - FIB route, q - queued route, r - rejected route, # - not installed in hardware
2975+
VRF Vrf-red:
2976+
B>* 1.1.1.1/32 [200/0] is directly connected, Loopback10(vrf default), 01:33:30
2977+
B>* 1.2.1.1/32 [200/0] is directly connected, Loopback11(vrf default), 01:33:30
2978+
B>* 4.1.1.1/32 [200/0] via fe80::5054:ff:fe8d:7741, Ethernet0(vrf default), 01:33:29
2979+
B>* 8.0.0.0/24 [200/0] via fe80::5054:ff:fe8d:7741, Ethernet0(vrf default), 01:33:29
2980+
B>* 10.59.128.0/20 [200/0] is directly connected, eth0(vrf default), 01:33:30
2981+
B>* 51.52.0.0/31 [200/0] is directly connected, Vlan4090(vrf default), 01:33:30
2982+
C>* 155.100.1.0/24 is directly connected, Vlan100, 01:33:52
2983+
C>* 169.100.1.0/24 is directly connected, Vlan1000, 01:33:52
2984+
B>* 200.2.1.0/24 [200/0] is directly connected, Vlan200(vrf default), 01:33:30
2985+
sonic#
2986+
2987+
```
2988+
28322989
# EVPN Configuration And Show Commands
28332990

28342991
The following sections provide the basic configuration needed to use EVPN as the control plane for VXLAN.

0 commit comments

Comments
 (0)