diff options
Diffstat (limited to 'docs/configuration/vrf')
-rw-r--r-- | docs/configuration/vrf/index.rst | 144 |
1 files changed, 117 insertions, 27 deletions
diff --git a/docs/configuration/vrf/index.rst b/docs/configuration/vrf/index.rst index e58005e7..bd482cd9 100644 --- a/docs/configuration/vrf/index.rst +++ b/docs/configuration/vrf/index.rst @@ -30,7 +30,6 @@ then enslaved to a VRF device. .. note:: A routing table ID can not be modified once it is assigned. It can only be changed by deleting and re-adding the VRF instance. - .. cfgcmd:: set vrf bind-to-all By default the scope of the port bindings for unbound sockets is limited to @@ -41,6 +40,33 @@ then enslaved to a VRF device. TCP & UDP services running in the default VRF context (ie., not bound to any VRF device) can work across all VRF domains by enabling this option. +Zebra/Kernel route filtering +---------------------------- + +Zebra supports prefix-lists and Route Mapss to match routes received from +other FRR components. The permit/deny facilities provided by these commands +can be used to filter which routes zebra will install in the kernel. + +.. cfgcmd:: set vrf <name> ip protocol <protocol> route-map <route-map> + + Apply a route-map filter to routes for the specified protocol. + + The following protocols can be used: any, babel, bgp, connected, eigrp, + isis, kernel, ospf, rip, static, table + + .. note:: If you choose any as the option that will cause all protocols that + are sending routes to zebra. + +.. cfgcmd:: set vrf <name> ipv6 protocol <protocol> route-map <route-map> + + Apply a route-map filter to routes for the specified protocol. + + The following protocols can be used: any, babel, bgp, connected, isis, + kernel, ospfv3, ripng, static, table + + .. note:: If you choose any as the option that will cause all protocols that + are sending routes to zebra. + Interfaces ---------- @@ -168,8 +194,8 @@ For VRF maintenance the following operational commands are in place. the round-trip time of these packets is used in calculating the minimum/ average/maximum round-trip time numbers. - Ping command can be interrupted at any given time using `<Ctrl>+c`- A brief - statistic is shown afterwards. + .. note:: Ping command can be interrupted at any given time using ``<Ctrl>+c``. + A brief statistic is shown afterwards. .. code-block:: none @@ -189,6 +215,17 @@ For VRF maintenance the following operational commands are in place. route packets taken to the given hosts IP address family. This option is useful when the host is specified as a hostname rather than an IP address. +.. opcmd:: force vrf <name> + + Join a given VRF. This will open a new subshell within the specified VRF. + + The prompt is adjusted to reflect this change in both config and op-mode. + + .. code-block:: none + + vyos@vyos:~$ force vrf blue + vyos@vyos(vrf:blue):~$ + .. _vrf example: Example @@ -242,12 +279,50 @@ Configuration set vrf name red protocols static route 10.0.0.0/24 interface eth1 vrf 'default' set vrf name red table '2000' +VRF and NAT +----------- + +.. _vrf:nat_configuration: + +Configuration +^^^^^^^^^^^^^ + + .. code-block:: none + + set interfaces ethernet eth0 address '172.16.50.12/24' + set interfaces ethernet eth0 vrf 'red' + + set interfaces ethernet eth1 address '192.168.130.100/24' + set interfaces ethernet eth1 vrf 'blue' + + set nat destination rule 110 description 'NAT ssh- INSIDE' + set nat destination rule 110 destination port '2022' + set nat destination rule 110 inbound-interface name 'eth0' + set nat destination rule 110 protocol 'tcp' + set nat destination rule 110 translation address '192.168.130.40' + + set nat source rule 100 outbound-interface name 'eth0' + set nat source rule 100 protocol 'all' + set nat source rule 100 source address '192.168.130.0/24' + set nat source rule 100 translation address 'masquerade' + + set service ssh vrf 'red' + + set vrf bind-to-all + set vrf name blue protocols static route 0.0.0.0/0 next-hop 172.16.50.1 vrf 'red' + set vrf name blue protocols static route 172.16.50.0/24 interface eth0 vrf 'red' + set vrf name blue table '1010' + + set vrf name red protocols static route 0.0.0.0/0 next-hop 172.16.50.1 + set vrf name red protocols static route 192.168.130.0/24 interface eth1 vrf 'blue' + set vrf name red table '2020' + .. _vrf example operation: Operation ^^^^^^^^^ -After committing the configuration we can verify all leaked routes are +After committing the configuration we can verify all leaked routes are installed, and try to ICMP ping PC1 from PC3. .. code-block:: none @@ -323,8 +398,8 @@ VRF blue routing table L3VPN VRFs ########## -:abbr:`L3VPN VRFs ( Layer 3 Virtual Private Networks )` bgpd supports for -IPv4 RFC 4364 and IPv6 RFC 4659. L3VPN routes, and their associated VRF +:abbr:`L3VPN VRFs ( Layer 3 Virtual Private Networks )` bgpd supports for +IPv4 RFC 4364 and IPv6 RFC 4659. L3VPN routes, and their associated VRF MPLS labels, can be distributed to VPN SAFI neighbors in the default, i.e., non VRF, BGP instance. VRF MPLS labels are reached using core MPLS labels which are distributed using LDP or BGP labeled unicast. @@ -336,14 +411,14 @@ VRF Route Leaking ================= BGP routes may be leaked (i.e. copied) between a unicast VRF RIB and the VPN -SAFI RIB of the default VRF for use in MPLS-based L3VPNs. Unicast routes may +SAFI RIB of the default VRF for use in MPLS-based L3VPNs. Unicast routes may also be leaked between any VRFs (including the unicast RIB of the default BGP -instance). A shortcut syntax is also available for specifying leaking from +instance). A shortcut syntax is also available for specifying leaking from one VRF to another VRF using the default instance’s VPN RIB as the intemediary -. A common application of the VRF-VRF feature is to connect a customer’s +. A common application of the VRF-VRF feature is to connect a customer’s private routing domain to a provider’s VPN service. Leaking is configured from the point of view of an individual VRF: import refers to routes leaked from VPN -to a unicast VRF, whereas export refers to routes leaked from a unicast VRF to +to a unicast VRF, whereas export refers to routes leaked from a unicast VRF to VPN. @@ -352,7 +427,7 @@ VPN. an RD / RTLIST - Configuration for these exported routes must, at a minimum, specify + Configuration for these exported routes must, at a minimum, specify these two parameters. .. _l3vpn-vrf example configuration: @@ -361,37 +436,45 @@ Configuration ============= Configuration of route leaking between a unicast VRF RIB and the VPN SAFI RIB -of the default VRF is accomplished via commands in the context of a VRF +of the default VRF is accomplished via commands in the context of a VRF address-family. -.. cfgcmd:: set vrf name <name> protocols bgp address-family +.. cfgcmd:: set vrf name <name> protocols bgp address-family <ipv4-unicast|ipv6-unicast> rd vpn export <asn:nn|address:nn> - - Specifies the route distinguisher to be added to a route exported from the + + Specifies the route distinguisher to be added to a route exported from the current unicast VRF to VPN. .. cfgcmd:: set vrf name <name> protocols bgp address-family <ipv4-unicast|ipv6-unicast> route-target vpn <import|export|both> [RTLIST] - Specifies the route-target list to be attached to a route (export) or the - route-target list to match against (import) when exporting/importing + Specifies the route-target list to be attached to a route (export) or the + route-target list to match against (import) when exporting/importing between the current unicast VRF and VPN.The RTLIST is a space-separated - list of route-targets, which are BGP extended community values as + list of route-targets, which are BGP extended community values as described in Extended Communities Attribute. .. cfgcmd:: set vrf name <name> protocols bgp address-family <ipv4-unicast|ipv6-unicast> label vpn export <0-1048575|auto> - Enables an MPLS label to be attached to a route exported from the current - unicast VRF to VPN. If the value specified is auto, the label value is + Enables an MPLS label to be attached to a route exported from the current + unicast VRF to VPN. If the value specified is auto, the label value is automatically assigned from a pool maintained. .. cfgcmd:: set vrf name <name> protocols bgp address-family + <ipv4-unicast|ipv6-unicast> label vpn allocation-mode per-nexthop + + Select how labels are allocated in the given VRF. By default, the per-vrf + mode is selected, and one label is used for all prefixes from the VRF. The + per-nexthop will use a unique label for all prefixes that are reachable via + the same nexthop. + +.. cfgcmd:: set vrf name <name> protocols bgp address-family <ipv4-unicast|ipv6-unicast> route-map vpn <import|export> [route-map <name>] - Specifies an optional route-map to be applied to routes imported or + Specifies an optional route-map to be applied to routes imported or exported between the current unicast VRF and VPN. .. cfgcmd:: set vrf name <name> protocols bgp address-family @@ -401,12 +484,19 @@ address-family. .. cfgcmd:: set vrf name <name> protocols bgp address-family <ipv4-unicast|ipv6-unicast> import vrf <name> - - Shortcut syntax for specifying automatic leaking from vrf VRFNAME to the - current VRF using the VPN RIB as intermediary. The RD and RT are auto - derived and should not be specified explicitly for either the source or + + Shortcut syntax for specifying automatic leaking from vrf VRFNAME to the + current VRF using the VPN RIB as intermediary. The RD and RT are auto + derived and should not be specified explicitly for either the source or destination VRF’s. +.. cfgcmd:: set vrf name <name> protocols bgp interface <interface> mpls + forwarding + + It is possible to permit BGP install VPN prefixes without transport labels. + This configuration will install VPN prefixes originated from an e-bgp session, + and with the next-hop directly connected. + .. _l3vpn-vrf example operation: Operation @@ -438,8 +528,8 @@ are in place. UN=10.0.0.10 EC{65035:1011} label=80 type=bgp, subtype=0 .. opcmd:: show bgp <ipv4|ipv6> vpn summary - - Print a summary of neighbor connections for the specified AFI/SAFI + + Print a summary of neighbor connections for the specified AFI/SAFI combination. .. code-block:: none |