Skip to content

Instantly share code, notes, and snippets.

@devinci-it
Created January 16, 2023 15:00
Show Gist options
  • Select an option

  • Save devinci-it/f2b526975aed24ad9968dc0abffb93a5 to your computer and use it in GitHub Desktop.

Select an option

Save devinci-it/f2b526975aed24ad9968dc0abffb93a5 to your computer and use it in GitHub Desktop.
Generate BASIC LACP configuration.
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