Here are the most frequently used Interface commands as a quick reference/cheat sheet. This will help you remember the key interface configurations:
Important show commands
show interface !shows all interface details
show interface trunk !shows connected ports on switches that are in trunking mode
Interface Configuration Mode
To enter configuration mode for the interface, you must follow these steps:
Cell_Router# configure terminal
Cell_Router(config)# interface s0/0
Alternatively, you can configure a group of interfaces at the same time by using the interface range command. Here's an example:
Cell_Router(config)# interface range FastEthernet0/0 - 10
Once you're in Interface Configuration Mode, you can always enter help to view a list of commands.
Here are the important key ones:
We always use this command to add a description to a port though it is optional. By adding details using the description command, anyone working on the router will know, which saves time and could even prevent outages. Here's an example:
Cell_Router(config-if)# description Link to PE1
You can add even more information. For example:
Cell_Router(config-if)# description Level3 T1 to Internet call 888-555-5555 for support
By default, a Cisco router or switch shuts down all ports when started or powered on, meaning the ports aren't operational. However, this is different from a device such as a Linksys router; by default, all ports of one of these devices are operational when you turn on the device.
To enable ports for use, you can use the no shutdown command. This reverses the shutdown state and enables the port.
Cell_Router(config-if)# no shutdown
In addition to using this command the first time you use the ports, you would also use it after making extensive configuration changes to the port.
To put an IP address on a port, use the ip address command. When using this command, you must provide the IP address and subnet mask. Here's an example:
Cell_Router(config-if)# ip address 192.168.100.17 255.255.255.240
Alternatively, you can make the port broadcast and request a DHCP IP address by using the following command:
Cell_Router(config-if)# ip address dhcp
Like the description command, the bandwidth command is also optional. However, keep in mind that you use the bandwidth command only to tell routing protocols the preferred interface-it doesn't dictate the actual bandwidth of the port. See our Tech Tip on this elsewhere on this page.
Below is an example. Note that the specified bandwidth value is in Kb, so 512 is a 512-Kb circuit.
Cell_Router(config-if)# bandwidth 512
It's a common practice to apply an access list to an interface to control traffic coming in or going out. For help on using Access Lists seeour Tech Tip elsewhere on this page.
For example, let's say you created an access list called 'NoFTPout', here is how you would apply it to the interface:
Cell_Router(config-if)# ip access-group NoFTPout out
duplex and speed
You only use the duplex and speed commands when connecting a router or switch to another device for the first time. However, these commands are very important because the duplex and speed of an Ethernet interface must match the interface on the other side. If you have experienced problems with performance or interfaces going down, you may discover that the speed or duplex didn't match on each side of the connection.
Here's an example of setting an Ethernet port to 100Mb Full duplex:
Cell_Router(config-if)# speed 100
Cell_Router(config-if)# duplex full
By default, these should autonegotiate. This usually works-but not always. If the autonegotiation doesn't work or doesn't work consistently, you may end up using these commands.
You only use the switchport command on switches-not routers. It can put a port into trunk mode, into a certain VLAN, or even to set port security.
Its most common use is to configure an interface to connect to an access device (e.g., workstation, server, printer, etc.). Here's an example:
Cell_Switch(config-if)# switchport mode access
You can also use this command to put a port in a certain VLAN:
Cell_Switch(config-if)# switchport access vlan 10
We hope this cheat sheet helps with Interfaces.