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