Header Only - DO NOT REMOVE - Extreme Networks

XOS show vlan portinfo

Hi all,

are there any plans to implement the command into XOS?


28 replies

Userlevel 6
Good morning Tom. I do not believe that is on the roadmap. Can you tell me what data you are looking for? P
Userlevel 7

the output of the command gives an overview about the VLANs untagged/tagged that are configured per port in one simple view which is great for troubleshooting.

So would be great if we'd get that also in XOS.

Here an example.....

D2_desk(su)->show vlan portinfo
Port VLAN Ingress Egress Filter Vlan
ge.1.1 100 N untagged: 100
ge.1.2 100 N untagged: 100
ge.1.3 100 N untagged: 100
ge.1.4 100 N untagged: 100
ge.1.5 100 N untagged: 100
ge.1.6 100 N untagged: 100
ge.1.7 100 N untagged: 100
ge.1.8 100 N untagged: 100
ge.1.9 999 N untagged: 999
ge.1.10 999 N untagged: 999
ge.1.11 999 N untagged: 999
ge.1.12 1 N untagged: 1 tagged: 100
lag.0.1 1 N untagged: 1
lag.0.2 1 N untagged: 1
lag.0.3 1 N untagged: 1
lag.0.4 1 N untagged: 1
lag.0.5 1 N untagged: 1
lag.0.6 1 N untagged: 1

Userlevel 6
Hey Ron. Just doing a show on the VLAN gives you that information. For example if you have a VLAN called extreme doing a show extreme will list the ports that are either tagged or untagged in that VLAN. Let me know if you need more questions. P
Userlevel 7
The difference is that XOS "show VLAN X" reports all ports in that VLAN.
"show vlan portinfo" does the opposite it shows all VLANs on all ports.
That would mean on a switch with 100 VLANs I'd need to do 100x XOS show vlan x to get the same result as with a single show vlan portinfo command.

This is a very nice thing when troubleshooting, take a look on the command, you can find the info in the EOS CLI Guide

Userlevel 6
Hey Ron

We can get that detail but it is in our detail information which provides much more. One thing that can probably be done is to create a script to take the information from all of the commands and put it in one output. When we support Python later this year we will be able to create customer commands to do run multiple commands take the useful information and then provide it in another ourput.

you can do a show vlan port 1-X or show vlan port 1-X detail

Userlevel 5
Came across this while searching for a posting in the Hub. Below is a quick script that sounds like what you wanted.

Starting with 15.6.2 or 15.7.1, you could use the following script:
#!/usr/bin/env python
import exsh
import json

FORMAT = '{prt:<8.8} {vlanType}:{tagged}'
print FORMAT.format(prt='Port', vlanType='untagged',tagged='tagged')
portRslt = exsh.clicmd('debug cfgmgr show next vlan.show_ports_info format portList=* port=None', True)
portDict = json.loads(portRslt)
for row in portDict['data']:
port = row['port']
vlanRslt = json.loads(exsh.clicmd('debug cfgmgr show next vlan.show_ports_info_detail_vlans formatted port={0} vlanIfInstance=None'.format(port), True))
taggedVlan = []
untaggedVlan = []
for vlanRow in vlanRslt['data']:
vid = vlanRow.get('vlanId',None)
if vlanRow['tagStatus'] == '1':
if vid:
if vid:
if len(untaggedVlan) == 0 and len(taggedVlan) == 0:
print FORMAT.format(prt=port, vlanType='none', tagged='')
if len(untaggedVlan):
print FORMAT.format(prt=port, vlanType='untagged', tagged=', '.join(untaggedVlan))
if len(taggedVlan):
print FORMAT.format(prt=port, vlanType='tagged', tagged=', '.join(taggedVlan))[/code]
The output looks like:
X460G2-24t-10G4.35 # run script portvlan.py
Port untagged:tagged
1 untagged:1
tagged:10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
2 untagged:1
tagged:10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
3 untagged:1
tagged:10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
4 untagged:1
tagged:10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
5 untagged:1
tagged:10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
6 untagged:1
7 untagged:1
8 untagged:1
9 untagged:1
10 untagged:1
11 untagged:1
12 untagged:1
13 untagged:1
14 untagged:1
15 untagged:1
16 untagged:1
17 untagged:1
18 untagged:1
19 untagged:1
20 untagged:1
21 untagged:1
22 untagged:1
23 untagged:1
24 untagged:1
25 untagged:1
26 untagged:1
27 untagged:1
28 untagged:1
29 untagged:1
30 untagged:1
31 untagged:1
32 untagged:1
33 untagged:1
34 untagged:1
Dave, I am new to XOS and trying to eval a Summit 450. Can you give me the Cliff Notes on getting that script onto the switch? Do I enable cli scripting, then enter the commands as they appear there? I tried copying and pasting but got error after error. Any help is appreciated!
Userlevel 7
Dave, I am new to XOS and trying to eval a Summit 450. Can you give me the Cliff Notes on getting that script onto the switch? Do I enable cli scripting, then enter the commands as they appear there? I tried copying and pasting but got error after error. Any help is appreciated!
Hi Brian,

Dave's script is written in Python, which was initially supported in EXOS 15.6. Unfortunately, the X450a/e switches can only run up to EXOS 15.3, so they will not run Python scripts.

You can do TCL scripting in all versions of EXOS, but I am not sure if there is a TCL version of this script.

Userlevel 6
Dave, I am new to XOS and trying to eval a Summit 450. Can you give me the Cliff Notes on getting that script onto the switch? Do I enable cli scripting, then enter the commands as they appear there? I tried copying and pasting but got error after error. Any help is appreciated!
Hey Brian, Welcome to the Hub and EXOS.

Here's an EXOS quick start guide....in case you haven't seen it:

Also, here's a link to GTAC Knowledge.

There are quite a few articles to help with scripting, etc.

And of course, you've hit on one of the most valuable troubleshooting tools...our community!

You'll find the community is very quick to jump in and help. Really glad you joined us.
Userlevel 6
Hello Brian. Copy and paste this script into a txt editor and save it as portvlan.py The PARK shows that it is a Python script. Next TFTP it to the switch. The command to do that is TFTP -v vr-d -g -r portvlan.py Once you have it on the switch (verify with the command ls) then use the command run script portvlan.py . Of course you can name it whatever you want just put the .py extension Let me know if you still have issues
Hi Paul and everyone,

Thanks so much for the feedback. So, I tried saving the script on Notepad, copying from the "#!/usr/bin/env python" line all the way down. Saved it to my local machine as portvlan.py.

Then I tried to tftp it using your command:

tftp -v vr-d -g -r portvlan.py

It tells me it's downloading the file to the switch. However, it fails due to a timeout error, and I'm not sure where I'm going wrong, hoping one of you guys can put some eyes on this and let me know where I messed up.

Userlevel 7
Might be the "-v vr-d " = the virtual router vr-default is used.

If you don't use vr-default to route from the XOS to your laptop you must change it to the correct vr.

Do a "show vlan" do see which vr there are and which one is used for your communication..
Userlevel 6
Hey Brian

I think there could be a few issues and Ronald mentioned a few.

1) Are you using an in-band VLAN i.e. a VLAN you created for users? if so the VR-D is the right virtual router. If you are using the out of band management port then VR-M is the one to use.

2) Can you ping the server that is offering up the TFTP service? Try and do the ping if that fails than it can be a situation where there is no route or default gateway on the switch, or that there is a FW (on machine) blocking the traffic.

3) can you access the TFTP server from another machine?

4) is the TFTP application providing the right directory or permission to the switch?

Let us know if any of those help.

Hi Paul,

Let me preface this by reiterating what a network newbie I am, so please forgive any ignorance!

1) I am using my desktop to try this TFTP method which is on, for lack of a better term, a staff vlan. I can ping the XOS switch from it. I thought about trying to save this script somewhere in NMS Inventory Manager, thinking that might be easier, but seems like it shouldn't matter.

2) I can ping my desktop from the XOS switch. I have no idea if there are FW rules, I would have to check with one of the network admins.

3) By accessing the TFTP server (my desktop), I guess I can via remote desktop?

4) This is where I'm stumped. I don't know what this means. Do I need to enable the tftpd module on the XOS switch to give permission? And do I need to use the full path name when I use the CLI command, or still just "portvlan.py"?

Thank you guys for your help and patience!

Userlevel 7
1) the switch could have more interfaces configured, with vr XX you tell him which one to use to communicate with your device to TFTP the file.
If you choose the wrong one i.e. vr-default instead of vr-managment the download will not work.
Userlevel 6
Hey Brian

ok so you can get to the switch that is good and means the VLAN is good to go. What type of OS are you running on your system? are you using the TFTP server in NS or are you using a third party application like 3cdeamon? A Mac has a built in TFTP server that you can use.

Hi Paul,

I wasn't using anything, that's how clueless I am about this. So I downloaded Tftpd64 to my PC (Windows 7) and am trying to configure it, but not exactly sure how to get it running, there seems to be a lot of options I don't need, like DHCP and Syslog, etc.

I think I have it set up as just a TFTP server, using my desktop as the directory (C:\Users\xxx\Desktop), and the IP address of my PC as the server interface, but that's when I get stuck, I don't know how to actually start the TFTP process.

I tried running the CLI command with Windows Firewall disabled and still no luck.


FYI: This is the message I get in the Log Viewer of Tftpd64

Connection received from on port 54312 [20/11 10:14:01.911]
Read request for file . Mode octet [20/11 10:14:01.912]
Using local port 54313 [20/11 10:14:01.912]
: sent 3 blks, 1028 bytes in 0 s. 0 blk resent [20/11 10:14:01.927]
Absolutely incorporate this into the XOS CLI. I use this command every day... seems like a basic command to me - most people don't know or care about Python. We are network engineers, not programmers. That script fits the bill please consider including it.
I have not had any further luck. I tried setting up the TFTP server on my Macbook, but wasn't able to change the root directory, and instead led me down a rabbit hole of folder permissions and disabling security feature to edit .lists.

Does anyone have any ideas of a simpler way to get this done, or am I missing something simple?
Userlevel 5
If familiar at all with vi, EXOS has a vi editor builtin.
Heres another approach.
telnet to a switch, don't use the console just because it's very slow.

* (pacman debug) X460G2-24t-10G4.1 # vi portinfo.py
at this point the vi editor will start.
a [enter] this will put the editor in append mode
Copy and paste the script into the vi editor window.
(paste by using the right mouse button)

See the posts below linking to GitHub for a newer and much improved version of the script. Instructions above still apply.
Beautiful! Thank you so much, Dave, this is exactly what I need.

Awesome script! Thanks a lot!
Userlevel 7
Awesome script! Thanks a lot!
Mario, there's a newer version of this script on our GitHub page.