[mgmt ip]: mvrf ip rule priority change to 32765 (#5754)
Fix Azure/SONiC#551 When eth0 IP address is configured, an ip rule is getting added for eth0 IP address through the interfaces.j2 template. This eth0 ip rule creates an issue when VRF (data VRF or management VRF) is also created in the system. When any VRF (data VRF or management VRF) is created, a new rule is getting added automatically by kernel as "1000: from all lookup [l3mdev-table]". This l3mdev IP rule is never getting deleted even if VRF is deleted. Once if this l3mdev IP rule is added, if user configures IP address for the eth0 interface, interfaces.j2 adds an eth0 IP rule as "1000:from 100.104.47.74 lookup default ". Priority 1000 is automatically chosen by kernel and hence this rule gets higher priority than the already existing rule "1001:from all lookup local ". This results in an issue "ping from console to eth0 IP does not work once if VRF is created" as explained in Issue 551. More details and possible solutions are explained as comments in the Issue551. This PR is to resolve the issue by always fixing the low priority 32765 for the IP rule that is created for the eth0 IP address. Tested with various combinations of VRF creation, deletion and IP address configuration along with ping from console to eth0 IP address. Co-authored-by: Kannan KVS <kannan_kvs@dell.com>
This commit is contained in:
parent
908787d2a2
commit
c8a00eda95
@ -78,14 +78,14 @@ iface eth0 {{ 'inet' if prefix | ipv4 else 'inet6' }} static
|
|||||||
# management port up rules
|
# management port up rules
|
||||||
up ip {{ '-4' if prefix | ipv4 else '-6' }} route add default via {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} dev eth0 table {{ vrf_table }} metric 201
|
up ip {{ '-4' if prefix | ipv4 else '-6' }} route add default via {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} dev eth0 table {{ vrf_table }} metric 201
|
||||||
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 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 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 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 to {{ route }} table {{ vrf_table }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -21,11 +21,11 @@ iface eth0 inet static
|
|||||||
# management port up rules
|
# management port up rules
|
||||||
up ip -4 route add default via 10.0.0.1 dev eth0 table default metric 201
|
up ip -4 route add default via 10.0.0.1 dev eth0 table default metric 201
|
||||||
up ip -4 route add 10.0.0.0/24 dev eth0 table default
|
up ip -4 route add 10.0.0.0/24 dev eth0 table default
|
||||||
up ip -4 rule add from 10.0.0.100/32 table default
|
up ip -4 rule add pref 32765 from 10.0.0.100/32 table default
|
||||||
# management port down rules
|
# management port down rules
|
||||||
pre-down ip -4 route delete default via 10.0.0.1 dev eth0 table default
|
pre-down ip -4 route delete default via 10.0.0.1 dev eth0 table default
|
||||||
pre-down ip -4 route delete 10.0.0.0/24 dev eth0 table default
|
pre-down ip -4 route delete 10.0.0.0/24 dev eth0 table default
|
||||||
pre-down ip -4 rule delete from 10.0.0.100/32 table default
|
pre-down ip -4 rule delete pref 32765 from 10.0.0.100/32 table default
|
||||||
iface eth0 inet6 static
|
iface eth0 inet6 static
|
||||||
address 2603:10e2:0:2902::8
|
address 2603:10e2:0:2902::8
|
||||||
netmask 64
|
netmask 64
|
||||||
@ -35,11 +35,11 @@ iface eth0 inet6 static
|
|||||||
# management port up rules
|
# management port up rules
|
||||||
up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table default metric 201
|
up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table default metric 201
|
||||||
up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table default
|
up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table default
|
||||||
up ip -6 rule add from 2603:10e2:0:2902::8/128 table default
|
up ip -6 rule add pref 32765 from 2603:10e2:0:2902::8/128 table default
|
||||||
# management port down rules
|
# management port down rules
|
||||||
pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table default
|
pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table default
|
||||||
pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table default
|
pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table default
|
||||||
pre-down ip -6 rule delete from 2603:10e2:0:2902::8/128 table default
|
pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:2902::8/128 table default
|
||||||
#
|
#
|
||||||
source /etc/network/interfaces.d/*
|
source /etc/network/interfaces.d/*
|
||||||
#
|
#
|
||||||
|
@ -31,11 +31,11 @@ iface eth0 inet static
|
|||||||
# management port up rules
|
# management port up rules
|
||||||
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 from 10.0.0.100/32 table 5000
|
up ip -4 rule add pref 32765 from 10.0.0.100/32 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 from 10.0.0.100/32 table 5000
|
pre-down ip -4 rule delete pref 32765 from 10.0.0.100/32 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
|
||||||
@ -46,11 +46,11 @@ iface eth0 inet6 static
|
|||||||
# management port up rules
|
# management port up rules
|
||||||
up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table 5000 metric 201
|
up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table 5000 metric 201
|
||||||
up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table 5000
|
up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table 5000
|
||||||
up ip -6 rule add from 2603:10e2:0:2902::8/128 table 5000
|
up ip -6 rule add pref 32765 from 2603:10e2:0:2902::8/128 table 5000
|
||||||
# management port down rules
|
# management port down rules
|
||||||
pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table 5000
|
pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table 5000
|
||||||
pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table 5000
|
pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table 5000
|
||||||
pre-down ip -6 rule delete from 2603:10e2:0:2902::8/128 table 5000
|
pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:2902::8/128 table 5000
|
||||||
#
|
#
|
||||||
source /etc/network/interfaces.d/*
|
source /etc/network/interfaces.d/*
|
||||||
#
|
#
|
||||||
|
@ -21,11 +21,11 @@ iface eth0 inet static
|
|||||||
# management port up rules
|
# management port up rules
|
||||||
up ip -4 route add default via 10.0.0.1 dev eth0 table default metric 201
|
up ip -4 route add default via 10.0.0.1 dev eth0 table default metric 201
|
||||||
up ip -4 route add 10.0.0.0/24 dev eth0 table default
|
up ip -4 route add 10.0.0.0/24 dev eth0 table default
|
||||||
up ip -4 rule add from 10.0.0.100/32 table default
|
up ip -4 rule add pref 32765 from 10.0.0.100/32 table default
|
||||||
# management port down rules
|
# management port down rules
|
||||||
pre-down ip -4 route delete default via 10.0.0.1 dev eth0 table default
|
pre-down ip -4 route delete default via 10.0.0.1 dev eth0 table default
|
||||||
pre-down ip -4 route delete 10.0.0.0/24 dev eth0 table default
|
pre-down ip -4 route delete 10.0.0.0/24 dev eth0 table default
|
||||||
pre-down ip -4 rule delete from 10.0.0.100/32 table default
|
pre-down ip -4 rule delete pref 32765 from 10.0.0.100/32 table default
|
||||||
iface eth0 inet6 static
|
iface eth0 inet6 static
|
||||||
address 2603:10e2:0:2902::8
|
address 2603:10e2:0:2902::8
|
||||||
netmask 64
|
netmask 64
|
||||||
@ -35,11 +35,11 @@ iface eth0 inet6 static
|
|||||||
# management port up rules
|
# management port up rules
|
||||||
up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table default metric 201
|
up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table default metric 201
|
||||||
up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table default
|
up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table default
|
||||||
up ip -6 rule add from 2603:10e2:0:2902::8/128 table default
|
up ip -6 rule add pref 32765 from 2603:10e2:0:2902::8/128 table default
|
||||||
# management port down rules
|
# management port down rules
|
||||||
pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table default
|
pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table default
|
||||||
pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table default
|
pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table default
|
||||||
pre-down ip -6 rule delete from 2603:10e2:0:2902::8/128 table default
|
pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:2902::8/128 table default
|
||||||
#
|
#
|
||||||
source /etc/network/interfaces.d/*
|
source /etc/network/interfaces.d/*
|
||||||
#
|
#
|
||||||
|
@ -31,11 +31,11 @@ iface eth0 inet static
|
|||||||
# management port up rules
|
# management port up rules
|
||||||
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 from 10.0.0.100/32 table 5000
|
up ip -4 rule add pref 32765 from 10.0.0.100/32 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 from 10.0.0.100/32 table 5000
|
pre-down ip -4 rule delete pref 32765 from 10.0.0.100/32 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
|
||||||
@ -46,11 +46,11 @@ iface eth0 inet6 static
|
|||||||
# management port up rules
|
# management port up rules
|
||||||
up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table 5000 metric 201
|
up ip -6 route add default via 2603:10e2:0:2902::1 dev eth0 table 5000 metric 201
|
||||||
up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table 5000
|
up ip -6 route add 2603:10e2:0:2902::/64 dev eth0 table 5000
|
||||||
up ip -6 rule add from 2603:10e2:0:2902::8/128 table 5000
|
up ip -6 rule add pref 32765 from 2603:10e2:0:2902::8/128 table 5000
|
||||||
# management port down rules
|
# management port down rules
|
||||||
pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table 5000
|
pre-down ip -6 route delete default via 2603:10e2:0:2902::1 dev eth0 table 5000
|
||||||
pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table 5000
|
pre-down ip -6 route delete 2603:10e2:0:2902::/64 dev eth0 table 5000
|
||||||
pre-down ip -6 rule delete from 2603:10e2:0:2902::8/128 table 5000
|
pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:2902::8/128 table 5000
|
||||||
#
|
#
|
||||||
source /etc/network/interfaces.d/*
|
source /etc/network/interfaces.d/*
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user