Removing all VLANs on a port in VOSS

A quick python script that will collect the VLANs configured on an individual port in VOSS.

import paramiko

import time

import re

# Configuration

HOST = “192.168.0.50”

USERNAME = “rwa”

PASSWORD = “rwa”

PORT = “1/9”

def extract_vlan_ids(output, port):

    vlan_ids = []

    for line in output.splitlines():

        if port in line and “normal” in line:

            words = line.split()

            try:

                normal_index = words.index(“normal”)

                vlan_field = words[normal_index – 1]

                vlan_ids = [int(v) for v in vlan_field.split(“,”) if v.isdigit()]

                print(f”🔎 Extracted VLANs: {vlan_ids}”)

            except (ValueError, IndexError):

                print(“⚠️ Could not parse VLANs from line:”, line)

            break

    return vlan_ids

def remove_vlans_from_port(host, username, password, port):

    try:

        ssh = paramiko.SSHClient()

        ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())

        ssh.connect(host, username=username, password=password, look_for_keys=False)

        shell = ssh.invoke_shell()

        time.sleep(1)

        shell.send(“enable\n”)

        time.sleep(0.5)

        shell.send(“configure terminal\n”)

        time.sleep(0.5)

        # Show VLAN info for the port

        shell.send(f”show interface gig vlan {port}\n”)

        time.sleep(2)

        output = shell.recv(5000).decode()

        print(“📋 Raw Output:\n”, output)

        vlan_ids = extract_vlan_ids(output, port)

        if not vlan_ids:

            print(f”⚠️ No VLANs found near ‘normal’ for port {port}.”)

        else:

            for vlan_id in vlan_ids:

                cmd = f”vlan members remove {vlan_id} {port}\n”

                shell.send(cmd)

                time.sleep(0.2)

                print(f”✅ Sent: {cmd.strip()}”)

        shell.send(“exit\n”)

        time.sleep(0.5)

        ssh.close()

        print(f”✅ Completed: Removed VLANs {vlan_ids} from port {port} on {host}”)

    except Exception as e:

        print(f”❌ Error: {e}”)

# Run it

remove_vlans_from_port(HOST, USERNAME, PASSWORD, PORT)

##

5520-24T-FabricEngine:1(config)#
🔎 Extracted VLANs: [44, 55]
✅ Sent: vlan members remove 44 1/9
✅ Sent: vlan members remove 55 1/9
✅ Completed: Removed VLANs [44, 55] from port 1/9 on 192.168.0.50

Note: Alternatively, use EDM to remove port from VLANs and Apply. Or prepare a list of VLAN IDs in Column A in an Excel sheet and concatenate into the command “vlan members remove <cell-A1> <port>” to create the complete command in the next column and then select the + sign of that cell and drag the cell down until reach the end and you can then copy a list of commands into the CLI which will remove each VLAN from the port.

Another idea is to remove tagging from the port, this will remove all the VLANs immediately. Can then make the port an untagged member of a single VLAN.

Summarising routes on VOSS into Area 0

In the following example we have a VOSS switch configured with OSPF with area 0 and area 100. All local VLANs with IP enabled interfaces with the exception of the broadcast VLAN are IP OSPF passive addresses with class C subnets. The switch is an ABR.

VLAN 44 with IP 44.44.44.1/24.

Vlan44 44.44.44.1 255.255.255.0 enable up 44 false disable

To summarise these /24 routes as /16 and advertise into area 0 the following command can be used: 

router ospf enable
router ospf
area 0.0.0.100
area range 0.0.0.100 44.44.0.0/255.255.0.0 summary-link advertise-mode summarize
area range 0.0.0.100 44.44.0.0/255.255.0.0 summary-link advertise-metric 10
exit

The 44.44.44.0/24 subnet is summarised as a /16.

Extract from show ip ospf lsdb command…

Summary Lsas in Area 0.0.0.0

LSTYPE LINKSTATEID ADV_ROUTER AGE SEQ_NBR CSUM

Summary 44.44.0.0 151.58.1.0 17 0x80000001 0xe3e8

Routing table of OSPF neighbour in area 0…

VSP-8284XSQ:1(config)#show ip route

DST MASK NEXT VRF/ISID COST FACE PROT AGE TYPE PRF

44.44.0.0 255.255.0.0 55.55.55.1 GlobalRouter 111 55 OSPF 0 IB 25
55.55.55.0 255.255.255.0 55.55.55.2 – 1 55 LOC 0 DB 0

2 out of 2 Total Num of Route Entries, 2 Total Num of Dest Networks displayed.

TYPE Legend:
I=Indirect Route, D=Direct Route, A=Alternative Route, B=Best Route, E=Ecmp Route,
U=Unresolved Route, N=Not in HW, F=Replaced by FTN, V=IPVPN Route, S=SPBM Route
PROTOCOL Legend:
v=Inter-VRF route redistributed
VSP-8284XSQ:1(config)#

 

 

 

 

 

 

New Extreme Fabric Best Practices from Extreme Networks

Just notice some best practice knowledge based article were posted yesterday and each one has links to other ones to complete the set.

Her is a link to one of them… Extreme Fabric Best Practice – vIST Cluster / Article Number: 000124824.

https://extreme-networks.my.site.com/ExtrArticleDetail?an=000124824

Additional notes

This document was created by a team of engineers in Professional Services, PLM, GTAC, and SE’s using: VOSS/FE 9.1.0

Extreme Fabric Best Practice – Architecture and Topology
https://extreme-networks.my.site.com/ExtrArticleDetail?an=000124842 
Extreme Fabric Best Practice – Autosense Portshttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124841 
Extreme Fabric Best Practice – Chassis Settingshttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124840 
Extreme Fabric Best Practice – DvRhttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124843
Extreme Fabric Best Practice – Fabric Extendhttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124839 
Extreme Fabric Best Practice – Fabric Managementhttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124838 
Extreme Fabric Best Practice – IP Multicasthttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124837 
Extreme Fabric Best Practice – IS-IS/OSPF Route Policieshttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124836 
Extreme Fabric Best Practice – Layer 2 VSNhttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124835 
Extreme Fabric Best Practice – Layer 3 VSNhttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124834 
Extreme Fabric Best Practice – Loop Preventionhttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124596
Extreme Fabric Best Practice – Migration Strategy
https://extreme-networks.my.site.com/ExtrArticleDetail?an=000124833 
Extreme Fabric Best Practice – Multi-Area SPBmhttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124832 
Extreme Fabric Best Practice – Onboarding and Provisioning
https://extreme-networks.my.site.com/ExtrArticleDetail?an=000124830 
Extreme Fabric Best Practice – QoShttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124844 
Extreme Fabric Best Practice – SPBm Infrastructurehttps://extreme-networks.my.site.com/ExtrArticleDetail?an=000124826 
Extreme Fabric Best Practice – Switch Selection and Features
https://extreme-networks.my.site.com/ExtrArticleDetail?an=000124825 
Extreme Fabric Best Practice – vIST Cluster
https://extreme-networks.my.site.com/ExtrArticleDetail?an=000124824