Section 4-1. Switching Table


4-1. Switching Table

  • The switching table contains MAC addresses and the switch ports on which they were learned or statically configured.

  • Packets or frames are forwarded by looking up the destination MAC address in the switching table. The frame is sent out the corresponding switch port.

  • The switching table entries are normally dynamically learned as packets flow. Entries can also be statically defined.

Configuration

1.

(Optional) Assign a static switching table entry:

COS

[View full width]

 set cam {dynamic | static | permanent} {mac-addr |  route-descr} mod/port [vlan-id] 

IOS

[View full width]

 (global) mac-address-table {dynamic | static |  secure} mac-addr {vlan vlan-id} {interface int1  [int2 ... int15] [protocol {ip | ipx | assigned}] 


An entry for the destination MAC address mac-addr (use dashed format on COS, dotted-triplet format on IOS switches) is made to point to one or more switch ports (mod/port on COS, a list of interfaces for IOS). If the destination port is a trunk, you must also specify the destination VLAN number vlan-id.

Switching table entries can be static (not subject to aging), dynamic (entries are aged; not available on Catalyst 6000 IOS), permanent (entries are stored in NVRAM and preserved across switch reboots; not available on Catalyst 6000 IOS), or secure (MAC address entry can exist on only one port; not available on Catalyst 6000 IOS).

A Catalyst 6000 IOS switch also associates the MAC address with a protocol: ip (TCP/IP), ipx, or assigned (other protocols, such as DECnet or AppleTalk). If the protocol keyword is not used, an entry is made for each of the three protocol types.

2.

(Optional) Set the switching table aging time:

COS

 set cam agingtime vlan-id seconds 

IOS

[View full width]

 (global) mac-address-table aging-time seconds  [vlan vlan-id] 


For VLAN number vlan-id (COS: 1-1005 and 1025-4094; IOS: 2-1001), entries are aged out of the switching table after seconds (0, 10 to 1,000,000 seconds; default 300 seconds). A value of 0 disables the aging process. On an IOS switch, the VLAN number is optional. If not specified, the aging time is modified for all VLANs.

3.

(Optional) Remove a switching table entry:

COS

 clear cam mac-addr [vlan-id] 

-OR-

 clear cam {dynamic |)static |)permanent} [vlan-id] 

IOS

[View full width]

 (global) no mac-address-table static mac-addr  {vlan vlan-id} [interface int1 [int2 ... int15]  [protocol {ip | ipx | assigned}] 


You can remove an entry by referencing its MAC address mac-addr (use dashed format on COS, dotted-triplet format on IOS switches). If it is defined on more than one VLAN, the vlan-id must also be given. IOS switches allow the specific destination interfaces to be given, along with a specific protocol.

On a COS switch, you can clear all entries of a particular type: dynamic, static, or permanent.

4.

(Optional; Catalyst 2900/3500XL only) Define a default destination port:

COS

N/A

IOS

 (interface) port network 


Switches that have a limited switching table size can't learn all the destination addresses in a large network. Therefore, you can identify one interface that serves as the "default" or "network" destination for a VLAN.

If a destination MAC address is not known in the switching table, the switch automatically forwards the packet on the network port instead of flooding it to all ports on the VLAN.

Displaying Information About the Switching Table

Table 4-1 lists some switch commands that you can use to display helpful information about the Layer 2 switching table contents.

Table 4-1. Switch Commands to Display Layer 2 Switching Table Content Information

Display Function

Switch OS

Command

Show dynamically learned addresses based on a port or VLAN number

COS

 show cam dynamic [{mod/port} | vlan] 

IOS

[View full width]

 (exec) show mac-address-table dynamic [{address  mac-addr} | detail | {interface interface  interface-number} | {protocol protocol} | {Vlan  vlan-id}] 

Show statically defined addresses based on a port or VLAN number

COS

[View full width]

 show cam {static |)permanent |)system} [{mod/port}  | vlan] 

IOS

[View full width]

 (exec) show mac-address-table static [address  mac-addr | detail | interface interface  interface-number | protocol protocol | Vlan vlan-id] 

Show the port or VLAN associated with a MAC address

COS

 show cam mac_addr [vlan] 

IOS

[View full width]

 (exec) show mac-address-table address mac-addr  [detail | {interface interface interface-number} |  {protocol protocol} | {Vlan vlan-id} | all] 

Show the switching table aging time

COS

 show cam agingtime [vlan] 

IOS

[View full width]

 (exec) show mac-address-table aging-time [Vlan  vlan-id] 

Show the switching table address count and size

COS

[View full width]

 show cam count {dynamic |)static |)permanent  |)system} [vlan] 

IOS

[View full width]

 (exec) show mac-address-table count [Vlan vlan-id]  [slot slot-num] 


Switching Table Example

Suppose you need to locate the switch port where a specific PC is connected. The PC's MAC address is 00-b0-d0-f5-45-0e:

COS

 show cam 00-b0-d0-f5-45-0e 

IOS

 (exec) show mac-address-table address 00b0.d0f5.450e 


On a COS switch, the command output looks like this:

 switch-cos (enable) show cam 00-b0-d0-f5-45-0e * = Static Entry. + = Permanent Entry. # = System Entry. R = Router Entry. X = Port Security Entry $ = Dot1x Security Entry VLAN  Dest MAC/Route Des    [CoS]  Destination Ports or VCs / [Protocol Type] ----  ------------------    -----  ------------------------------------------- 534    00-b0-d0-f5-45-0e             1/2 [ALL] Total Matching CAM Entries Displayed  =1 

An IOS switch can have this output:

 switch-ios#show mac-address-table address 00d0.b7e5.4dc3 Non-static Address Table: Destination Address  Address Type  VLAN  Destination Port -------------------  ------------  ----  -------------------- 00d0.b7e5.4dc3       Dynamic       534  FastEthernet0/2 

Suppose you need to find a list of all the MAC addresses that have been learned on a specific switch port:

COS

 show cam dynamic 3/1 

IOS

[View full width]

 (exec) show mac-address-table dynamic interface  gigabit 0/1 


The COS switch produces the following output:

 cos-switch (enable) show cam dynamic 3/1 * = Static Entry. + = Permanent Entry. # = System Entry. R = Router Entry. X = Port Security Entry $ = Dot1x Security Entry VLAN  Dest MAC/Route Des    [CoS]  Destination Ports or VCs / [Protocol Type] ----  ------------------    -----  ------------------------------------------- 999   00-00-0c-45-21-00             3/1 [ALL] 64    00-00-1b-04-2f-76             3/1 [ALL] 57    00-00-48-9a-3b-0b             3/1 [ALL] Total Matching CAM Entries Displayed  =1 

The IOS switch produces output like this:

 switch-ios#show mac-address-table dynamic interface gig 0/1 Non-static Address Table: Destination Address  Address Type  VLAN  Destination Port -------------------  ------------  ----  -------------------- 0000.0c45.2100       Dynamic        999  GigabitEthernet0/1 0000.1b04.2f76       Dynamic         64  GigabitEthernet0/1 0000.489a.3b0b       Dynamic         57  GigabitEthernet0/1 

TIP

If you need to locate a specific MAC address within a large network and you have no idea where to start, begin looking on a core layer switch near the center of the network. Look for the MAC address in the switching table there. After finding it, move to the neighboring switch that is connected to the destination port.

Keep looking for the address in the switching tables, and then moving to the next neighboring switch. Repeat this process until you reach the edge of the network, where the device is physically connected.




Cisco Field Manual. Catalyst Switch Configuration
Cisco Field Manual. Catalyst Switch Configuration
ISBN: 1587050439
EAN: N/A
Year: 2001
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net