XOS show vlan portinfo

  • 3
  • Idea
  • Updated 2 years ago
  • Implemented
  • (Edited)
Hi all,

are there any plans to implement the <show vlan portinfo> command into XOS?

_ToM
Photo of Thomas J Egger

Thomas J Egger

  • 198 Points 100 badge 2x thumb

Posted 5 years ago

  • 3
Photo of Paul Russo

Paul Russo, Alum

  • 9,694 Points 5k badge 2x thumb
Good morning Tom. I do not believe that is on the roadmap. Can you tell me what data you are looking for?

P
Photo of Ronald Dvorak

Ronald Dvorak, Embassador

  • 51,328 Points 50k badge 2x thumb
Paul,

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
D2_desk(su)->

Thanks,
Ron
Photo of Paul Russo

Paul Russo, Alum

  • 9,694 Points 5k badge 2x thumb
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
Photo of Ronald Dvorak

Ronald Dvorak, Embassador

  • 51,328 Points 50k badge 2x thumb
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.

Ron
Photo of Thomas J Egger

Thomas J Egger

  • 198 Points 100 badge 2x thumb
This is a very nice thing when troubleshooting, take a look on the command, you can find the info in the EOS CLI Guide 

_ToM
Photo of Paul Russo

Paul Russo, Alum

  • 9,694 Points 5k badge 2x thumb
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

P
Photo of Dave Hammers

Dave Hammers, Dir SW Engineering

  • 3,802 Points 3k badge 2x thumb
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:
                taggedVlan.append(vid)
        else:
            if vid:
                untaggedVlan.append(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))
        port=''
    if len(taggedVlan):
        print FORMAT.format(prt=port, vlanType='tagged', tagged=', '.join(taggedVlan))

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
(Edited)
Photo of Brian Simpson

Brian Simpson

  • 150 Points 100 badge 2x thumb
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!
Photo of Brandon Clay

Brandon Clay, Escalation Support Engineer

  • 13,066 Points 10k badge 2x thumb
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.

-Brandon
Photo of Ryan Mathews

Ryan Mathews, Alum

  • 8,988 Points 5k badge 2x thumb
Hey Brian, Welcome to the Hub and EXOS.  

Here's an EXOS quick start guide....in case you haven't seen it:
http://learn.extremenetworks.com/rs/extreme/images/Extreme-Networks-Deployment-Jumpstart.pdf

Also, here's a link to GTAC Knowledge.
https://gtacknowledge.extremenetworks.com

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. 
Photo of Paul Russo

Paul Russo, Alum

  • 9,694 Points 5k badge 2x thumb
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
Photo of Brian Simpson

Brian Simpson

  • 150 Points 100 badge 2x thumb
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 <my local machine IP> -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.

Thanks!
Photo of Ronald Dvorak

Ronald Dvorak, Embassador

  • 51,328 Points 50k badge 2x thumb
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..
Photo of Paul Russo

Paul Russo, Alum

  • 9,694 Points 5k badge 2x thumb
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.

P
Photo of Brian Simpson

Brian Simpson

  • 150 Points 100 badge 2x thumb
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!

-Brian
Photo of Ronald Dvorak

Ronald Dvorak, Embassador

  • 51,328 Points 50k badge 2x thumb
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.
Photo of Paul Russo

Paul Russo, Alum

  • 9,694 Points 5k badge 2x thumb
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.

Thanks
P
Photo of Brian Simpson

Brian Simpson

  • 150 Points 100 badge 2x thumb
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.

-Brian

(Edited)
Photo of Brian Simpson

Brian Simpson

  • 150 Points 100 badge 2x thumb
FYI: This is the message I get in the Log Viewer of Tftpd64

Connection received from 132.177.224.211 on port 54312 [20/11 10:14:01.911]
Read request for file <portvlan.py>. Mode octet [20/11 10:14:01.912]
Using local port 54313 [20/11 10:14:01.912]
<portvlan.py>: sent 3 blks, 1028 bytes in 0 s. 0 blk resent [20/11 10:14:01.927]
Photo of Patrick Studer

Patrick Studer

  • 64 Points
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.
Photo of Brian Simpson

Brian Simpson

  • 150 Points 100 badge 2x thumb
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?
Photo of Dave Hammers

Dave Hammers, Dir SW Engineering

  • 3,802 Points 3k badge 2x thumb
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)

EDIT:
See the posts below linking to GitHub for a newer and much improved version of the script.  Instructions above still apply.
(Edited)
Photo of Brian Simpson

Brian Simpson

  • 150 Points 100 badge 2x thumb
Beautiful! Thank you so much, Dave, this is exactly what I need.

-Brian
Photo of Mario Trebes

Mario Trebes

  • 70 Points
Awesome script! Thanks a lot!
Photo of Drew C.

Drew C., Community Manager

  • 39,124 Points 20k badge 2x thumb
Photo of Erik Auerswald

Erik Auerswald, Embassador

  • 13,792 Points 10k badge 2x thumb
For older EXOS switches w/o Python you can use:
show ports information detail | include "(^Port|(Internal|802.1Q) Tag)"
This is quite a bit slower than the Python script, because the command collects a lot more information about every port than is printed in the end.
Photo of Dave Hammers

Dave Hammers, Dir SW Engineering

  • 3,802 Points 3k badge 2x thumb
Because of the response on this thread, in EXOS 16.2, targeted mid summer 2016, the portinfo.py script is being folded in to EXOS CLI as:
# show port vid
Untagged
Port /Tagged VID(s)
-------- -------- ------------------------------------------------------------
1 Untagged 1
Tagged 30, 31, 32, 33, 34, 40, 41, 42, 43, 44, 45, 1000
2 Untagged 100
3 Untagged 1
Tagged 30, 31, 32, 33, 34, 40, 41, 42, 43, 44, 45, 1000
4 Untagged 1
Tagged 30, 31, 32, 33, 34
5 Untagged 100
Tagged 30, 31, 32, 33, 34
6 Untagged 1
Tagged 30, 31, 32, 33, 34, 40, 41, 42, 43, 44, 45
7 Untagged 1
Tagged 30, 31, 32, 33, 34
8 Untagged 1
Tagged 30, 31, 32, 33, 34
9 Untagged 1
Tagged 30, 31, 32, 33, 34, 40, 41, 42, 43, 44, 45
10 Untagged 100
Tagged 30, 31, 32, 33, 34
11 Untagged 1
Tagged 30, 31, 32, 33, 34

and

# show port vid description
         Untagged
Port /Tagged VID VLAN Name VLAN Description
-------- -------- ---- -------------------- ------------------------------------
1 Untagged 1 Default
Tagged 30 VLAN_0030 Finance
31 VLAN_0031
32 VLAN_0032 Engineering II
33 VLAN_0033 Here is an example of a very long
VLAN description. The usr can
34 VLAN_0034
40 VLAN_0040
41 VLAN_0041 Carries heavy traffic between
Building 17 and Building 2
42 VLAN_0042 123456789012345678901234567890123456
7890123456789012345678901234
43 VLAN_0043
44 VLAN_0044
45 VLAN_0045
1000 BigData
2 Untagged 100 VMAN_0100
3 Untagged 1 Default
Tagged 30 VLAN_0030 Finance
31 VLAN_0031
32 VLAN_0032 Engineering II
(Edited)
Photo of Dave Hammers

Dave Hammers, Dir SW Engineering

  • 3,802 Points 3k badge 2x thumb

Received a request by the Extreme support organization to turn this new CLI command into a script for release starting with 15.6.2.

See the Extreme GitHub

https://github.com/extremenetworks/ExtremeScripting/tree/master/EXOS/Python/show_port_vid