[interfaces]: Add support for multiple IP interfaces on eth0#840
[interfaces]: Add support for multiple IP interfaces on eth0#840stcheng wants to merge 1 commit intosonic-net:masterfrom stcheng:interfaces
Conversation
There was a problem hiding this comment.
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.
is working on that
btw, does IPv6 have a gateway IP?
lguohan
left a comment
There was a problem hiding this comment.
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 <[email protected]>
Submodule src/sonic-utilities e9747899a..f431510ae: > [201811][intfutil] set speed to 0 when interface speed is not available (#840) Signed-off-by: Ying Xie <[email protected]>
…atically (sonic-net#840) #### Why I did it src/sonic-utilities ``` * d843a1ef - (HEAD -> 202412, origin/202412) [code sync] Merge code from sonic-net/sonic-utilities:202411 to 202412 (sonic-net#148) (21 hours ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
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.