November 2017
Intermediate to advanced
266 pages
5h 34m
English
When working with a multi-device environment, along with routers and switches we need to interact with other network gear(s) like wireless devices. This example will show how to configure a switch with specific ports to be connected to Access Point (AP) as trunk.
In our test case, assuming the VLANs configured on AP are vlan 100 and vlan 200 for users, and the native VLAN is vlan 10, and the code is as follows:
from netmiko import ConnectHandlerimport timedef apvlanpush(routerip,switchport): uname="cisco" passwd="cisco" device = ConnectHandler(device_type='cisco_ios', ip=routerip, username=uname, password=passwd) cmds="interface "+switchport cmds=cmds+"\nswitchport mode trunk\nswitchport trunk ...
Read now
Unlock full access