30-11
Software Configuration Guide—Release 15.0(2)SG
OL-23818-01
Chapter 30 Configuring Layer 3 Interfaces Configuring VLANs as Layer 3 Interfaces
This example shows how to enable counters on interface VLAN 1:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface vlan 1
Switch(config-if)# counter ipv4
Switch(config-if)# end
Switch#
00:17:15: %SYS-5-CONFIG_I: Configured from console by console
Switch# show run interface vlan 1
Building configuration...
Current configuration : 63 bytes
!
interface Vlan1
ip address 10.0.0.1 255.0.0.0
counter ipv4
end
Note To remove the counters, use the no counter command.
If you have already assigned the maximum number of counters, the counter command fails and displays
an error message:
Switch# config terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface fa3/2
Switch(config-if)# no switchport
Switch(config-if)# counter ipv6
Counter resource exhausted for interface fa3/2
Switch(config-if)# end
Switch#
00:24:18: %SYS-5-CONFIG_I: Configured from console by console
In this situation, you must release a counter from another interface for use by the new interface.
Step 3 Switch(config-if)# counter {ipv4 | ipv6 | ipv4
ipv6 separate>Enables counters.
counter —Enables collection of IPv4 and IPv6 statistics
and displays them as a sum
counter ipv4 — Enables collection of IPv4 statistics
only
counter ipv6 — Enables collection of IPv6 statistics
only
counter ipv4 ipv6 separate —Enables collection of
IPv4 and IPv6 statistics and displays them individually
Step 4 Switch(config)# end Exits configuration mode.
Step 5 Switch# show run interface interface-id Displays the running configuration.
Command Purpose