{"id":942,"date":"2011-06-07T22:32:00","date_gmt":"2011-06-07T14:32:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=942"},"modified":"2023-11-07T22:47:01","modified_gmt":"2023-11-07T14:47:01","slug":"cisco-switch","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/942","title":{"rendered":"Cisco Switch"},"content":{"rendered":"\n<p>switch\u9762\u7248\u524d\u7684\u71c8\u865f\u6709<br><strong>system LED:<\/strong>\u986f\u793a\u7cfb\u7d71\u662f\u5426\u63a5\u6536\u5230\u96fb\u6e90\u4e26\u6b63\u5e38\u5de5\u4f5c<br>\u958b\u6a5fPOST\u6642,\u82e5\u7121\u71c8\u8868\u793a\u6e2c\u8a66\u57f7\u884c\u4e2d,\u7da0\u71c8\u8868\u793a\u6210\u529f,amber(\u9ec3\u8910\u8272)\u8868\u793apost\u5931\u6557<br><strong>RPS(remote power supply) LED :<\/strong>\u986f\u793a\u662f\u4e0d\u662f\u5728\u4f7f\u7528\u9060\u7aef\u7684\u96fb\u6e90\u4f9b\u61c9<br><strong>port LEDs:<\/strong><br>\u958b\u6a5f\u6642\u82e5\u71c8\u865f\u70baamber\u8868\u793a\u6b63\u5728\u6aa2\u67e5,\u82e530sec\u5f8c\u8f49\u70ba\u7da0\u71c8\u8868\u793a\u6b63\u5e38,\u8f49amber\u71c8\u8868\u793a\u6709\u554f\u984c,\u82e5\u7121\u71c8\u8868\u793a\u8a72port\u5075\u6e2c\u4e0d\u5230\u9023\u7dda<br>\u900f\u904emode\u6309\u9215\u53ef\u9078\u64c7\u4ee5\u4e0b\u6a21\u5f0f<br>\u3000port mode<br>\u3000port status<\/p>\n\n\n\n<p>cisco switch\u5728auto-negotiation\u6703\u6839\u64dapriority table\u8868\u6c7a\u5b9aport mode,\u5982\u4e0b<br>Priority: Ethernet Mode<br>7: 100BASE-T2 (full duplex)<br>6: 100BASE-TX (full duplex)<br>5: 100BASE-T2<br>4: 100BASE-T4<br>3: 100BASE-TX<br>2: 10BASE-T (full duplex)<br>1: 10BASE-T<br>ps:\u672a\u6a19\u6ce8full duplex\u5247\u70bahalf duplex<\/p>\n\n\n\n<p>&#8230;&#8230;<\/p>\n\n\n\n<p><strong>Operations Within a Layer 2 Catalyst Switch<\/strong><br>1<br>RX switch port<br>2<br>Ingress Queues<br>3<br>follows decisions are made simultaneously by independent portions of switching hardware<br>(TCAM)Security ACLs Inbound and Outbound<br>(TCAM)QoS ACLs Classification and Policing<br>(CAM)L2 Forwarding Table<br>4<br>Egress Queues<br>5<br>TX Switch Ports<\/p>\n\n\n\n<p><strong>L2 forwarding table<\/strong><br>\u5982\u540cmac table<br><strong>Security ACLs<\/strong><br>ACL can be used to identify frames according to their MAC addresses, protocol types (for non-IP frames), IP addresses, protocols, and Layer 4 port numbers.<br>The TCAM contains ACLs in a compiled form&nbsp;so that a decision can be made on whether to forward a frame in a single table lookup.<br><strong>QoS ACLs<\/strong><br>Other ACLs can classify incoming frames according to QoS parameters, to police or control the rate of traffic flows, and to mark QoS parameters in outbound frames.<br>The TCAM also is used to make these decisions in a single table lookup.<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<\/p>\n\n\n\n<p><strong>cisco catalyst switch\u4f7f\u7528\u7684MLS\u6280\u8853\u5982\u4e0b<\/strong><br>route caching(first-generation MLS)<br>topology-based (second-generation MLS)<br>ps:<br>only the topology-based is supported in the CiscoIOS Software-based switch families, such as the Catalyst 3750, 4500, and 6500<br>ps<br>switching methods\u7531\u5feb\u5230\u6162\u5206\u5225\u662f<br>dCEF, CEF, fast switching, process switching<\/p>\n\n\n\n<p><strong>Route caching<\/strong><br>requiring a RP(route processor) and a SE(switch engine).<br>\u3000The RP must process a traffic flow&#8217;s first packet to determine the destination.<br>\u3000The SE listens to the first packet and to the resulting destination, and sets up a &#8220;shortcut&#8221; entry in its MLS cache.<br>The SE forwards subsequent packets in the same traffic flow based on shortcut entries in its cache.<br>ps:<br>Even if this isn&#8217;t used to forward packets in Cisco IOS-based Catalyst switches, the technique generates traffic flow information and statistics.<br>ps:<br>This type of MLS also is known by the names<br>fast switching,Netflow LAN switching,&nbsp;flow-based\/demand-based switching, and &#8220;route once, switch many.&#8221;<\/p>\n\n\n\n<p><strong>Topology-based\/CEF<\/strong>&nbsp;(utilizing specialized hardware.)<br>Layer 3 routing information builds and prepopulates a single<strong>&nbsp;database<\/strong>&nbsp;of the entire network topology.<br>1. This database, an efficient table lookup in hardware, is consulted so that packets can be forwarded at high rates.<br>2. The longest match found in the database is used as the correct Layer 3 destination.<br>3. As the routing topology changes over time, the database contained in the hardware can be updated dynamically with no performance penalty<\/p>\n\n\n\n<p>&#8230;&#8230;.<\/p>\n\n\n\n<p><strong>Operations Within a Multilayer Catalyst Switch<\/strong><br>1<br>RX switch port<br>2<br>Ingress Queues<br>3<br>To forward packets using the simultaneous decision processes<br>\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b4\u500b\u540c\u6642\u88ab\u57f7\u884c<br>(TCAM)Security ACLs Inbound and Outbound<br>(TCAM)QoS ACLs Classification and Policing<br>(FIB)L3 Forwarding Table<br>(CAM)L2 Forwarding Table<br>4<br>L3 Packet Rewrite<br>5<br>Egress Queues<br>6<br>TX Switch Ports<\/p>\n\n\n\n<p><br>all these multilayer decisions are performed simultaneously in hardware<br><strong>L2 forwarding table<\/strong><br>\u5982\u540cmac table<br>If the frame contains a Layer 3 packet to be forwarded, the destination MAC address is that of a Layer 3 port on the switch.<br>In this case, the CAM table results are used only to decide that the frame should be processed at Layer 3.<br><strong>(FIB)L3 forwarding table<\/strong><br>The FIB table is consulted, using the destination IP address as an index.<br>The longest match in the table is found (both address and mask), and the resulting next-hop Layer 3 address is obtained.<br>The FIB also contains each next-hop entry&#8217;s Layer 2 MAC address and the egress switch port (and VLAN ID) so that further table lookups are not necessary.<br>\u6b04\u4f4d\u5305\u62ec\u4ee5\u4e0b<br>\u3000IP Address<br>\u3000Next-Hop IP Addr<br>\u3000Next-Hop MAC Addr<br>\u3000Egress Port<br><strong>Security ACLs<\/strong><br>Inbound and outbound access lists are compiled into TCAM entries so that decisions of whether to forward a packet can be determined as a single table lookup.<br><strong>QoS ACLs<\/strong><br>Packet classification, policing, and marking all can be performed as single table lookups in the QoS TCAM.<\/p>\n\n\n\n<p><strong>rewritten<\/strong><br>Because the contents of the Layer 3 packet (the TTL value) have changed, the Layer 3 header checksum must be recalculated.<br>And because both Layers 2 and 3 contents have changed, the Layer 2 checksum must be recalculated.<br>In other words, the entire Ethernet frame must be rewritten before it goes into the egress queue.<br>This also is accomplished efficiently in hardware<\/p>\n\n\n\n<p><strong>Multilayer Switching Exceptions<\/strong><br>it is flagged for further processing and sent or &#8220;punted&#8221; to the switch CPU for process switching<br>If a packet meets criteria such as the following:<br>\u25a0 ARP requests and replies<br>\u25a0 IP packets requiring a response from a router<br>(TTL has expired, MTU is exceeded, fragmentation is needed, and so on)<br>\u25a0 IP broadcasts that will be relayed as unicast<br>(DHCP requests, IP helper-address functions)<br>\u25a0 Routing protocol updates<br>\u25a0 Cisco Discovery Protocol packets<br>\u25a0 IPX routing protocol and service advertisements<br>\u25a0 Packets needing encryption<br>\u25a0 Packets triggering Network Address Translation (NAT)<br>\u25a0 Other non-IP and non-IPX protocol packets (AppleTalk, DECnet, and so on)<\/p>\n\n\n\n<p><br>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<\/p>\n\n\n\n<p><strong>CAM(Content-Addressable Memory)<\/strong><br>1. \u5982\u540cmac table<br>2. All Catalyst switch models use a CAM table for Layer 2 switching.<br>3. \u6b04\u4f4d\u5305\u62ec\u4ee5\u4e0b<br>\u3000MAC Address<br>\u3000Egress Port<br>\u3000VLAN<br>ps:\u904b\u4f5c\u65b9\u5f0f<br>1. The port of arrival and the VLAN both are recorded in the table,<strong>&nbsp;along with a timestamp<\/strong>.<br>2.1 If a MAC address learned on one switch port has moved to a different port, the MAC address and timestamp are recorded for the most recent arrival port. Then, the previous entry is deleted.<br>2.2 If a MAC address is found already present in the table for the correct arrival port, only its timestamp is updated<\/p>\n\n\n\n<p><strong>CAM manage<\/strong><br>To manage the CAM table space, stale entries (addresses that have not been heard from for a period of time) are aged out.<br>By default, idle CAM table entries are kept for&nbsp;<strong>300 seconds<\/strong>&nbsp;before they are deleted<\/p>\n\n\n\n<p><strong>MAC\u7570\u52d5\u904b\u4f5c\u65b9\u5f0f<\/strong><br>case1<br>when a host&#8217;s MAC address is learned on one switch port, and then the host moves so that it appears on a different switch port<br>switch\u7684\u884c\u70ba\u5982\u4e0b<br>To avoid having duplicate CAM table entries, a switch purges(\u4e0d\u9700\u8981\u7b49\u5f85300\u79d2) any existing entries for a MAC address that has just been learned on a different switch port<br>case2<br>If a switch notices that a MAC address is being learned on alternating switch ports,<br>switch\u7684\u884c\u70ba\u5982\u4e0b<br>it generates an error message that flags the MAC address as&nbsp;<strong>&#8220;flapping&#8221;<\/strong>&nbsp;between interfaces.<\/p>\n\n\n\n<p><br>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<\/p>\n\n\n\n<p><strong>TCAM(Ternary Content-Addressable Memory)<\/strong><br>The Catalyst IOS Software has two components that are part of the TCAM operation:<br><strong>FM(Feature Manager)<\/strong><br>After an access list has been created or configured, the FM software compiles, or merges, the ACEs into entries in the TCAM table.<br>The TCAM then can be consulted at full frame-forwarding speed.<br><strong>SDM(Switching Database Manager)<\/strong><br>You can partition the TCAM on some Catalyst switches into areas for different functions.<br>The SDM software configures or tunes the TCAM partitions, if needed.<br>(The TCAM is fixed on Catalyst 4500 and 6500 platforms and cannot be repartitioned.)<\/p>\n\n\n\n<p>ps:<br><strong>compare<\/strong><br>1.In traditional routing,<br>ACLs can match, filter, or control specific traffic.<br>Access lists are made up of one or more ACE or matching statements that are evaluated in sequential order.<br>Evaluating an access list can&nbsp;<strong>take up additional time, adding to the latency<\/strong>&nbsp;of forwarding packets.<br>2.In multilayer switches, however,<br>all the matching process that ACLs provide is implemented in hardware.<br>TCAM allows a packet to be evaluated against an entire access list in a single table lookup.<br>Most switches have multiple TCAMs so that both inbound and outbound security and QoS ACLs can be evaluated&nbsp;<strong>simultaneously<\/strong>, or entirely&nbsp;<strong>in parallel<\/strong>&nbsp;with a Layer 2 or Layer 3 forwarding decision.<br>ps:<br>access control entities (ACE)<\/p>\n\n\n\n<p><strong>concept<\/strong><br>The TCAM is an extension of the CAM table concept<br>TCAM also uses a table-lookup operation but is greatly enhanced to allow a more abstract operation<br>ex:<br>binary values (0s and 1s) make up a key into the table, but a mask value also is used to decide which bits of the key are actually relevant.<br>This effectively makes a key consisting of three input values: 0, 1, and X (don&#8217;t care) bit values-a three-fold or ternary combination.<\/p>\n\n\n\n<p>TCAM entries are composed of VMR(Value,Mask,Result) combinations<br><strong>Values<\/strong><br>be always 134-bit quantities, consisting of src and dst addr and other relevant protocol information &#8211; all patterns to be matched.<br>\u6b04\u4f4d\u6709:IP Protocol,IP ToS,Source IP,Src port,S Port LOU,Dest IP,Dest port,D Port LOU<br>The information concatenated to form the value depends on the type of access list<br>Values in the TCAM come directly from any address, port, or other protocol information given in an ACE.<br>\u3000<strong>Access List Type:<\/strong>&nbsp;Value and Mask Components, 134 Bits Wide (Number of Bits)<br>\u3000<strong>Ethernet:<\/strong>&nbsp;Source MAC (48), destination MAC (48), Ethertype (16)<br>\u3000<strong>ICMP:<\/strong>&nbsp;Source IP (32), destination IP (32), protocol (16), ICMP code (8), ICMP type (4), IP type of service (ToS) (8)<br>\u3000<strong>Extended IP using TCP\/UDP:<\/strong>&nbsp;Source IP (32), destination IP (32), protocol (16), IP ToS (8), source port (16), source operator (4), destination port (16),destination operator (4)<br>\u3000<strong>Other IP:<\/strong>&nbsp;Source IP (32), destination IP (32), protocol (16), IP ToS (8)<br>\u3000<strong>IGMP:<\/strong>&nbsp;Source IP (32), destination IP (32), protocol (16), IP ToS (8),IGMP message type (8)<br>\u3000<strong>IPX:<\/strong>&nbsp;Source IPX network (32), destination IPX network (32), destination node (48), IPX packet type (16)<br><strong>Masks<\/strong><br>are 134-bit quantities, in exactly the same format, or bit order, as the values.<br>Masks select only the value bits of interest; a mask bit is set to exactly match a value bit or is not set for value bits that do not matter.<br>The masks used in the TCAM stem from address or bit masks in ACEs<br><strong>Results<\/strong><br>are numeric values that represent what action to take after the TCAM lookup occurs.<br>Whereas traditional access lists offer only a permit or deny result, TCAM lookups offer a number of possible results or actions.<br>ex:<br>the result can be a permit or deny decision, an index value to a QoS policer, a pointer to a next-hop routing table, and so on.<\/p>\n\n\n\n<p>The TCAM always is organized by masks, where each unique mask has eight value patterns associated with it.<br>ex:<br>the Catalyst 6500 TCAM (one for security ACLs and one for QoS ACLs) holds up to 4096 masks and 32,768 value patterns.<br>The trick is that each of the mask-value pairs is evaluated simultaneously, or in parallel, revealing the best or longest match in a single table lookup.<\/p>\n\n\n\n<p><strong>Port Operations in TCAM<\/strong><br>1. If an ACE has a port operator<br>ex:( such as gt, lt, neq, or range,)<br>access-list 100 deny udp any 192.168.5.0 0.0.0.255 gt 1024<br>access-list 100 deny udp any 192.168.199.0 0.0.0.255 range 1024 2047<br>the FM software compiles the TCAM entry to include the use of the operator and the operand in a&nbsp;<strong>LOU(logical operation unit) register.<\/strong><br>Only a limited number of LOUs are available in the TCAM<br>ex:<br>LOU register pairs<br>A.1( gt 1024) , A.2( )<br>B.1(range start 1024) , B.2(range end 2047)<br>ps:<br>If there are more ACEs with comparison operators than there are LOUs, the FM must break up the ACEs into multiple ACEs with only regular matching (using the eq operator).<br>2.The FM checks all ACEs for Layer 4 operation and places these into LOU register pairs.<br>3.These can be loaded with operations, independent of any other ACE parameters.<br>4.The LOU contents can be reused if other ACEs need the same comparisons and values.<br>5.After the LOUs are loaded, they are referenced in the TCAM entries that need them.<br>ps:<br>A finite number (actually, a rather small number) of LOUs are available in the TCAM, so the FM software must use them carefully.<\/p>\n\n\n\n<p><strong>TCAM resources<\/strong><br>TCAMs have a limited number of 1)usable mask, 2)value pattern, and 3)LOU entries.<br>If access lists grow to be large or many Layer 4 operations are needed, the TCAM tables and registers&nbsp;<strong>can overflow.<\/strong><br>If that happens while you are configuring an ACL, the switch will generate syslog messages that<strong>&nbsp;flag the TCAM overflow situation<\/strong>&nbsp;as it tries to compile the ACL into TCAM entries.<\/p>\n\n\n\n<p><strong>\u9032\u5165punting(\u5e73\u677f\u50b3\u8f38)<\/strong><br>\u7576TCAM\u7121\u6cd5\u7528\u4f86\u8f49\u9001\u8cc7\u6599\u6d41,\u7cfb\u7d71\u6703\u81ea\u52d5\u7528CPU\u4f86\u8655\u7406,\u4f46\u8655\u7406\u6548\u80fd\u6709\u9650<br>\u53ef\u80fd\u539f\u56e0:TCAM\u5bb9\u91cf\u5df2\u6eff<br>\u89e3\u6c7a\u65b9\u5f0f:\u63db\u6210\u9ad8\u5bb9\u91cfTCAM\u4ea4\u63db\u5668,\u6216\u6e1b\u5c11TCAM\u4e2d\u9805\u76ee<br>ps:\u53ef\u6839\u64da\u8a2d\u5099\u7684\u67e5\u9a57\u6307\u4ee4\u78ba\u8a8dTCAM\u4f7f\u7528\u7387<br>ps:punting\u7684\u60c5\u6cc1\u9084\u5305\u62ec,\u786c\u9ad4\u672a\u652f\u63f4\u7684\u529f\u80fd,\u9060\u7aef\u767b\u5165,\u7b49&#8230;&nbsp;<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<\/p>\n\n\n\n<p>\u5728switch\u8a2d\u5b9a\u9810\u8a2d\u9598\u9053<br><strong>(config)#ip default-gateway &lt; ip&gt;<\/strong><br>\u82e5\u5c01\u5305\u4e0d\u77e5\u5f80\u90a3\u9001,\u5247\u9001\u53bb\u9810\u8a2d\u9598\u9053<br>ps:\u82e5\u60f3\u8b93switch\u5f9e\u9060\u7aef\u9023\u5165\u5efa\u8b70\u8a2d\u5b9a,\u4ee5\u5354\u52a9\u56de\u61c9\u62b5\u9054\u9060\u7aef<\/p>\n\n\n\n<p><br>\u5728multilayer switch\u4e0a\u555f\u52d5route\u529f\u80fd<br><strong>(config)#ip routing<\/strong><\/p>\n\n\n\n<p><br>\u4ee5macro\u547d\u4ee4\u6307\u5b9a\u55ae\u4e00\u4e3b\u6a5f\u4ecb\u9762<br><strong>Switch(config-if)# switchport host<\/strong><br>\u6703\u767c\u751f\u4ee5\u4e0b\u3000<br>switchport mode will be set to access<br>spanning-tree portfast will be enabled<br>channel group will be disabled<\/p>\n\n\n\n<p><br><strong>multilayer switch interface mode<\/strong><br>Layer 2 mode:layer2\u4ecb\u9762,\u4e00\u822cswitch \u4ecb\u9762<br>Layer 3 mode:layer3\u4ecb\u9762,\u53ef\u8a2dip,\u6709\u652f\u63f4\u7b2c\u4e09\u5c64\u7684switch\u4ecb\u9762<br>ps:<br>every switch port on<br>\u3000most Catalyst switch: is a Layer 2 interface,<br>\u3000Catalyst 6500: is a Layer 3 interface<\/p>\n\n\n\n<p><br>\u8a2d\u5b9amultilayer switch interface\u70balayer2 mode<br><strong>Switch(config-if)# switchport<\/strong><\/p>\n\n\n\n<p>\u8a2d\u5b9amultilayer switch interface\u70balayer3 mode<br><strong>Switch(config-if)# no switchport<\/strong><br><strong>Switch(config-if)# ip address &lt; ip &gt; mask [secondary]<\/strong><br>ps:<br>the EtherChannel can also become a Layer 3 port.<br>ps:<br>\u82e5layer1,2\u90fd\u7121\u6cd5\u4f5c\u696d\u6642\uff0c\u5247\u8a72\u4ecb\u9762\u8996\u70ba\u95dc\u9589\u72c0\u614b\u3000<br>\u8a72\u4ecb\u9762\u7121\u6cd5\u53c3\u8207STP,DTD\u7b49\u4ea4\u63db\u5354\u5b9a<\/p>\n\n\n\n<p>\u5728\u6307\u5b9aVLAN\u5167\u8a2d\u5b9aSVI<br>Switch(config)# interface vlan &lt; vlan-id&gt;<br><strong>Switch(config-if)# ip address &lt; ip &gt; mask [secondary]<\/strong><br><strong>Switch(config-if)# no shutdown<\/strong><br>ps:\u82e5vlan\u4e2d\u6c92\u6709\u4efb\u4f55\u4ecb\u9762\u904b\u4f5c\uff0c\u5247SVI\u88ab\u8996\u70ba\u95dc\u9589\u72c0\u614b<\/p>\n\n\n\n<p>Verifying interface mode<br><strong># show interface &lt; interface &gt; switchport<\/strong><br>\u8f38\u51fa\u7684Switchport\u986f\u793a:<br>\u3000Disabled: \u8a72\u4ecb\u9762\u70balayer3 mode<br>\u3000Enabled: \u8a72\u4ecb\u9762\u70balayer2 mode<br>ps:<br>router\u4ecb\u9762\u9810\u8a2d\u70baDisabled,switch\u4ecb\u9762\u548cSVI\u9810\u8a2d\u70baEnabled<br>ps:<br>\u82e5SVI\u986f\u793aswitchport:Disabled\u5247\u53ef\u80fd\u6709\u4ee5\u4e0b\u539f\u56e0<br>the interface is disabled with the shutdown command<br>the VLAN itself has not been defined on the switch.<br>ps:<br>show interface switchport\u70ba\u4f8b,\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>namee: Gi4\/2<br>Switchport: Enabled<br>Administrative Mode: trunk<br>Operational Mode: trunk \/\/\u82e5\u70badown\u8868\u793a\u4ecb\u9762\u6c92\u5728\u904b\u4f5c<br>[omitted]<\/p>\n\n\n\n<p><br>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<\/p>\n\n\n\n<p><br>to configure static CAM table entries<br><strong>(config)# mac address-table static &lt; mac-address&gt; vlan interface &lt; interface&gt;<\/strong><br>\u56e0\u4e0d\u7528\u6bcf\u6b21\u90fdflood\u4f86\u5b78\u7fd2\u52d5\u614b\u4f4d\u7f6e,\u56e0\u6b64\u53ef\u7bc0\u7701\u983b\u5bec<br>ex:\u8a2d\u5b9a2950switch fa0\/5\u662f\u75311111.1111.1111\u7684mac\u4f4d\u7f6e\u548cvlan1\u5b58\u53d6<br>2950(config)#mac-address-table static 1111.1111.1111 vlan 1 int fa0\/5<br>ps:\u65e9\u671f\u82e5\u6b64mac\u82e5\u51fa\u73fe\u5728\u4e0d\u540c\u7684PORT,\u5247\u6b64\u6a5f\u5668\u7121\u6cd5\u4e0a\u7db2<br>ps:1900(config)#mac-address-table permanent<\/p>\n\n\n\n<p>to clear CAM table entries<br><strong>Switch# clear mac address-table dynamic [address &lt; mac&gt; | interface &lt; interface&gt; | vlan &lt; vlan-id&gt;]<\/strong><br>\u82e5\u4e0d\u60f3\u7b49\u5f85\u52d5\u614b\u4f4d\u7f6e\u6642\u9593\u5230\u6642\u624d\u88ab\u79fb\u9664\u53ef\u624b\u52d5\u7acb\u523b\u79fb\u9664<\/p>\n\n\n\n<p>to change the CAM table entries aging-time<br><strong>Switch(config)# mac address-table aging-time &lt; seconds&gt;<\/strong><br>default,300sec<\/p>\n\n\n\n<p>To view the contents of the CAM table<br><strong>#show mac address-table dynamic [address &lt; mac&gt; | interface &lt; interface&gt; | vlan &lt; vlan-id&gt;]<\/strong><br>[address &lt; mac&gt;]: to specify a single MAC address<br>[interface &lt; interface&gt;] to see addresses that have been learned on a specific interface<br>[vlan &lt; vlan-id&gt;] to see addresses that have been learned on a specific vlan<br>ps:\u90e8\u4efd\u8a2d\u5099\u9700\u6539\u7528show mac-address-table<br>ps:<br>to find the learned location of the host with MAC address 0050.8b11.54da<br>#show mac address-table dynamic address 0050.8b11.54da<br>Mac Address Table<br>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br>Vlan Mac Address Type Ports<br>&#8212;- &#8212;&#8212;&#8212;&#8211; &#8212;- &#8212;&#8211;<br>54 0050.8b11.54da DYNAMIC Fa1\/0\/1<br>Total Mac Addresses for this criterion: 1<br>ex:<br>To see all the MAC addresses that are currently found on interface GigabitEthernet1\/0\/29<br>Switch# show mac address-table dynamic interface gigabitethernet1\/0\/29<br>Mac Address Table<br>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br>Vlan Mac Address Type Ports<br>&#8212;- &#8212;&#8212;&#8212;&#8211; &#8212;- &#8212;&#8211;<br>537 0013.7297.3d4b DYNAMIC Gi1\/0\/29<br>Total Mac Addresses for this criterion: 1<\/p>\n\n\n\n<p>ps:<br>\u8f38\u51fa\u7121\u7d50\u679c\u7684\u53ef\u80fd\u6709\u4ee5\u4e0b<br>1. showing nothing about the interface and VLAN where the MAC address is found.<br>2. the host has not sent a frame that the switch can use for learning its location,or something odd is going on.<br>3. the host is using two network interface cards (NIC) to load balance traffic;one NIC is only receiving traffic, whereas the other is only sending. Therefore, the switch never hears and learns the receiving-only NIC address<\/p>\n\n\n\n<p><br>To see the CAM table&#8217;s size<br><strong>Switch# show mac address-table count<\/strong><br>MAC address totals are shown for each active VLAN on the switch.<br>This can give you a good idea of the size of the CAMtable and how many hosts are using the network.<br>ps:<br>Switch# show mac address-table count<br>Mac Entries for Vlan 1:<br>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br>Dynamic Address Count : 0<br>Static Address Count : 0<br>Total Mac Addresses : 0<br>Mac Entries for Vlan 2:<br>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br>Dynamic Address Count : 89<br>Static Address Count : 0<br>Total Mac Addresses : 89<br>Mac Entries for Vlan 580:<br>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br>Dynamic Address Count : 600<br>Static Address Count : 0<br>Total Mac Addresses : 600<br>Total Mac Address Space Available: 4810<\/p>\n","protected":false},"excerpt":{"rendered":"<p>switch\u9762\u7248\u524d\u7684\u71c8\u865f\u6709system LED:\u986f\u793a\u7cfb\u7d71\u662f\u5426 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[34],"tags":[],"class_list":["post-942","post","type-post","status-publish","format-standard","hentry","category-cisco-layer2"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=942"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/942\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}