SNMP::Info::CiscoVTP - SNMP Interface to Cisco's VLAN Management MIBs
Max Baker
# Let SNMP::Info determine the correct subclass for you. my $vtp = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myswitch', Community => 'public', Version => 2 ) or die "Can't connect to DestHost.\n"; my $class = $vtp->class(); print "SNMP::Info determined this device to fall under subclass : $class\n";
SNMP::Info::CiscoVTP is a subclass of SNMP::Info that provides information about a Cisco device's VLAN and VTP Domain membership.
Use or create in a subclass of SNMP::Info. Do not use directly.
None.
MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
(vtpVersion
)
(vtpMaxVlanStorage
)
(vtpNotificationsEnabled
)
(vtpVlanCreatedNotifEnabled
)
(vtpVlanDeletedNotifEnabled
)
(vlanTrunkPortSetSerialNo
)
Your device will only implement a subset of these methods.
Returns a mapping between ifIndex
and assigned VLAN ID for access ports and the default VLAN ID for trunk ports.
Returns reference to hash of arrays: key = ifIndex
, value = array of VLAN IDs. These are the VLANs which are members of enabled VLAN list for the port.
Example: my $interfaces = $vtp->interfaces(); my $vlans = $vtp->i_vlan_membership(); foreach my $iid (sort keys %$interfaces) { my $port = $interfaces->{$iid}; my $vlan = join(',', sort(@{$vlans->{$iid}})); print "Port: $port VLAN: $vlan\n"; }
CISCO-VTP-MIB::vtpVlanTable
)See ftp://ftp.cisco.com/pub/mibs/supportlists/wsc5000/wsc5000-communityIndexing.html for a good treaty of how to connect to the VLANs
(vtpVlanIndex
)
(vtpVlanState
)
(vtpVlanType
)
(vtpVlanName
)
(vtpVlanMtu
)
(vtpVlanDot10Said
)
(vtpVlanRingNumber
)
(vtpVlanBridgeNumber
)
(vtpVlanStpType
)
(vtpVlanParentVlan
)
(vtpVlanTranslationalVlan1
)
(vtpVlanTranslationalVlan2
)
(vtpVlanBridgeType
)
(vtpVlanAreHopCount
)
(vtpVlanSteHopCount
)
(vtpVlanIsCRFBackup
)
(vtpVlanTypeExt
)
(vtpVlanIfIndex
)
CISCO-VLAN-MEMBERSHIP-MIB::vmMembershipTable
)Static, Dynamic, or multiVlan.
(vmVlanType
)
The VLAN that an access port is assigned to.
(vmVlan
)
Inactive, active, shutdown.
(vmPortStatus
)
Each bit represents a VLAN. This is 0 through 1023
(vmVlans
)
Each bit represents a VLAN. This is 1024 through 2047
(vmVlans2k
)
Each bit represents a VLAN. This is 2048 through 3071
(vmVlans3k
)
Each bit represents a VLAN. This is 3072 through 4095
(vmVlans4k
)
CISCO-VLAN-MEMBERSHIP-MIB::vmVoiceVlanTable
)(vmVoiceVlanId
)
CISCO-VTP-MIB::managementDomainTable
)(managementDomainIndex
)
(managementDomainName
)
(managementDomainLocalMode
)
(managementDomainConfigRevNumber
)
(managementDomainLastUpdater
)
(managementDomainLastChange
)
(managementDomainRowStatus
)
(managementDomainTftpServer
)
(managementDomainTftpPathname
)
(managementDomainPruningState
)
(managementDomainVersionInUse
)
CISCO-VTP-MIB::vlanTrunkPortTable
)(vlanTrunkPortManagementDomain
)
(vlanTrunkPortEncapsulationType
)
(vlanTrunkPortVlansEnabled
)
(vlanTrunkPortVlansEnabled2k
)
(vlanTrunkPortVlansEnabled3k
)
(vlanTrunkPortVlansEnabled4k
)
(vlanTrunkPortNativeVlan
)
(vlanTrunkPortNativeVlan
)
(vlanTrunkPortRowStatus
)
(vlanTrunkPortDynamicState
)
(vlanTrunkPortDynamicStatus
)
(vlanTrunkPortVtpEnabled
)
(vlanTrunkPortEncapsulationOperType
)
These are methods that provide SNMP set functionality for overridden methods or provide a simpler interface to complex set operations. See "SETTING DATA VIA SNMP" in SNMP::Info for general information on set operations.
Changes an access (untagged) port VLAN, must be supplied with the numeric VLAN ID and port ifIndex
. This method should only be used on end station (non-trunk) ports.
Example: my %if_map = reverse %{$vtp->interfaces()}; $vtp->set_i_vlan('2', $if_map{'FastEthernet0/1'}) or die "Couldn't change port VLAN. ",$vtp->error(1);
Sets port default VLAN, must be supplied with the numeric VLAN ID and port ifIndex
. This method should only be used on trunk ports.
Example: my %if_map = reverse %{$vtp->interfaces()}; $vtp->set_i_pvid('2', $if_map{'FastEthernet0/1'}) or die "Couldn't change port default VLAN. ",$vtp->error(1);
Adds the VLAN to the enabled VLANs list of the port, must be supplied with the numeric VLAN ID and port ifIndex
.
Example: my %if_map = reverse %{$vtp->interfaces()}; $vtp->set_add_i_vlan_tagged('2', $if_map{'FastEthernet0/1'}) or die "Couldn't add port to egress list. ",$vtp->error(1);
Removes the VLAN from the enabled VLANs list of the port, must be supplied with the numeric VLAN ID and port ifIndex
.
Example: my %if_map = reverse %{$vtp->interfaces()}; $vtp->set_remove_i_vlan_tagged('2', $if_map{'FastEthernet0/1'}) or die "Couldn't add port to egress list. ",$vtp->error(1);