diff --git a/files/image_config/interfaces/interfaces.j2 b/files/image_config/interfaces/interfaces.j2 index dbedd5e9418a..1136c0970db0 100644 --- a/files/image_config/interfaces/interfaces.j2 +++ b/files/image_config/interfaces/interfaces.j2 @@ -13,7 +13,7 @@ iface mgmt # The loopback network interface for mgmt VRF that is required for applications like NTP up ip link add lo-m type dummy up ip link set dev lo-m master mgmt - up ip addr add 127.0.0.1/8 dev lo-m + up ip addr add 127.0.0.1/16 dev lo-m up ip link set lo-m up down ip link delete dev lo-m {% endif %} @@ -22,6 +22,9 @@ iface mgmt # The loopback network interface auto lo iface lo inet loopback + address 127.0.0.1 + netmask 255.255.0.0 + post-up ip addr del 127.0.0.1/8 dev lo {% endblock loopback %} {% block mgmt_interface %} diff --git a/src/sonic-config-engine/tests/sample_output/interfaces b/src/sonic-config-engine/tests/sample_output/interfaces index 07fd7a522c3b..f5929119703c 100644 --- a/src/sonic-config-engine/tests/sample_output/interfaces +++ b/src/sonic-config-engine/tests/sample_output/interfaces @@ -6,6 +6,9 @@ # The loopback network interface auto lo iface lo inet loopback + address 127.0.0.1 + netmask 255.255.0.0 + post-up ip addr del 127.0.0.1/8 dev lo # The management network interface auto eth0 diff --git a/src/sonic-config-engine/tests/sample_output/mvrf_interfaces b/src/sonic-config-engine/tests/sample_output/mvrf_interfaces index 085f5111c3f5..49d307aa2df7 100644 --- a/src/sonic-config-engine/tests/sample_output/mvrf_interfaces +++ b/src/sonic-config-engine/tests/sample_output/mvrf_interfaces @@ -9,12 +9,15 @@ iface mgmt # The loopback network interface for mgmt VRF that is required for applications like NTP up ip link add lo-m type dummy up ip link set dev lo-m master mgmt - up ip addr add 127.0.0.1/8 dev lo-m + up ip addr add 127.0.0.1/16 dev lo-m up ip link set lo-m up down ip link delete dev lo-m # The loopback network interface auto lo iface lo inet loopback + address 127.0.0.1 + netmask 255.255.0.0 + post-up ip addr del 127.0.0.1/8 dev lo # The management network interface auto eth0