-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[interfaces]: Add support for multiple IP interfaces on eth0 #840
Conversation
@@ -20,11 +20,13 @@ iface lo {{ 'inet' if minigraph_lo_interface['addr'] | ipv4 else 'inet6' }} stat | |||
{% block mgmt_interface %} | |||
# The management network interface | |||
auto eth0 | |||
{% if minigraph_mgmt_interface['addr'] %} | |||
{% if minigraph_mgmt_interfaces | length %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are quite a few other places using minigraph_mgmt_interface, need to change as well
'''
lgh@lgh-issaquah:/data/sonic/sonic-buildimage$ git grep minigraph_mgmt_interface
dockers/docker-fpm-frr/zebra.conf.j2:ip route 0.0.0.0/0 {{ minigraph_mgmt_interface['gwaddr'] }} 200
dockers/docker-fpm-gobgp/zebra.conf.j2:ip route 0.0.0.0/0 {{ minigraph_mgmt_interface['gwaddr'] }} 200
dockers/docker-fpm-quagga/zebra.conf.j2:ip route 0.0.0.0/0 {{ minigraph_mgmt_interface['gwaddr'] }} 200
dockers/docker-snmp-sv2/snmpd.conf.j2:{% if minigraph_mgmt_interface.addr | ipv4 %}
dockers/docker-snmp-sv2/snmpd.conf.j2:agentAddress udp:{{ minigraph_mgmt_interface.addr }}:161
files/image_config/interfaces/interfaces.j2:{% if minigraph_mgmt_interface['addr'] %}
files/image_config/interfaces/interfaces.j2: address {{ minigraph_mgmt_interface['addr'] }}
files/image_config/interfaces/interfaces.j2: netmask {{ minigraph_mgmt_interface['mask'] }}
files/image_config/interfaces/interfaces.j2: up ip route add default via {{ minigraph_mgmt_interface['gwaddr'] }} dev eth0 table default
files/image_config/interfaces/interfaces.j2: up ip rule add from {{ minigraph_mgmt_interface['addr'] }}/32 table default
files/image_config/interfaces/interfaces.j2: down ip route delete default via {{ minigraph_mgmt_interface['gwaddr'] }} dev eth0 table default
files/image_config/interfaces/interfaces.j2: down ip rule delete from {{ minigraph_mgmt_interface['addr'] }}/32 table default
files/image_config/ntp/ntp.conf.j2:interface listen {{ minigraph_mgmt_interface.addr }}
src/sonic-config-engine/minigraph.py: results['minigraph_mgmt_interface'] = mgmt_intf
src/sonic-config-engine/minigraph.py: results['minigraph_mgmt_interface'] = mgmt_intf
src/sonic-config-engine/tests/test_cfggen.py: argument = '-v "minigraph_mgmt_interface['addr']" -M "' + self.sample_device_desc + '"'
'''
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is working on that
btw, does IPv6 have a gateway IP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minigraph_mgmt_interface is used in many places in the image.
- In minigraph.py, add general logic for parsing both loopback IP interfaces and management IP interfaces. Add support for both IPv4 and IPv6 interfaces on management interface. - Update interfaces.j2 template and the corresponding test and sample output.
another question, are we using only ipv4 for ntp/snmp? |
i'll close this pull request. maybe it's better to keep the previous attribute name and just add a new ipv6 one. |
let just ignore v6 mgmt. ip in case minigraph has it. Just need to deal with v4 good now. |
Submodule src/sonic-utilities e9747899a..f431510ae: > [201811][intfutil] set speed to 0 when interface speed is not available (sonic-net#840) Signed-off-by: Ying Xie <ying.xie@microsoft.com>
Submodule src/sonic-utilities e9747899a..f431510ae: > [201811][intfutil] set speed to 0 when interface speed is not available (#840) Signed-off-by: Ying Xie <ying.xie@microsoft.com>
In minigraph.py, add general logic for parsing both loopback IP interfaces
and management IP interfaces. Add support for both IPv4 and IPv6 interfaces
on management interface.
Update interfaces.j2 template and the corresponding test and sample output.