5.2. Basic Interface Configuration CommandsThe following basic commands apply to just about any type of interface. 5.2.1. shutdownThe shutdown command disables an interface. The interface does not transmit packets after it has been shut down; all routing protocols are informed that the interface is unavailable. interface serial0 shutdown Use the no shutdown command to restart an interface that has been shut down: Router# config terminal Router(config)# interface serial 0 Router(config-if)# no shutdown There can be side effects to an interface shutdown . The nature of these side effects depends on the interface type. Table 5-2 shows some of the possible side effects. Table 5-2. Possible side effects of an interface shutdown
The
shutdown
command can also be applied to a subinterface. In this case, it stops protocol processing on that subinterface without
5.2.2. Interface DescriptionsAn interface's description shows up in the router's configuration and in the output from the show interfaces command. This description is for informational purposes only; it helps you remember the configuration of the interface. For example: interface serial0 description T1 Connection to Baltimore (Good place to document the circuit id!) Use the no form of this command to remove the description: no description 5.2.3. Setting the IP Address and Subnet Mask
Setting the IP address on an interface is
interface ethernet0 ip address 10.10.1.65 255.255.255.224 This command sets the interface IP address to 10.10.1.65 and the subnet mask to 255.255.255.224. 5.2.3.1. Secondary IP address(es)
The
secondary
keyword allows an interface to have more than one IP address. You can have as many secondary addresses as you like, but keep in mind that each will take processing power and will have an effect on the router. If you are using more than one secondary address,
For example, suppose we had an Ethernet segment with a 255.255.255.224 subnet, which allows 30
Figure 5-1. Using a secondary IP address
After a few minutes of panic, you weigh your options. One is to resubnet the network. You would then need to change the subnet masks on every machine, which is
The second, easier option is to add another subnet to the Ethernet segment by using the secondary command. In the old configuration, the original subnet was 10.10.1.64 with 30 hosts. In the new configuration, we add a second subnet, 10.10.1.96, to the segment: interface ethernet0 ip address 10.10.1.65 255.255.255.224 ip address 10.10.1.97 255.255.255.224 secondary Initially, the interface was assigned the address 10.10.1.65; we could assign .66 through .94 to hosts on the segment (.95 is reserved for broadcasts). After adding the .96 subnet, we can assign addresses 10.10.1.98 through 10.10.1.126 as well; .97 is assigned to the ethernet0 interface as its secondary address. We can go a step further and add yet another subnet, 10.10.1.128, by assigning 10.10.1.129 as an additional secondary address. This gives us a total of three subnets. We can add as many secondary addresses as we want. interface ethernet 0 ip address 10.10.1.65 255.255.255.224 ip address 10.10.1.97 255.255.255.224 secondary ip address 10.10.1.129 255.255.255.224 secondary Some pitfalls with secondary addresses are:
5.2.4. Other Common Interface CommandsYou will encounter the following commands frequently as you work with interfaces on Cisco routers:
Now let's look at some of the specific interface types you're likely to encounter. |