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

[201911] Create Vxlan and Vnet default configs #13403

Merged
merged 4 commits into from
Feb 2, 2023
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
24 changes: 24 additions & 0 deletions src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,28 @@ def parse_spine_chassis_fe(results, vni, lo_intfs, phyport_intfs, pc_intfs, pc_m
# Enslave the port channel interface to a Vnet
pc_intfs[pc_intf] = {'vnet_name': chassis_vnet}

def parse_default_vxlan_decap(results, vni, lo_intfs):
vnet ='Vnet-default'
vxlan_tunnel = 'tunnel_v4'

# Vxlan tunnel information
lo_addr = '0.0.0.0'
for lo in lo_intfs:
lo_network = ipaddress.IPNetwork(lo[1])
if lo_network.version == 4:
lo_addr = str(lo_network.ip)
break
results['VXLAN_TUNNEL'] = {vxlan_tunnel: {
'src_ip': lo_addr
}}

# Vnet information
results['VNET'] = {vnet: {
'vxlan_tunnel': vxlan_tunnel,
'scope': "default",
'vni': vni
}}

###############################################################################
#
# Post-processing functions
Expand Down Expand Up @@ -1051,6 +1073,8 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None):
results['DEVICE_METADATA']['localhost']['downstream_subrole'] = downstream_subrole
if resource_type is not None:
results['DEVICE_METADATA']['localhost']['resource_type'] = resource_type
if 'Appliance' in resource_type:
parse_default_vxlan_decap(results, vni_default, lo_intfs)

results['BGP_NEIGHBOR'] = bgp_sessions
results['BGP_MONITORS'] = bgp_monitors
Expand Down
Loading