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

[202012][topo_m0] Add new topo for mgmt tor router (#6208) #6285

Merged
merged 1 commit into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ansible/library/announce_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def wait_for_http(host_ip, http_port, timeout=10):


def get_topo_type(topo_name):
pattern = re.compile(r'^(t0|t1|ptf|fullmesh|dualtor|t2|mgmttor)')
pattern = re.compile(r'^(t0|t1|ptf|fullmesh|dualtor|t2|mgmttor|m0)')
match = pattern.match(topo_name)
if not match:
return "unsupported"
Expand Down Expand Up @@ -459,7 +459,7 @@ def main():
topo_type = get_topo_type(topo_name)

try:
if topo_type == "t0":
if topo_type == "t0" or topo_type == "m0":
fib_t0(topo, ptf_ip, no_default_route=is_storage_backend, action=action)
module.exit_json(changed=True)
elif topo_type == "t1":
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/eos/templates/m0-leaf.j2
134 changes: 134 additions & 0 deletions ansible/roles/eos/templates/m0-mx.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{% set host = configuration[hostname] %}
{% set mgmt_ip = ansible_host %}
{% if vm_type is defined and vm_type == "ceos" %}
{% set mgmt_if_index = 0 %}
{% else %}
{% set mgmt_if_index = 1 %}
{% endif %}
no schedule tech-support
!
{% if vm_type is defined and vm_type == "ceos" %}
agent LicenseManager shutdown
agent PowerFuse shutdown
agent PowerManager shutdown
agent Thermostat shutdown
agent LedPolicy shutdown
agent StandbyCpld shutdown
agent Bfd shutdown
{% endif %}
!
hostname {{ hostname }}
!
vrf definition MGMT
rd 1:1
!
spanning-tree mode mstp
!
aaa root secret 0 123456
!
username admin privilege 15 role network-admin secret 0 123456
!
clock timezone UTC
!
lldp run
lldp management-address Management{{ mgmt_if_index }}
lldp management-address vrf MGMT
!
snmp-server community {{ snmp_rocommunity }} ro
snmp-server vrf MGMT
!
ip routing
ip routing vrf MGMT
ipv6 unicast-routing
!
{% if vm_mgmt_gw is defined %}
ip route vrf MGMT 0.0.0.0/0 {{ vm_mgmt_gw }}
{% else %}
ip route vrf MGMT 0.0.0.0/0 {{ mgmt_gw }}
{% endif %}
!
interface Management {{ mgmt_if_index }}
description TO LAB MGMT SWITCH
{% if vm_type is defined and vm_type == "ceos" %}
vrf MGMT
{% else %}
vrf forwarding MGMT
{% endif %}
ip address {{ mgmt_ip }}/{{ mgmt_prefixlen }}
no shutdown
!
{% for name, iface in host['interfaces'].items() %}
interface {{ name }}
{% if name.startswith('Loopback') %}
description LOOPBACK
{% else %}
mtu 9214
no switchport
no shutdown
{% endif %}
{% if iface['ipv4'] is defined %}
ip address {{ iface['ipv4'] }}
{% endif %}
{% if iface['ipv6'] is defined %}
ipv6 enable
ipv6 address {{ iface['ipv6'] }}
ipv6 nd ra suppress
{% endif %}
no shutdown
!
{% endfor %}
!
interface {{ bp_ifname }}
description backplane
no switchport
no shutdown
{% if host['bp_interface']['ipv4'] is defined %}
ip address {{ host['bp_interface']['ipv4'] }}
{% endif %}
{% if host['bp_interface']['ipv6'] is defined %}
ipv6 enable
ipv6 address {{ host['bp_interface']['ipv6'] }}
ipv6 nd ra suppress
{% endif %}
no shutdown
!
router bgp {{ host['bgp']['asn'] }}
router-id {{ host['interfaces']['Loopback0']['ipv4'] | ipaddr('address') }}
!
graceful-restart restart-time {{ bgp_gr_timer }}
graceful-restart
!
{% for asn, remote_ips in host['bgp']['peers'].items() %}
{% for remote_ip in remote_ips %}
neighbor {{ remote_ip }} remote-as {{ asn }}
neighbor {{ remote_ip }} description {{ asn }}
{% if remote_ip | ipv6 %}
address-family ipv6
neighbor {{ remote_ip }} activate
exit
{% endif %}
{% endfor %}
{% endfor %}
neighbor {{ props.nhipv4 }} remote-as {{ host['bgp']['asn'] }}
neighbor {{ props.nhipv4 }} description exabgp_v4
neighbor {{ props.nhipv6 }} remote-as {{ host['bgp']['asn'] }}
neighbor {{ props.nhipv6 }} description exabgp_v6
address-family ipv6
neighbor {{ props.nhipv6 }} activate
exit
!
{% for name, iface in host['interfaces'].items() if name.startswith('Loopback') %}
{% if iface['ipv4'] is defined %}
network {{ iface['ipv4'] }}
{% endif %}
{% if iface['ipv6'] is defined %}
network {{ iface['ipv6'] }}
{% endif %}
{% endfor %}
!
management api http-commands
no protocol https
protocol http
no shutdown
!
end
4 changes: 4 additions & 0 deletions ansible/templates/minigraph_png.j2
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@
{% set dev_type = 'CoreRouter' %}
{% elif 'T0' in dev %}
{% set dev_type = 'ToRRouter' %}
{% elif 'M1' in dev %}
{% set dev_type = 'MgmtLeafRouter' %}
{% elif 'MX' in dev %}
{% set dev_type = 'BmcMgmtToRRouter' %}
{% else %}
{% set dev_ytpe = 'Unknown' %}
{% endif %}
Expand Down
Loading