Set preference for forced mgmt routes (#5844)
When forced mgmt routes are present, the issue fixed as part of #5754 is not complete. Added a preference(priority) field to forced mgmt route ip rules
This commit is contained in:
parent
2b41f6bd5c
commit
1eaaf64ed2
@ -80,14 +80,14 @@ iface eth0 {{ 'inet' if prefix | ipv4 else 'inet6' }} static
|
|||||||
up ip {{ '-4' if prefix | ipv4 else '-6' }} route add {{ prefix | network }}/{{ prefix | prefixlen }} dev eth0 table {{ vrf_table }}
|
up ip {{ '-4' if prefix | ipv4 else '-6' }} route add {{ prefix | network }}/{{ prefix | prefixlen }} dev eth0 table {{ vrf_table }}
|
||||||
up ip {{ '-4' if prefix | ipv4 else '-6' }} rule add pref 32765 from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table {{ vrf_table }}
|
up ip {{ '-4' if prefix | ipv4 else '-6' }} rule add pref 32765 from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table {{ vrf_table }}
|
||||||
{% for route in MGMT_INTERFACE[(name, prefix)]['forced_mgmt_routes'] %}
|
{% for route in MGMT_INTERFACE[(name, prefix)]['forced_mgmt_routes'] %}
|
||||||
up ip rule add to {{ route }} table {{ vrf_table }}
|
up ip rule add pref 32764 to {{ route }} table {{ vrf_table }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
# management port down rules
|
# management port down rules
|
||||||
pre-down ip {{ '-4' if prefix | ipv4 else '-6' }} route delete default via {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} dev eth0 table {{ vrf_table }}
|
pre-down ip {{ '-4' if prefix | ipv4 else '-6' }} route delete default via {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} dev eth0 table {{ vrf_table }}
|
||||||
pre-down ip {{ '-4' if prefix | ipv4 else '-6' }} route delete {{ prefix | network }}/{{ prefix | prefixlen }} dev eth0 table {{ vrf_table }}
|
pre-down ip {{ '-4' if prefix | ipv4 else '-6' }} route delete {{ prefix | network }}/{{ prefix | prefixlen }} dev eth0 table {{ vrf_table }}
|
||||||
pre-down ip {{ '-4' if prefix | ipv4 else '-6' }} rule delete pref 32765 from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table {{ vrf_table }}
|
pre-down ip {{ '-4' if prefix | ipv4 else '-6' }} rule delete pref 32765 from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table {{ vrf_table }}
|
||||||
{% for route in MGMT_INTERFACE[(name, prefix)]['forced_mgmt_routes'] %}
|
{% for route in MGMT_INTERFACE[(name, prefix)]['forced_mgmt_routes'] %}
|
||||||
pre-down ip rule delete to {{ route }} table {{ vrf_table }}
|
pre-down ip rule delete pref 32764 to {{ route }} table {{ vrf_table }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{# TODO: COPP policy type rules #}
|
{# TODO: COPP policy type rules #}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -32,10 +32,14 @@ iface eth0 inet static
|
|||||||
up ip -4 route add default via 10.0.0.1 dev eth0 table 5000 metric 201
|
up ip -4 route add default via 10.0.0.1 dev eth0 table 5000 metric 201
|
||||||
up ip -4 route add 10.0.0.0/24 dev eth0 table 5000
|
up ip -4 route add 10.0.0.0/24 dev eth0 table 5000
|
||||||
up ip -4 rule add pref 32765 from 10.0.0.100/32 table 5000
|
up ip -4 rule add pref 32765 from 10.0.0.100/32 table 5000
|
||||||
|
up ip rule add pref 32764 to 11.11.11.11 table 5000
|
||||||
|
up ip rule add pref 32764 to 22.22.22.0/23 table 5000
|
||||||
# management port down rules
|
# management port down rules
|
||||||
pre-down ip -4 route delete default via 10.0.0.1 dev eth0 table 5000
|
pre-down ip -4 route delete default via 10.0.0.1 dev eth0 table 5000
|
||||||
pre-down ip -4 route delete 10.0.0.0/24 dev eth0 table 5000
|
pre-down ip -4 route delete 10.0.0.0/24 dev eth0 table 5000
|
||||||
pre-down ip -4 rule delete pref 32765 from 10.0.0.100/32 table 5000
|
pre-down ip -4 rule delete pref 32765 from 10.0.0.100/32 table 5000
|
||||||
|
pre-down ip rule delete pref 32764 to 11.11.11.11 table 5000
|
||||||
|
pre-down ip rule delete pref 32764 to 22.22.22.0/23 table 5000
|
||||||
iface eth0 inet6 static
|
iface eth0 inet6 static
|
||||||
address 2603:10e2:0:2902::8
|
address 2603:10e2:0:2902::8
|
||||||
netmask 64
|
netmask 64
|
||||||
|
@ -32,10 +32,14 @@ iface eth0 inet static
|
|||||||
up ip -4 route add default via 10.0.0.1 dev eth0 table 5000 metric 201
|
up ip -4 route add default via 10.0.0.1 dev eth0 table 5000 metric 201
|
||||||
up ip -4 route add 10.0.0.0/24 dev eth0 table 5000
|
up ip -4 route add 10.0.0.0/24 dev eth0 table 5000
|
||||||
up ip -4 rule add pref 32765 from 10.0.0.100/32 table 5000
|
up ip -4 rule add pref 32765 from 10.0.0.100/32 table 5000
|
||||||
|
up ip rule add pref 32764 to 11.11.11.11 table 5000
|
||||||
|
up ip rule add pref 32764 to 22.22.22.0/23 table 5000
|
||||||
# management port down rules
|
# management port down rules
|
||||||
pre-down ip -4 route delete default via 10.0.0.1 dev eth0 table 5000
|
pre-down ip -4 route delete default via 10.0.0.1 dev eth0 table 5000
|
||||||
pre-down ip -4 route delete 10.0.0.0/24 dev eth0 table 5000
|
pre-down ip -4 route delete 10.0.0.0/24 dev eth0 table 5000
|
||||||
pre-down ip -4 rule delete pref 32765 from 10.0.0.100/32 table 5000
|
pre-down ip -4 rule delete pref 32765 from 10.0.0.100/32 table 5000
|
||||||
|
pre-down ip rule delete pref 32764 to 11.11.11.11 table 5000
|
||||||
|
pre-down ip rule delete pref 32764 to 22.22.22.0/23 table 5000
|
||||||
iface eth0 inet6 static
|
iface eth0 inet6 static
|
||||||
address 2603:10e2:0:2902::8
|
address 2603:10e2:0:2902::8
|
||||||
netmask 64
|
netmask 64
|
||||||
|
@ -393,6 +393,11 @@
|
|||||||
<a:DeviceMetadata>
|
<a:DeviceMetadata>
|
||||||
<a:Name>switch-t0</a:Name>
|
<a:Name>switch-t0</a:Name>
|
||||||
<a:Properties>
|
<a:Properties>
|
||||||
|
<a:DeviceProperty>
|
||||||
|
<a:Name>ForcedMgmtRoutes</a:Name>
|
||||||
|
<a:Reference i:nil="true"/>
|
||||||
|
<a:Value>11.11.11.11;22.22.22.0/23</a:Value>
|
||||||
|
</a:DeviceProperty>
|
||||||
<a:DeviceProperty>
|
<a:DeviceProperty>
|
||||||
<a:Name>ErspanDestinationIpv4</a:Name>
|
<a:Name>ErspanDestinationIpv4</a:Name>
|
||||||
<a:Reference i:nil="true"/>
|
<a:Reference i:nil="true"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user