Created
January 16, 2023 15:00
-
-
Save devinci-it/f2b526975aed24ad9968dc0abffb93a5 to your computer and use it in GitHub Desktop.
Generate BASIC LACP configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def config_lacp(base,port_range,channel_group_id,mode): | |
| """ | |
| CONFIG BASIC ETHERCHANNEL-LACP | |
| :param base: "G1/0/" | |
| :param port_range: "0-2,5-6" | |
| :param channel_group_id: 1 | |
| :return: str | |
| """ | |
| base:str | |
| port_range:str | |
| channel_group_id:int | |
| config = f""" | |
| interface range {base}{port_range} | |
| no shutdown | |
| speed 1000 | |
| switchport mode trunk | |
| channel-group {channel_group_id} mode active | |
| """ | |
| return config | |
| #print(config_lacp("G1/0/","3-4",1,"active")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment