# Setting it to any other value will cause "shut" to be configured on # the interface INTERFACE_STATE = "no shut" if __name__ == "__main__": if not INTERFACE_NAME: print("The interface name is required") sys.exit(-1) # Instantiate an interface object INTERFACE = Interface(INTERFACE_NAME) print("Before changing the interface configuration") print(INTERFACE.config()) # Configure "no switchport" so the interface is L3 INTERFACE.set_switchport(no=True) # Set an IP address on the interface if INTERFACE_IP_ADDRESS != "": INTERFACE.set_ipaddress(INTERFACE_IP_ADDRESS) # Set the description on the interface INTERFACE.set_description(INTERFACE_DESCRIPTION) # Set the interface state INTERFACE.set_state(INTERFACE_STATE) print("After changing the interface configuration") print(INTERFACE.config())