Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move loopback configuration to intfMgrd #3044

Closed
wants to merge 11 commits into from
7 changes: 0 additions & 7 deletions files/image_config/interfaces/interfaces.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
# The loopback network interface
auto lo
iface lo inet loopback
# Use command 'ip addr list dev lo' to check all addresses
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tylerlinp @prsunny Any reason why the approach used for mgmt i/f being in the vrf can't be followed for lo? Not even sure that lo should be allowed to be in a vrf. How will redis work if lo is in a vrf?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tylerlinp @prsunny Any reason why the approach used for mgmt i/f being in the vrf can't be followed for lo? Not even sure that lo should be allowed to be in a vrf. How will redis work if lo is in a vrf?

All loopback interfaces map to device lo, that cause conflict when loopbacks belong to differents vrfs. I think lo shouldn't be add to a vrf, even though kernel don't restrict doing so. Some process which communicates locally may be affected. It is good to add a device for every loopback interface(LoopbackXXX), then lo keep original function. Then LoopbackXXX is add vrf/ip just like other l3 interface.

Copy link
Collaborator

@nikos-github nikos-github Jul 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I understand the issue. However, you are taking away the ability to further statically configure lo with this change. The right approach to follow would be to leave lo configuration where it is and make sure other loopbacks don't map to the same loopback device.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I understand the issue. However, you are taking away the ability to further statically configure lo with this change. The right approach to follow would be to leave lo configuration where it is and make sure other loopbacks don't map to the same loopback device.

What configuration do you mean? The ip addresses only config to kernel? If not add to ASIC, I think the addresses except 127.x.x.x & ::1 would be useless. If truely needed, maybe should filter configuration like LOOPBACK_INTERFACE|lo|1.1.1.1/32 and then add to interfaces.

{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
iface lo {{ 'inet' if prefix | ipv4 else 'inet6' }} static
address {{ prefix | ip }}
netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }}
#
{% endfor %}
{% endblock loopback %}
{% block mgmt_interface %}

Expand Down
13 changes: 0 additions & 13 deletions src/sonic-config-engine/tests/sample_output/interfaces
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@
# The loopback network interface
auto lo
iface lo inet loopback
# Use command 'ip addr list dev lo' to check all addresses
iface lo inet static
address 10.1.0.32
netmask 255.255.255.255
#
iface lo inet6 static
address fc00:1::32
netmask 128
#
iface lo inet static
address 10.10.0.99
netmask 255.255.255.255
#

# The management network interface
auto eth0
Expand Down