Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get trunk port
#1
Hi, I am creating a code to creat vlan and find the trunk port on a Avaya switch.
So i am wondering how do i get only the trunk ports and adds to get members vlan.

show autotopology nmm-table
LSlot RSlot
LPort IP Addr Seg ID MAC Addr Chassis Type BT LS CS RPort
----- --------------- -------- ------------ ---------------- -- --- ---- -----
0/ 0 XXXXXXXXXX XXXXXXXXX XXXXXXXXXXX XXXXXXXXXXX XX XXX HTBT XX
1/49 XXXXXXXXXX XXXXXXXXX XXXXXXXXXXX XXXXXXXXXXX XX XXX HTBT XX
1/50 XXXXXXXXXX XXXXXXXXX XXXXXXXXXXX XXXXXXXXXXX XX XXX HTBT XX

I want to save 1/49 and 1/50 to Trunk-port value

import getpass
import sys
import telnetlib

tn.write("conf t\n")
Trunk-port = tn.write("autotopology nmm-table\n")
tn.write("vlan create 1234 name TEST-VLAN type port\n")
tn.write("vlan members add 1234" + Trunk-port + "\n")
tn.write("save config\n")
tn.write("end\n")
Reply
#2
is this helpful?
https://forums.networkinfrastructure.inf...ve-the-ip/
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020