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

[interfaces]: Add support for multiple IP interfaces on eth0 #840

Closed
wants to merge 1 commit into from
Closed

[interfaces]: Add support for multiple IP interfaces on eth0 #840

wants to merge 1 commit into from

Conversation

stcheng
Copy link
Contributor

@stcheng stcheng commented Jul 25, 2017

  • 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.

@@ -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 %}
Copy link
Collaborator

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 + '"'
'''

Copy link
Contributor Author

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?

Copy link
Collaborator

@lguohan lguohan left a 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.
@stcheng
Copy link
Contributor Author

stcheng commented Jul 25, 2017

another question, are we using only ipv4 for ntp/snmp?

@stcheng stcheng closed this Jul 25, 2017
@stcheng
Copy link
Contributor Author

stcheng commented Jul 25, 2017

i'll close this pull request. maybe it's better to keep the previous attribute name and just add a new ipv6 one.

@lguohan
Copy link
Collaborator

lguohan commented Jul 25, 2017

let just ignore v6 mgmt. ip in case minigraph has it. Just need to deal with v4 good now.

yxieca added a commit to yxieca/sonic-buildimage that referenced this pull request Mar 19, 2020
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>
lguohan pushed a commit that referenced this pull request Mar 20, 2020
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants