Configuring Ethernet Interface Features
Problem
You want to force a particular Ethernet speed or duplex setting.
Solution
Cisco routers allow you to adjust several different Layer 1 and 2 parameters on Ethernet interfaces, depending on the specific hardware. On interfaces that support more than one medium, you can specify which media type you want to use with the media-type command:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#interface FastEthernet0/0
Router1(config-if)#media-type 100BaseX
Router1(config-if)#duplex full
Router1(config-if)#speed 100
Router1(config-if)#exit
Router1(config)#end
Router1#
You can also adjust parameters such as the ARP timeout interval, the MAC address, and the keepalive timer on the interface:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#interface FastEthernet0/0
Router1(config-if)#mac-address
Router1(config-if)#
0AAA.ABCD.0101
arp timeout
Router1(config-if)#
60
keepalive
Router1(config-if)#
5
exit
Router1(config)#end
Router1#
Discussion
Most of the time, you will just want to use the default options when setting up Ethernet interfaces. By default, most Ethernet modules will automatically sense which media type is in use, as well as the duplex and speed settings. In this example, we have explicitly forced the router to use its 100BaseX medium, full duplex, and 100Mbps speed settings:
Router1(config)#interface FastEthernet0/0
Router1(config-if)# ...
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.