CISCO: Enhance sonic-config-engine to support L1 & L3 configurations#7368
CISCO: Enhance sonic-config-engine to support L1 & L3 configurations#7368VenkatCisco wants to merge 1 commit intosonic-net:masterfrom VenkatCisco:VenkatCisco/master/PR12_L1_L2_cfg
Conversation
| 'empty': generate_empty_config | ||
| 'empty': generate_empty_config, | ||
| 'l1': generate_l1_config, | ||
| 'l3': generate_l3_config |
There was a problem hiding this comment.
can you explain what is l1, l3 config and why we need them?
There was a problem hiding this comment.
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": {}} |
There was a problem hiding this comment.
can you remove those hardcoded 'type', 'bgp_asn' and 'LOOPBACK_INTERFACE'?
There was a problem hiding this comment.
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.
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)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)