---
name: "SNMP::Info::CiscoVTP"
section: "3pm"
platform: "linux"
package: "libsnmp-info-perl"
version: "3.972002-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SNMP::Info::CiscoVTP"
---

# SNMP::Info::CiscoVTP(3pm)

SNMP Interface to Cisco's VLAN Management MIBs

## 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*

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

- $vtp-\>**i\_subinterfaces()**

  Returns reference to hash of arrays: key = `"ifIndex"`, value = array of `"ifIndex"`. These are the VLAN subinterfaces (`"l2vlan"` type) for the parent (`"ethernetCsmacd"` type) interface.

  ```
    Example:
    my $interfaces = $vtp->interfaces();
    my $i_subs     = $vtp->i_subinterfaces();
    foreach my $iid (sort keys %$interfaces) {
      my $port = $interfaces->{$iid};
      my $subs = join(',', sort(map {$interfaces->{$_}} @{$i_subs->{$iid}}));
      print "Port: $port has subinterfaces: $subs\n";
    }
  ```

- $vtp-\>**i\_vlan\_membership\_untagged()**

  Returns reference to hash of arrays: key = `"ifIndex"`, value = array of VLAN IDs.  These are the VLANs which are members of the untagged egress list for the port.

### 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\_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);
  ```
