From 65cb10714c26f617d4808929584b80099dc5948a Mon Sep 17 00:00:00 2001 From: Abhishek Dosi Date: Sun, 1 Nov 2020 10:37:16 -0800 Subject: [PATCH] Revert "[mgmt ip]: mvrf ip rule priority change to 32765 (#5754)" This reverts commit 28366cd0ce14736e09845f50938961d360a023a3. --- files/image_config/interfaces/interfaces.j2 | 4 ++-- src/sonic-config-engine/tests/sample_output/interfaces | 8 ++++---- .../tests/sample_output/mvrf_interfaces | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/files/image_config/interfaces/interfaces.j2 b/files/image_config/interfaces/interfaces.j2 index 9782dd35669d..dbb2b1f3418a 100644 --- a/files/image_config/interfaces/interfaces.j2 +++ b/files/image_config/interfaces/interfaces.j2 @@ -73,7 +73,7 @@ iface eth0 {{ 'inet' if prefix | ipv4 else 'inet6' }} static # 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 {{ 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 from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table {{ vrf_table }} {% if (MGMT_VRF_CONFIG) and (MGMT_VRF_CONFIG['vrf_global']['mgmtVrfEnabled'] == "true") %} up cgcreate -g l3mdev:mgmt up cgset -r l3mdev.master-device=mgmt mgmt @@ -84,7 +84,7 @@ iface eth0 {{ 'inet' if prefix | ipv4 else 'inet6' }} static # 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 {{ 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 from {{ prefix | ip }}/{{ '32' if prefix | ipv4 else '128' }} table {{ vrf_table }} {% if (MGMT_VRF_CONFIG) and (MGMT_VRF_CONFIG['vrf_global']['mgmtVrfEnabled'] == "true") %} down cgdelete -g l3mdev:mgmt {% endif %} diff --git a/src/sonic-config-engine/tests/sample_output/interfaces b/src/sonic-config-engine/tests/sample_output/interfaces index 3b4935ff5189..913fc8531443 100644 --- a/src/sonic-config-engine/tests/sample_output/interfaces +++ b/src/sonic-config-engine/tests/sample_output/interfaces @@ -16,11 +16,11 @@ iface eth0 inet static # 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 10.0.0.0/24 dev eth0 table default - up ip -4 rule add pref 32765 from 10.0.0.100/32 table default + up ip -4 rule add from 10.0.0.100/32 table default # 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 10.0.0.0/24 dev eth0 table default - pre-down ip -4 rule delete pref 32765 from 10.0.0.100/32 table default + pre-down ip -4 rule delete from 10.0.0.100/32 table default iface eth0 inet6 static address 2603:10e2:0:2902::8 netmask 64 @@ -28,11 +28,11 @@ iface eth0 inet6 static # 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 2603:10e2:0:2902::/64 dev eth0 table default - up ip -6 rule add pref 32765 from 2603:10e2:0:2902::8/128 table default + up ip -6 rule add from 2603:10e2:0:2902::8/128 table default # 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 2603:10e2:0:2902::/64 dev eth0 table default - pre-down ip -6 rule delete pref 32765 from 2603:10e2:0:2902::8/128 table default + pre-down ip -6 rule delete from 2603:10e2:0:2902::8/128 table default # source /etc/network/interfaces.d/* # diff --git a/src/sonic-config-engine/tests/sample_output/mvrf_interfaces b/src/sonic-config-engine/tests/sample_output/mvrf_interfaces index 1aded59cd81e..7bd664d4a9db 100644 --- a/src/sonic-config-engine/tests/sample_output/mvrf_interfaces +++ b/src/sonic-config-engine/tests/sample_output/mvrf_interfaces @@ -26,7 +26,7 @@ iface eth0 inet static # 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 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 from 10.0.0.100/32 table 5000 up cgcreate -g l3mdev:mgmt up cgset -r l3mdev.master-device=mgmt mgmt # management port down rules @@ -42,7 +42,7 @@ iface eth0 inet6 static # 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 2603:10e2:0:2902::/64 dev eth0 table 5000 - up ip -6 rule add pref 32765 from 2603:10e2:0:2902::8/128 table 5000 + up ip -6 rule add from 2603:10e2:0:2902::8/128 table 5000 up cgcreate -g l3mdev:mgmt up cgset -r l3mdev.master-device=mgmt mgmt # management port down rules