Skip to content

CISCO: Enhance sonic-config-engine to support L1 & L3 configurations#7368

Closed
VenkatCisco wants to merge 1 commit intosonic-net:masterfrom
VenkatCisco:VenkatCisco/master/PR12_L1_L2_cfg
Closed

CISCO: Enhance sonic-config-engine to support L1 & L3 configurations#7368
VenkatCisco wants to merge 1 commit intosonic-net:masterfrom
VenkatCisco:VenkatCisco/master/PR12_L1_L2_cfg

Conversation

@VenkatCisco
Copy link
Contributor

Why I did it

This provides support for: #7074.

How I did it

Extend sonic-config-engine/config_samples.py to provide support for l1 & l3

How to verify it

Verify system bring up with L1 & L3 configuration

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

'empty': generate_empty_config
'empty': generate_empty_config,
'l1': generate_l1_config,
'l3': generate_l3_config
Copy link
Collaborator

@lguohan lguohan Apr 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain what is l1, l3 config and why we need them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L1 configuration generates only the default port admin_status and mtu values. This is minimally required configuration for any system interfaces to come up.

L2 configuration generates Vlan interface configuration. For instance the api generate_l2_config is generating Vlan1000 data port configuration. A "routed" system may not need a L2 configuration

def generate_l2_config(data):
data['VLAN'] = {'Vlan1000': {'vlanid': '1000'}}
data['VLAN_MEMBER'] = {}
for port in natsorted(data['PORT']):
data['PORT'][port].setdefault('admin_status', 'up')
data['VLAN_MEMBER']['Vlan1000|{}'.format(port)] = {'tagging_mode': 'untagged'}
return data

L3 generates "routed" configuration like, which are minimally required for configuring the system as a L3 device.

  • BGP ASN
  • Loopback IP
  • Dummy Interfaces

data['DEVICE_METADATA']['localhost']['type'] = 'LeafRouter'
data['DEVICE_METADATA']['localhost']['bgp_asn'] = '65100'
data['LOOPBACK_INTERFACE'] = {"Loopback0": {},
"Loopback0|10.1.0.1/32": {}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove those hardcoded 'type', 'bgp_asn' and 'LOOPBACK_INTERFACE'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-config-engine/config_samples.py
The new methods for L1 & L3 are just extensions to the existing methods and has the minimum set of parameters required for L1 & L3 System bringup.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracked thru #7637

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants