Thursday, June 21, 2012

Duplex Configuration : Simplified

Mismatched duplex settings can cause a network connection to perform poorly. Often a duplex mismatch is caused by a PC's network card or routers interface being configured to full or half duplex whilst the switch port being set to auto detect. If there is a duplex mismatch the CDP will report it, and these can be seen on screen by enabling the terminal monitor.

Below I have enabled terminal monitor and error messages are printed to the terminal.

switch1#terminal monitor 
switch1#
03:16:25: %CDP-4-DUPLEX_MISMATCH: duplex mismatch discovered on FastEthernet0/23 (not half duplex), with router1.lab.local Ethernet1 (half duplex).
switch1#
03:17:25: %CDP-4-DUPLEX_MISMATCH: duplex mismatch discovered on FastEthernet0/23 (not half duplex), with router1.lab.local Ethernet1 (half duplex).
switch1#

I can see that every 60 seconds as CDP packets are received I receive a warning that there is a duplex mismatch.

To very quickly check all the ports on my switch I use the following show command:

switch1#show interfaces status
Port Name Status Vlan Duplex Speed Type
Fa0/1 connected trunk a-full a-100 10/100BaseTX
Fa0/2 connected 1 a-full a-100 10/100BaseTX
Fa0/3 connected 1 a-full a-100 10/100BaseTX
Fa0/4 notconnect 1 auto auto 10/100BaseTX
Fa0/5 notconnect 1 auto auto 10/100BaseTX
Fa0/6 notconnect 1 auto auto 10/100BaseTX
Fa0/7 notconnect 1 auto auto 10/100BaseTX
Fa0/8 notconnect 1 auto auto 10/100BaseTX
Fa0/9 notconnect 1 auto auto 10/100BaseTX
Fa0/10 notconnect 1 auto auto 10/100BaseTX
Fa0/11 notconnect 1 auto auto 10/100BaseTX
Fa0/12 notconnect 1 auto auto 10/100BaseTX
Fa0/13 notconnect 1 auto auto 10/100BaseTX
Fa0/14 notconnect 1 auto auto 10/100BaseTX
Fa0/15 notconnect 1 auto auto 10/100BaseTX
Fa0/16 notconnect 1 full auto 10/100BaseTX
Fa0/17 notconnect 2 auto auto 10/100BaseTX
Fa0/18 notconnect 2 auto auto 10/100BaseTX
Fa0/19 notconnect 2 auto auto 10/100BaseTX
Fa0/20 notconnect 2 auto auto 10/100BaseTX
Fa0/21 notconnect 2 auto auto 10/100BaseTX
Fa0/22 notconnect 2 auto auto 10/100BaseTX
Fa0/23 connected 2 full 10 10/100BaseTX
Fa0/24 connected trunk a-full a-100 10/100BaseTX
Po5 connected trunk a-full a-100 


From the output I can see that although most ports are set to auto, some are configured with specific speed and duplex settings. Fa0/1,2,3 and fa0/24 are configured to auto for duplex and speed but have detected that the connect devices are set to full duplex and 100Mb.

After connecting to router1 I can use a show command to take a good look at the interface settings and the counters.

router1#show interfaces ethernet 1 
Ethernet1 is up, line protocol is up 
Hardware is PQUICC_FEC, address is 000e.3884.8540 (bia 000e.3884.8540)
Internet address is 10.0.2.254/24
MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec, 
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Half-duplex, 10Mb/s
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:06, output 00:00:06, output hang never
Last clearing of "show interface" counters 23:42:46
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
3182 packets input, 362199 bytes, 0 no buffer
Received 1581 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input packets with dribble condition detected
9407 packets output, 644928 bytes, 0 underruns
35 output errors, 377 collisions, 0 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out


Example:

router1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
router1(config)#interface ethernet 1
router1(config-if)#duplex full
router1(config-if)#end


I verify the configuration and reset the counters on both interfaces so I can easily see if more issues occur.

router1#clear counters ethernet 1
Clear "show interface" counters on this interface [confirm]
router1#

switch1#clear counters fastEthernet0/23
Clear "show interface" counters on this interface [confirm]
switch1#
04:00:19: %CLEAR-5-COUNTERS: Clear counter on interface FastEthernet0/23 by vty0 (10.0.1.4)


It is always a good idea to configure interfaces on both servers and routers to match those of the switch rather than leave them at auto detect.

No comments: