NAME

SNMP::Info::CiscoVTP - SNMP Interface to Cisco's VLAN Management MIBs

AUTHOR

Max Baker

SYNOPSIS

# 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";

DESCRIPTION

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.

Inherited Classes

None.

Required MIBs

CISCO-VTP-MIB
CISCO-VLAN-MEMBERSHIP-MIB
CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB

MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz

GLOBALS

$vtp->vtp_version()

(vtpVersion)

$vtp->vtp_maxstore()

(vtpMaxVlanStorage)

$vtp->vtp_notify()

(vtpNotificationsEnabled)

$vtp->vtp_notify_create()

(vtpVlanCreatedNotifEnabled)

$vtp->vtp_notify_delete()

(vtpVlanDeletedNotifEnabled)

$vtp->vtp_trunk_set_serial()

(vlanTrunkPortSetSerialNo)

TABLE METHODS

Your device will only implement a subset of these methods.

$vtp->i_vlan()

Returns a mapping between ifIndex and assigned VLAN ID for access ports and the default VLAN ID for trunk ports.

$vtp->i_untagged()

An alias for i_vlan.

$vtp->i_vlan_membership()

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";
}

VLAN Table (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

$vtp->v_index()

(vtpVlanIndex)

$vtp->v_state()

(vtpVlanState)

$vtp->v_type()

(vtpVlanType)

$vtp->v_name()

(vtpVlanName)

$vtp->v_mtu()

(vtpVlanMtu)

$vtp->v_said()

(vtpVlanDot10Said)

$vtp->v_ring()

(vtpVlanRingNumber)

$vtp->v_bridge()

(vtpVlanBridgeNumber)

$vtp->v_stp()

(vtpVlanStpType)

$vtp->v_parent()

(vtpVlanParentVlan)

$vtp->v_trans1()

(vtpVlanTranslationalVlan1)

$vtp->v_trans2()

(vtpVlanTranslationalVlan2)

$vtp->v_btype()

(vtpVlanBridgeType)

$vtp->v_hop_are()

(vtpVlanAreHopCount)

$vtp->v_hop_ste()

(vtpVlanSteHopCount)

$vtp->v_crf()

(vtpVlanIsCRFBackup)

$vtp->v_type_ext()

(vtpVlanTypeExt)

$vtp->v_if()

(vtpVlanIfIndex)

VLAN Membership Table (CISCO-VLAN-MEMBERSHIP-MIB::vmMembershipTable)

$vtp->i_vlan_type()

Static, Dynamic, or multiVlan.

(vmVlanType)

$vtp->i_vlan2()

The VLAN that an access port is assigned to.

(vmVlan)

$vtp->i_vlan_stat()

Inactive, active, shutdown.

(vmPortStatus)

$vtp->i_vlan_1()

Each bit represents a VLAN. This is 0 through 1023

(vmVlans)

$vtp->i_vlan_2()

Each bit represents a VLAN. This is 1024 through 2047

(vmVlans2k)

$vtp->i_vlan_3()

Each bit represents a VLAN. This is 2048 through 3071

(vmVlans3k)

$vtp->i_vlan_4()

Each bit represents a VLAN. This is 3072 through 4095

(vmVlans4k)

VLAN Membership Voice VLAN Table (CISCO-VLAN-MEMBERSHIP-MIB::vmVoiceVlanTable)

$vtp->i_voice_vlan()

(vmVoiceVlanId)

Management Domain Table (CISCO-VTP-MIB::managementDomainTable)

$vtp->vtp_d_index()

(managementDomainIndex)

$vtp->vtp_d_name()

(managementDomainName)

$vtp->vtp_d_mode()

(managementDomainLocalMode)

$vtp->vtp_d_rev()

(managementDomainConfigRevNumber)

$vtp->vtp_d_updater()

(managementDomainLastUpdater)

$vtp->vtp_d_last()

(managementDomainLastChange)

$vtp->vtp_d_status()

(managementDomainRowStatus)

$vtp->vtp_d_tftp()

(managementDomainTftpServer)

$vtp->vtp_d_tftp_path()

(managementDomainTftpPathname)

$vtp->vtp_d_pruning()

(managementDomainPruningState)

$vtp->vtp_d_ver()

(managementDomainVersionInUse)

VLAN Trunk Port Table (CISCO-VTP-MIB::vlanTrunkPortTable)

$vtp->vtp_trunk_mgmt_dom()

(vlanTrunkPortManagementDomain)

$vtp->vtp_trunk_encaps_t()

(vlanTrunkPortEncapsulationType)

$vtp->vtp_trunk_vlans()

(vlanTrunkPortVlansEnabled)

$vtp->vtp_trunk_vlans_2k()

(vlanTrunkPortVlansEnabled2k)

$vtp->vtp_trunk_vlans_3k()

(vlanTrunkPortVlansEnabled3k)

$vtp->vtp_trunk_vlans_4k()

(vlanTrunkPortVlansEnabled4k)

$vtp->vtp_trunk_native()

(vlanTrunkPortNativeVlan)

$vtp->i_pvid()

(vlanTrunkPortNativeVlan)

$vtp->vtp_trunk_rstat()

(vlanTrunkPortRowStatus)

$vtp->vtp_trunk_dyn()

(vlanTrunkPortDynamicState)

$vtp->vtp_trunk_dyn_stat()

(vlanTrunkPortDynamicStatus)

$vtp->vtp_trunk_vtp()

(vlanTrunkPortVtpEnabled)

$vtp->vtp_trunk_encaps()

(vlanTrunkPortEncapsulationOperType)

SET METHODS

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.

$vtp->set_i_vlan ( vlan, ifIndex )

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);
$vtp->set_i_pvid ( pvid, ifIndex )

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);
$vtp->set_i_untagged ( vlan, ifIndex )

This method attempts to work out whether the port referenced by ifIndex is trunking, and if so will return the value of set_i_pvid. Otherwise, the value of set_i_vlan is returned.

$vtp->set_add_i_vlan_tagged ( vlan, ifIndex )

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);
$vtp->set_remove_i_vlan_tagged ( vlan, ifIndex )

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);