diff options
author | rebortg <github@ghlr.de> | 2020-11-29 21:32:45 +0100 |
---|---|---|
committer | rebortg <github@ghlr.de> | 2020-11-29 21:32:45 +0100 |
commit | e7f01e6efc8578603592ff86c031d46f1f1f9d82 (patch) | |
tree | e667f1e169c61fa48af0d84c87a6300989891d3a /docs | |
parent | bfb3814cd120d1bb661af26b3c55341f1697b397 (diff) | |
download | vyos-documentation-e7f01e6efc8578603592ff86c031d46f1f1f9d82.tar.gz vyos-documentation-e7f01e6efc8578603592ff86c031d46f1f1f9d82.zip |
arrange: nat, PBR, policy
Diffstat (limited to 'docs')
-rw-r--r-- | docs/configuration/nat/index.rst (renamed from docs/nat.rst) | 6 | ||||
-rw-r--r-- | docs/configuration/nat/nptv6.rst (renamed from docs/nptv6.rst) | 0 | ||||
-rw-r--r-- | docs/configuration/policy/index.rst (renamed from docs/routing/pbr.rst) | 68 | ||||
-rw-r--r-- | docs/routing/policy.rst | 65 |
4 files changed, 74 insertions, 65 deletions
diff --git a/docs/nat.rst b/docs/configuration/nat/index.rst index 17698c26..85bd41d5 100644 --- a/docs/nat.rst +++ b/docs/configuration/nat/index.rst @@ -4,6 +4,12 @@ NAT ### +.. toctree:: + :maxdepth: 1 + :includehidden: + + nptv6 + :abbr:`NAT (Network Address Translation)` is a common method of remapping one IP address space into another by modifying network address information in the IP header of packets while they are in transit across diff --git a/docs/nptv6.rst b/docs/configuration/nat/nptv6.rst index f4e08325..f4e08325 100644 --- a/docs/nptv6.rst +++ b/docs/configuration/nat/nptv6.rst diff --git a/docs/routing/pbr.rst b/docs/configuration/policy/index.rst index 7b0341cb..4be494e5 100644 --- a/docs/routing/pbr.rst +++ b/docs/configuration/policy/index.rst @@ -1,5 +1,72 @@ .. include:: ../_include/need_improvement.txt +###### +Policy +###### + +Routing Policies could be used to tell the router (self or neighbors) what +routes and their attributes needs to be put into the routing table. + +There could be a wide range of routing policies. Some examples are below: + +* Set some metric to routes learned from a particular neighbor +* Set some attributes (like AS PATH or Community value) to advertised routes to neighbors +* Prefer a specific routing protocol routes over another routing protocol running on the same router + +Example +======= + +**Policy definition:** + +.. code-block:: none + + # Create policy + set policy route-map setmet rule 2 action 'permit' + set policy route-map setmet rule 2 set as-path-prepend '2 2 2' + + # Apply policy to BGP + set protocols bgp 1 neighbor 203.0.113.2 address-family ipv4-unicast route-map import 'setmet' + set protocols bgp 1 neighbor 203.0.113.2 address-family ipv4-unicast soft-reconfiguration 'inbound' + +Using 'soft-reconfiguration' we get the policy update without bouncing the +neighbor. + +**Routes learned before routing policy applied:** + +.. code-block:: none + + vyos@vos1:~$ show ip bgp + BGP table version is 0, local router ID is 192.168.56.101 + Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, + r RIB-failure, S Stale, R Removed + Origin codes: i - IGP, e - EGP, ? - incomplete + + Network Next Hop Metric LocPrf Weight Path + *> 198.51.100.3/32 203.0.113.2 1 0 2 i < Path + + Total number of prefixes 1 + +**Routes learned after routing policy applied:** + +.. code-block:: none + + vyos@vos1:~$ sho ip b + BGP table version is 0, local router ID is 192.168.56.101 + Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, + r RIB-failure, S Stale, R Removed + Origin codes: i - IGP, e - EGP, ? - incomplete + + Network Next Hop Metric LocPrf Weight Path + *> 198.51.100.3/32 203.0.113.2 1 0 2 2 2 2 i + + Total number of prefixes 1 + vyos@vos1:~$ + +You now see the longer AS path. + + +.. include:: ../_include/need_improvement.txt + .. _routing-pbr: ### @@ -135,3 +202,4 @@ Add multiple source IP in one rule with same priority set policy local-route rule 101 source '192.0.1.254' set policy local-route rule 101 source '192.0.1.253' set policy local-route rule 101 source '203.0.113.0/24' + diff --git a/docs/routing/policy.rst b/docs/routing/policy.rst deleted file mode 100644 index 4eeb40d6..00000000 --- a/docs/routing/policy.rst +++ /dev/null @@ -1,65 +0,0 @@ -.. include:: ../_include/need_improvement.txt - -###### -Policy -###### - -Routing Policies could be used to tell the router (self or neighbors) what -routes and their attributes needs to be put into the routing table. - -There could be a wide range of routing policies. Some examples are below: - -* Set some metric to routes learned from a particular neighbor -* Set some attributes (like AS PATH or Community value) to advertised routes to neighbors -* Prefer a specific routing protocol routes over another routing protocol running on the same router - -Example -======= - -**Policy definition:** - -.. code-block:: none - - # Create policy - set policy route-map setmet rule 2 action 'permit' - set policy route-map setmet rule 2 set as-path-prepend '2 2 2' - - # Apply policy to BGP - set protocols bgp 1 neighbor 203.0.113.2 address-family ipv4-unicast route-map import 'setmet' - set protocols bgp 1 neighbor 203.0.113.2 address-family ipv4-unicast soft-reconfiguration 'inbound' - -Using 'soft-reconfiguration' we get the policy update without bouncing the -neighbor. - -**Routes learned before routing policy applied:** - -.. code-block:: none - - vyos@vos1:~$ show ip bgp - BGP table version is 0, local router ID is 192.168.56.101 - Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, - r RIB-failure, S Stale, R Removed - Origin codes: i - IGP, e - EGP, ? - incomplete - - Network Next Hop Metric LocPrf Weight Path - *> 198.51.100.3/32 203.0.113.2 1 0 2 i < Path - - Total number of prefixes 1 - -**Routes learned after routing policy applied:** - -.. code-block:: none - - vyos@vos1:~$ sho ip b - BGP table version is 0, local router ID is 192.168.56.101 - Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, - r RIB-failure, S Stale, R Removed - Origin codes: i - IGP, e - EGP, ? - incomplete - - Network Next Hop Metric LocPrf Weight Path - *> 198.51.100.3/32 203.0.113.2 1 0 2 2 2 2 i - - Total number of prefixes 1 - vyos@vos1:~$ - -You now see the longer AS path. |