duplex [full|half|auto]
Sets the duplex mode on a switch or router interface to full, half, or auto-negotiation.
Definition: duplex [full|half|auto] is a Cisco IOS interface config command. Sets the duplex mode on a switch or router interface to full, half, or auto-negotiation.
Overview
The `duplex` command in Cisco IOS is used to configure the duplex mode on a switch or router interface. Duplex mode determines how data is transmitted and received on a network link: half-duplex allows communication in both directions but only one direction at a time (like a walkie-talkie), full-duplex allows simultaneous two-way communication (like a telephone), and auto-negotiation allows the interface to automatically negotiate the best duplex setting with the connected device. This command is critical for ensuring optimal performance and avoiding duplex mismatches, which can cause severe packet loss, collisions, and throughput degradation.
Network engineers reach for this command when troubleshooting connectivity issues, especially when connecting to older devices that may not support auto-negotiation, or when manually setting interfaces in a controlled environment to guarantee performance. It fits into the broader configuration workflow during initial setup, after replacing hardware, or when diagnosing slow network performance. In Cisco IOS, the command is available in interface configuration mode, and changes take immediate effect on the running configuration.
It is important to note that on most modern Cisco switches, the default duplex setting is auto, and changing it to full or half disables auto-negotiation on that interface. A common pitfall is that if one side is set to auto and the other to full, the auto side will often fall back to half-duplex, causing a mismatch. The command requires privilege level 15 (enable mode) to configure.
The output is not buffered; changes are applied immediately. Understanding duplex settings is fundamental for CCNA and CCNP candidates as it directly impacts network reliability and performance.
duplex [full|half|auto]When to Use This Command
- Configuring a server port to full-duplex for maximum throughput.
- Setting a legacy hub-connected port to half-duplex to avoid collisions.
- Enabling auto-negotiation on a port connecting to an unknown device.
- Troubleshooting duplex mismatch by manually setting both ends to the same duplex.
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| full | full | Sets the interface to full-duplex mode, allowing simultaneous transmission and reception. This is typically used when connecting to devices that also support full-duplex and when you want to disable auto-negotiation. A common mistake is setting full-duplex on a hub or a device that only supports half-duplex, which will cause a duplex mismatch. |
| half | half | Sets the interface to half-duplex mode, allowing transmission or reception but not both simultaneously. This is used when connecting to older devices like hubs or when the cable length exceeds specifications for full-duplex. A common mistake is leaving an interface in half-duplex when the connected device supports full-duplex, leading to suboptimal performance. |
| auto | auto | Enables auto-negotiation on the interface, allowing it to automatically determine the duplex setting with the connected device. This is the default on most Cisco interfaces. A common mistake is assuming auto-negotiation always works; if the other device has a hard-coded duplex setting, auto-negotiation may fail and result in a mismatch. |
Command Examples
Set interface to full-duplex
interface GigabitEthernet0/1
duplex fullNo output is displayed when the command is entered. Use 'show interfaces GigabitEthernet0/1' to verify.
Verify duplex setting after configuration
show interfaces GigabitEthernet0/1GigabitEthernet0/1 is up, line protocol is up
Hardware is Gigabit Ethernet, address is 0011.2233.4455 (bia 0011.2233.4455)
MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 1000Mb/s, media type is RJ45
output flow-control is unsupported, input flow-control is unsupported
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of "show interface" counters never
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
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 0 multicast, 0 pause input
0 input packets with dribble condition detected
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 2 interface resets
0 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier, 0 pause output
0 output buffer failures, 0 output buffers swapped outThe line 'Full-duplex, 1000Mb/s' confirms the interface is operating in full-duplex mode at 1 Gbps. Other fields show interface status, errors, and traffic statistics.
Understanding the Output
The 'show interfaces' command displays the current duplex setting on the line showing duplex and speed (e.g., 'Full-duplex, 1000Mb/s'). A duplex mismatch is indicated by high numbers of collisions, late collisions, or CRC errors. For half-duplex, you would see 'Half-duplex'.
Auto-negotiation is shown as 'Auto-negotiation' or the negotiated duplex. Always verify both ends match to avoid performance issues.
Configuration Scenarios
Configure Full-Duplex on a Router Interface Connecting to a Switch
A router is connected to a switch that is configured for full-duplex. To avoid a duplex mismatch, the router interface must also be set to full-duplex. This scenario ensures optimal performance on a point-to-point link.
Topology
R1(Gi0/0)---10.0.12.0/30---(Gi0/1)SW1Steps
- 1.Step 1: Enter global configuration mode: Router> enable
- 2.Step 2: Enter interface configuration mode: Router# configure terminal
- 3.Step 3: Select the interface: Router(config)# interface GigabitEthernet0/0
- 4.Step 4: Set duplex to full: Router(config-if)# duplex full
- 5.Step 5: Optionally set speed to avoid auto-negotiation issues: Router(config-if)# speed 1000
- 6.Step 6: Exit and verify: Router(config-if)# end
! Full IOS config block Router> enable Router# configure terminal Router(config)# interface GigabitEthernet0/0 Router(config-if)# duplex full Router(config-if)# speed 1000 Router(config-if)# end
Verify: Use 'show interfaces GigabitEthernet0/0' to verify. Look for 'Full-duplex' in the output. Expected output snippet: 'GigabitEthernet0/0 is up, line protocol is up ... Full-duplex, 1000Mb/s'
Watch out: If the switch is set to auto-negotiation and the router is set to full-duplex, the switch may fall back to half-duplex, causing a mismatch. Always ensure both sides match.
Set Half-Duplex on a Switch Port Connected to a Legacy Hub
A legacy hub that only supports half-duplex is connected to a Cisco switch. The switch port must be manually set to half-duplex to prevent duplex mismatch and collisions.
Topology
SW1(Fa0/1)---Hub---PCsSteps
- 1.Step 1: Enter global configuration mode: Switch> enable
- 2.Step 2: Enter interface configuration mode: Switch# configure terminal
- 3.Step 3: Select the interface: Switch(config)# interface FastEthernet0/1
- 4.Step 4: Set duplex to half: Switch(config-if)# duplex half
- 5.Step 5: Set speed to 10 Mbps (hub speed): Switch(config-if)# speed 10
- 6.Step 6: Exit and verify: Switch(config-if)# end
! Full IOS config block Switch> enable Switch# configure terminal Switch(config)# interface FastEthernet0/1 Switch(config-if)# duplex half Switch(config-if)# speed 10 Switch(config-if)# end
Verify: Use 'show interfaces FastEthernet0/1' to verify. Look for 'Half-duplex' in the output. Expected output snippet: 'FastEthernet0/1 is up, line protocol is up ... Half-duplex, 10Mb/s'
Watch out: If the hub is actually a switch that supports full-duplex, setting half-duplex will degrade performance. Always verify the connected device's capabilities.
Troubleshooting with This Command
When troubleshooting network performance issues, the `duplex` command is often used in conjunction with `show interfaces` to identify duplex mismatches. Healthy output for a full-duplex link shows 'Full-duplex' and no excessive collisions or CRC errors. Problem indicators include 'Half-duplex' when full-duplex is expected, or a high number of 'runts', 'giants', 'CRC errors', or 'collisions'.
A common symptom is slow file transfers or intermittent connectivity. The diagnostic flow: 1) Check the interface status with `show interfaces`. 2) Look for duplex setting and error counters. 3) If errors are present, verify the duplex setting on both ends. 4) Use `show interfaces status` on switches to see negotiated duplex. 5) If mismatch is suspected, manually set both sides to the same duplex (preferably full-duplex if supported). 6) After changing, monitor the interface for error clearance. Correlate with `show logging` for duplex mismatch syslog messages.
On switches, `show interfaces trunk` can also help if VLAN issues are involved. Remember that auto-negotiation can fail if one side is hard-coded; the IEEE standard dictates that if a device cannot negotiate, it defaults to half-duplex. Therefore, if you hard-code one side, you must hard-code the other to the same settings.
Also, speed must match for duplex to work correctly; use the `speed` command in conjunction. For advanced troubleshooting, use `debug interface` with caution in production. The `duplex` command itself is not a troubleshooting command but a configuration command; however, checking its setting is crucial.
Always document the intended duplex settings for each interface to avoid future mismatches.
CCNA Exam Tips
CCNA exam expects you to know that duplex mismatch causes collisions and poor performance.
Remember that half-duplex is used with hubs; full-duplex is used with switches.
Auto-negotiation is the default on most Cisco interfaces; manual settings should match on both ends.
The 'duplex' command is available in interface configuration mode; use 'show interfaces' to verify.
Common Mistakes
Setting one end to full-duplex and the other to half-duplex, causing duplex mismatch and packet loss.
Forgetting that auto-negotiation must be enabled on both ends for it to work; manually setting duplex disables auto-negotiation.
Using 'duplex half' on a switch port connected to a server that expects full-duplex, reducing throughput.
duplex [full|half|auto] vs speed [10|100|1000|auto]
These two commands are commonly used together to manually configure Ethernet interface parameters, and are often confused because they both involve auto-negotiation and are typically set in the same interface configuration mode. Mismatching either setting with the connected device can cause link issues.
| Aspect | duplex [full|half|auto] | speed [10|100|1000|auto] |
|---|---|---|
| Scope | Only duplex mode (half, full, auto) | Only link speed (10, 100, 1000, auto) |
| Auto-negotiation interaction | If auto, advertises duplex; if manual, overrides advertised value | If auto, advertises speed; if manual, overrides advertised value |
| Effect on link negotiation | Duplex mismatch causes CRC errors, late collisions, high error rates | Speed mismatch often results in no link or constant link flaps |
| Common misconfiguration | Setting full-duplex on one side and auto on the other (duplex mismatch) | Setting speed manually on one side and auto on the other (speed mismatch) |
| Dependency | Duplex must be full for speed 1000; half/auto not allowed at 1000 Mbps | Speed setting does not depend on duplex, but some speeds restrict duplex |
Use duplex [full|half|auto] when you need to manually set the transmission mode to match a connected device that does not support or is misconfigured for auto-negotiation.
Use speed [10|100|1000|auto] when you need to fix a speed mismatch, force a specific speed for troubleshooting, or when connecting to legacy equipment that only supports fixed speeds.
Platform Notes
In IOS-XE, the `duplex` command syntax is identical to classic IOS. However, on some IOS-XE platforms like Catalyst 9000 series, the default duplex is auto and the command behaves the same. In NX-OS (Cisco Nexus switches), the equivalent command is `duplex` as well, but NX-OS uses a different interface configuration mode (e.g., `interface ethernet 1/1`).
The syntax is `duplex [full | half | auto]`. Note that on Nexus platforms, half-duplex is rarely used and only supported on certain copper ports. For ASA firewalls, the `duplex` command is available under interface configuration mode, similar to IOS, but ASAs typically use auto-negotiation by default.
In IOS-XR (Cisco routers), the command is `duplex` as well, but the interface naming convention differs (e.g., `interface GigabitEthernet0/0/0/0`). IOS-XR also supports `duplex` with the same options. There are no significant differences between IOS versions 12.x, 15.x, and 16.x for this command; the behavior is consistent.
However, on older IOS versions (12.x), some switches may not support auto-negotiation on all ports, so manual configuration was more common. Always check the specific platform documentation for any quirks.
Related Commands
interface [type] [number]
Enters interface configuration mode for a specific interface (e.g., GigabitEthernet0/1) to configure Layer 2 or Layer 3 parameters.
show interfaces
Displays detailed Layer 1 and Layer 2 statistics for all interfaces or a specific interface: line protocol state, hardware type, MAC address, MTU, bandwidth, duplex, speed, input/output rates, error counters, and queue statistics.
speed [10|100|1000|auto]
Sets the speed of a Cisco switch or router interface to a specific value or auto-negotiation.
Practice for the CCNA 200-301
Test your knowledge with practice questions covering all CCNA 200-301 exam domains.
Practice CCNA 200-301 Questions