3.3 Ports Configuration Commands

Configure Port Speed, Advertise Duplex, Advertise Speed, Flow Control, PFC (Priority Flow Control), Maximum Frame Size, Excessive Collision mode, and Frame Length Check.

Use this command to enable/disable Ethernet port (has no effect on PoE power).

Command Syntax:

shutdown
Table 3-18. Command Description

Argument

Description

Parameter

N.A

N.A

Default

N.A

Mode

Port List Interface Configuration mode

Usage

Use the command to disable the specified interface and use ‘no’ form of this command to enable the interface.

Example

Example 1:

Disable port 1.

# configure terminal
(config)# interface GigabitEthernet 1/1
(config-if)# shutdown 

Example 2:

Disable ports 1 through 4.

# configure terminal
(config)# interface GigabitEthernet 1/1-4
(config-if)# shutdown

Example 3:

Enable all ports.

# configure terminal
(config)# interface *
(config-if)# no shutdown

Use this command to configure the port speed.

Command Syntax:

speed { 10 | 100 | 1000 | auto { [ 10 ] [ 100 ] [ 1000 ] { [ no-hdx ] | [ no-fdx ] } } }
Table 3-19. Command Description

Argument

Description

Parameter

10

10 Mbps

100

100 Mbps

1000

1000 Mbps (1 Gbps)

auto

Auto negotiation

no-hdx

Only advertise full duplex

no-fdx

Only advertise half duplex

Default

All ports are set to Auto

Mode

Port List Interface mode

Usage

Use this command to set the speed of the specified interface.

Example

Example 1:

Set speed for port 1 to 100 Mbps.

# configure terminal
(config)# interface GigabitEthernet 1/1
(config-if)# speed 100

Example 2:

Set all ports to 1 Gbps.

# configure terminal
(config)# interface *
(config-if)# speed 1000

Use this command to configure the interface duplex mode.

Command Syntax:

duplex { half | full | { auto [ half | full ] } }
Table 3-20. Command Description

Argument

Description

Parameter

half

Half duplex when speed is forced (non-auto)

full

Full duplex when speed is forced (non-auto)

auto

Auto negotiation of duplex mode (obsolete, but still supported in startup-config)

Default

All ports are set to Auto

Mode

Port List Interface mode

Usage

Use to set the duplex mode of the specified interface. To set duplex to the default, use the ‘no’ form of the command.

Example

Example 1:

Set duplex for port 1 to half.

# configure terminal
(config)# interface GigabitEthernet 1/1
(config-if)# duplex half

This command configures the flow control for the interface (to slow packet transition temporarily upon request, or, for packet reception, to signal the remote transmitter to temporarily slow down its packet transition whenever switch reception buffer becomes to full). PFC and flowcontrol cannot both be enabled on the same port.

Command Syntax:

flowcontrol { on | off }
priority-flowcontrol prio <prio>
Table 3-21. Command Description

Argument

Description

Parameter

on

Enable flowcontrol.

off

Disable flowcontrol.

<prio>

Range of priorities (for example, 0–4,7)

Default

All ports flow control receive and send is off. Priority flowcontrol is off

Mode

Port List Interface mode

Usage

Use to set the flow control and PFC for the interface. To revert to the default, use the ‘no’ form of the command.

Example

Example 1:

Enable flowcontrol for port 1.

# configure terminal
(config)# interface GigabitEthernet 1/1
(config-if)# flowcontrol on

Example 2:

Enable priority flowcontrol with 0–3 priorities for all ports.

# configure terminal
(config)# interface *
(config-if)# priority-flowcontrol prio 0-3

Use this command to specify maximum Ethernet frame size for the interface.

Command Syntax:

mtu <max_length>
Table 3-22. Command Description

Argument

Description

Parameter

<max_length>

Maximum frame size in bytes. The range is 1518–10240 bytes.

Default

All ports mtu 10240 bytes

Mode

Port List Interface mode

Usage

Use to set the maximum frame size for the interface. To return to the default, use the ‘no’ form of the command.

Example

Example 1:

Set mtu for port 1 to 1518.

# configure terminal
(config)# interface GigabitEthernet 1/1
(config-if)# mtu 1518

Example 2:

Set mtu for all ports to 1518.

# configure terminal
(config)# interface *
(config-if)# mtu 1518

Use this command to configure port transmit collision behavior.

Command Syntax:

excessive-restart 
Table 3-23. Command Description

Argument

Description

Parameter

N.A

N.A

Default

Discard frame after 16 collisions

Mode

Port List Interface mode

Usage

Use to set the maximum frame size for the interface. To return to the default, use the ‘no’ form of the command.

Example

Example 1:

Restart backoff algorithm after 16 collisions for port 1.

# configure terminal
(config)# interface GigabitEthernet 1/1
(config-if)# excessive-restart

Example 2:

Discard frame after 16 collisions for all ports.

# configure terminal
(config)# interface *
(config-if)# no excessive-restart

This command configures if frames with incorrect frame length in the EtherType/Length field shall be dropped.

Command Syntax:

frame-length-check
Table 3-24. Command Description

Argument

Description

Parameter

N.A

N.A

Default

None

Mode

Port List Interface mode

Usage

Drop frames with mismatch between EtherType/Length field and actual payload size. To disable the frame check, use the ‘no’ form of the command.

Example

Example 1:

Disable frame length check for port 1.

# configure terminal
(config)# interface GigabitEthernet 1/1
(config-if)# no frame-length-check

Example 2:

Enable frame length check for all ports.

# configure terminal
(config)# interface *
(config-if)# frame-length-check