1SNMP::Info::CiscoVTP(3)User Contributed Perl DocumentatioSnNMP::Info::CiscoVTP(3)
2
3
4
6 SNMP::Info::CiscoVTP - SNMP Interface to Cisco's VLAN Management MIBs
7
9 Max Baker
10
12 # Let SNMP::Info determine the correct subclass for you.
13 my $vtp = new SNMP::Info(
14 AutoSpecify => 1,
15 Debug => 1,
16 DestHost => 'myswitch',
17 Community => 'public',
18 Version => 2
19 )
20 or die "Can't connect to DestHost.\n";
21
22 my $class = $vtp->class();
23 print "SNMP::Info determined this device to fall under subclass : $class\n";
24
26 SNMP::Info::CiscoVTP is a subclass of SNMP::Info that provides
27 information about a Cisco device's VLAN and VTP Domain membership.
28
29 Use or create in a subclass of SNMP::Info. Do not use directly.
30
31 Inherited Classes
32 None.
33
34 Required MIBs
35 CISCO-VTP-MIB
36 CISCO-VLAN-MEMBERSHIP-MIB
37 CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB
38
39 MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
40
42 $vtp->vtp_version()
43 ("vtpVersion")
44
45 $vtp->vtp_maxstore()
46 ("vtpMaxVlanStorage")
47
48 $vtp->vtp_notify()
49 ("vtpNotificationsEnabled")
50
51 $vtp->vtp_notify_create()
52 ("vtpVlanCreatedNotifEnabled")
53
54 $vtp->vtp_notify_delete()
55 ("vtpVlanDeletedNotifEnabled")
56
57 $vtp->vtp_trunk_set_serial()
58 ("vlanTrunkPortSetSerialNo")
59
61 Your device will only implement a subset of these methods.
62
63 $vtp->i_vlan()
64 Returns a mapping between "ifIndex" and assigned VLAN ID for access
65 ports and the default VLAN ID for trunk ports.
66
67 $vtp->i_untagged()
68 An alias for "i_vlan".
69
70 $vtp->i_vlan_membership()
71 Returns reference to hash of arrays: key = "ifIndex", value = array
72 of VLAN IDs. These are the VLANs which are members of enabled VLAN
73 list for the port.
74
75 Example:
76 my $interfaces = $vtp->interfaces();
77 my $vlans = $vtp->i_vlan_membership();
78
79 foreach my $iid (sort keys %$interfaces) {
80 my $port = $interfaces->{$iid};
81 my $vlan = join(',', sort(@{$vlans->{$iid}}));
82 print "Port: $port VLAN: $vlan\n";
83 }
84
85 $vtp->i_vlan_membership_untagged()
86 Returns reference to hash of arrays: key = "ifIndex", value = array
87 of VLAN IDs. These are the VLANs which are members of the untagged
88 egress list for the port.
89
90 VLAN Table ("CISCO-VTP-MIB::vtpVlanTable")
91 See
92 <ftp://ftp.cisco.com/pub/mibs/supportlists/wsc5000/wsc5000-communityIndexing.html>
93 for a good treaty of how to connect to the VLANs
94
95 $vtp->v_index()
96 ("vtpVlanIndex")
97
98 $vtp->v_state()
99 ("vtpVlanState")
100
101 $vtp->v_type()
102 ("vtpVlanType")
103
104 $vtp->v_name()
105 ("vtpVlanName")
106
107 $vtp->v_mtu()
108 ("vtpVlanMtu")
109
110 $vtp->v_said()
111 ("vtpVlanDot10Said")
112
113 $vtp->v_ring()
114 ("vtpVlanRingNumber")
115
116 $vtp->v_bridge()
117 ("vtpVlanBridgeNumber")
118
119 $vtp->v_stp()
120 ("vtpVlanStpType")
121
122 $vtp->v_parent()
123 ("vtpVlanParentVlan")
124
125 $vtp->v_trans1()
126 ("vtpVlanTranslationalVlan1")
127
128 $vtp->v_trans2()
129 ("vtpVlanTranslationalVlan2")
130
131 $vtp->v_btype()
132 ("vtpVlanBridgeType")
133
134 $vtp->v_hop_are()
135 ("vtpVlanAreHopCount")
136
137 $vtp->v_hop_ste()
138 ("vtpVlanSteHopCount")
139
140 $vtp->v_crf()
141 ("vtpVlanIsCRFBackup")
142
143 $vtp->v_type_ext()
144 ("vtpVlanTypeExt")
145
146 $vtp->v_if()
147 ("vtpVlanIfIndex")
148
149 VLAN Membership Table ("CISCO-VLAN-MEMBERSHIP-MIB::vmMembershipTable")
150 $vtp->i_vlan_type()
151 Static, Dynamic, or multiVlan.
152
153 ("vmVlanType")
154
155 $vtp->i_vlan2()
156 The VLAN that an access port is assigned to.
157
158 ("vmVlan")
159
160 $vtp->i_vlan_stat()
161 Inactive, active, shutdown.
162
163 ("vmPortStatus")
164
165 $vtp->i_vlan_1()
166 Each bit represents a VLAN. This is 0 through 1023
167
168 ("vmVlans")
169
170 $vtp->i_vlan_2()
171 Each bit represents a VLAN. This is 1024 through 2047
172
173 ("vmVlans2k")
174
175 $vtp->i_vlan_3()
176 Each bit represents a VLAN. This is 2048 through 3071
177
178 ("vmVlans3k")
179
180 $vtp->i_vlan_4()
181 Each bit represents a VLAN. This is 3072 through 4095
182
183 ("vmVlans4k")
184
185 VLAN Membership Voice VLAN Table
186 ("CISCO-VLAN-MEMBERSHIP-MIB::vmVoiceVlanTable")
187 $vtp->i_voice_vlan()
188 ("vmVoiceVlanId")
189
190 Management Domain Table ("CISCO-VTP-MIB::managementDomainTable")
191 $vtp->vtp_d_name()
192 ("managementDomainName")
193
194 $vtp->vtp_d_mode()
195 ("managementDomainLocalMode")
196
197 $vtp->vtp_d_rev()
198 ("managementDomainConfigRevNumber")
199
200 $vtp->vtp_d_updater()
201 ("managementDomainLastUpdater")
202
203 $vtp->vtp_d_last()
204 ("managementDomainLastChange")
205
206 $vtp->vtp_d_status()
207 ("managementDomainRowStatus")
208
209 $vtp->vtp_d_tftp()
210 ("managementDomainTftpServer")
211
212 $vtp->vtp_d_tftp_path()
213 ("managementDomainTftpPathname")
214
215 $vtp->vtp_d_pruning()
216 ("managementDomainPruningState")
217
218 $vtp->vtp_d_ver()
219 ("managementDomainVersionInUse")
220
221 VLAN Trunk Port Table ("CISCO-VTP-MIB::vlanTrunkPortTable")
222 $vtp->vtp_trunk_mgmt_dom()
223 ("vlanTrunkPortManagementDomain")
224
225 $vtp->vtp_trunk_encaps_t()
226 ("vlanTrunkPortEncapsulationType")
227
228 $vtp->vtp_trunk_vlans()
229 ("vlanTrunkPortVlansEnabled")
230
231 $vtp->vtp_trunk_vlans_2k()
232 ("vlanTrunkPortVlansEnabled2k")
233
234 $vtp->vtp_trunk_vlans_3k()
235 ("vlanTrunkPortVlansEnabled3k")
236
237 $vtp->vtp_trunk_vlans_4k()
238 ("vlanTrunkPortVlansEnabled4k")
239
240 $vtp->vtp_trunk_native()
241 ("vlanTrunkPortNativeVlan")
242
243 $vtp->i_pvid()
244 ("vlanTrunkPortNativeVlan")
245
246 $vtp->vtp_trunk_rstat()
247 ("vlanTrunkPortRowStatus")
248
249 $vtp->vtp_trunk_dyn()
250 ("vlanTrunkPortDynamicState")
251
252 $vtp->vtp_trunk_dyn_stat()
253 ("vlanTrunkPortDynamicStatus")
254
255 $vtp->vtp_trunk_vtp()
256 ("vlanTrunkPortVtpEnabled")
257
258 $vtp->vtp_trunk_encaps()
259 ("vlanTrunkPortEncapsulationOperType")
260
262 These are methods that provide SNMP set functionality for overridden
263 methods or provide a simpler interface to complex set operations. See
264 "SETTING DATA VIA SNMP" in SNMP::Info for general information on set
265 operations.
266
267 $vtp->set_i_vlan ( vlan, ifIndex )
268 Changes an access (untagged) port VLAN, must be supplied with the
269 numeric VLAN ID and port "ifIndex". This method should only be
270 used on end station (non-trunk) ports.
271
272 Example:
273 my %if_map = reverse %{$vtp->interfaces()};
274 $vtp->set_i_vlan('2', $if_map{'FastEthernet0/1'})
275 or die "Couldn't change port VLAN. ",$vtp->error(1);
276
277 $vtp->set_i_pvid ( pvid, ifIndex )
278 Sets port default VLAN, must be supplied with the numeric VLAN ID
279 and port "ifIndex". This method should only be used on trunk
280 ports.
281
282 Example:
283 my %if_map = reverse %{$vtp->interfaces()};
284 $vtp->set_i_pvid('2', $if_map{'FastEthernet0/1'})
285 or die "Couldn't change port default VLAN. ",$vtp->error(1);
286
287 $vtp->set_i_untagged ( vlan, ifIndex )
288 This method attempts to work out whether the port referenced by
289 ifIndex is trunking, and if so will return the value of
290 "set_i_pvid". Otherwise, the value of "set_i_vlan" is returned.
291
292 $vtp->set_add_i_vlan_tagged ( vlan, ifIndex )
293 Adds the VLAN to the enabled VLANs list of the port, must be
294 supplied with the numeric VLAN ID and port "ifIndex".
295
296 Example:
297 my %if_map = reverse %{$vtp->interfaces()};
298 $vtp->set_add_i_vlan_tagged('2', $if_map{'FastEthernet0/1'})
299 or die "Couldn't add port to egress list. ",$vtp->error(1);
300
301 $vtp->set_remove_i_vlan_tagged ( vlan, ifIndex )
302 Removes the VLAN from the enabled VLANs list of the port, must be
303 supplied with the numeric VLAN ID and port "ifIndex".
304
305 Example:
306 my %if_map = reverse %{$vtp->interfaces()};
307 $vtp->set_remove_i_vlan_tagged('2', $if_map{'FastEthernet0/1'})
308 or die "Couldn't add port to egress list. ",$vtp->error(1);
309
310
311
312perl v5.28.0 2018-11-29 SNMP::Info::CiscoVTP(3)