Escolar Documentos
Profissional Documentos
Cultura Documentos
Interface Commands
Interface configuration is one of the most fundamental aspects of getting a router online.
There are many kinds of interfaces, corresponding to different physical media and lowerlevel protocols; some of the interface types are listed in Table 5-1. For the most part, each
media type has its own configuration commands, although a few commands are common to
all interfaces. The interface is where much of IP configuration takes place: it's where you
set addresses and netmasks and specify how the interface interacts with the routing protocol
you have chosen.
Description
async
Async lines are for modem dial-in and dial-out connections. The AUX port is
an async line. Terminal servers have numerous async lines for modem
connections.
atm
serial
Serial ports are often connected to CSU/DSUs for point-to-point leased lines
(56k, T1, etc.).
ethernet
tokenring
fddi
hub
hssi
Description
loopback
null
Bit bucket interface. Anything sent to this interface is discarded. Used for
simple route filtering.
pos
vlan
serial 0
serial 1
ethernet 0
ethernet 1
Serial port 0
Serial port 1
Ethernet port 0
Ethernet port 1
On high-end routers, the interface cards are in slots; each slot has a series of ports. To
specify these interfaces, use the slot /port naming scheme. For example, the Ethernet
interface on port 5 of the card in slot 4 would be called:
interface ethernet 4/5
The interface command is followed by other commands that perform the actual
configuration. If you're entering commands at the console, the interface command
changes the prompt to Router(config-if)#.
VIP2 (Versatile Interface Processor) cards have two Ethernet ports per card. To
accommodate these cards, use the syntax card/slot/port to specify a particular Ethernet
interface. For example, Fast Ethernet card 2 on slot 1 on port 0 would be called:
interface fastethernet 2/1/0
5.2.1. shutdown
The 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.
Ethernet
Serial
FDDI
Token ring
The shutdown command can also be applied to a subinterface. In this case, it stops protocol
processing on that subinterface without affecting the other subinterfaces or dropping the
entire interface.
This command sets the interface IP address to 10.10.1.65 and the subnet mask to
255.255.255.224.
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 time-consuming.
Even if you are using DHCP, a massive network reorganization is bound to be timeconsuming and disruptive for your users.
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
Routing updates are not sent out to secondary subnets due to split horizon. For a
definition of split horizon and how it relates to routing, see Chapter 8. However,
split horizon can be disabled.
Too many secondary IP addresses often means you are doing something wrong with
your network design.
Host broadcasts may or may not be heard by hosts on the other subnets, depending
on the broadcast address used by the host and the hosts' implementations.
bandwidth
The bandwidth command does not have anything to do with configuring the speed
of an interface. Rather, it defines the interface speed for calculating routing metrics
and other purposes. You would use this command to tell the router the interface's
actual speed if for some reason the default bandwidth was not correct (for example,
for a fractional T1 line, the router will use the speed of a full T1 as the default
bandwidth), or to "lie" about an interface's bandwidth to influence route metric
calculations and steer traffic in a particular direction. Obviously, giving the router
incorrect information about an interface's bandwidth is an iffy proposition, but there
are times when that's the easiest way to achieve the result you want.
ip directed-broadcasts
A directed broadcast is a broadcast that is sent to a specific network or set of
networks. They are frequently used in denial-of-service attacks, in which someone
outside your network tries to overwhelm it with illegitimate traffic. To reduce your
vulnerability to such attacks, Cisco routers drop directed broadcasts by default. To
enable forwarding of directed broadcasts, use the ip directed-broadcasts
command.
ip proxy-arp
Enabling proxy ARP on an interface allows the router to respond to ARP requests
for hosts that it knows about, but that aren't directly reachable by the host making
the ARP request. If the router receives an ARP request for a host and the router has a
route to that host, the router sends an ARP response with its own data link address to
the requestor. The requesting host then sends packets to the router, who in turn
forwards them on to the correct destination host.
For example, a host connected via a PPP dial-up link won't be visible to hosts
connected to the router via an Ethernet. If a host on an Ethernet sends an ARP
request for a host connected via PPP, the router will respond to the ARP request on
behalf of the PPP host, listing its own Ethernet address as the destination. The router
then takes responsibility for forwarding the packets to the PPP host.
ip source-route
Source routing allows packets to include their own routing information in their
headers. This feature is often abused. Source routing is enabled by default but is
frequently disabled using the command no ip source-route.
ip unreachables
This command enables the generation of ICMP protocol unreachable messages (the
default). These messages are generated when the router receives a nonbroadcast
message for a protocol it doesn't recognize. This command is usually used in its
negative form (no ip unreachables) and is often used on the null interface.
Now let's look at some of the specific interface types you're likely to encounter.
Encapsulation type
arpa
isol
snap
All the devices connected to an Ethernet must share the same encapsulation type; if they do
not, they will not be able to communicate. If you're not sure of the encapsulation type,
you're probably using ARPA.
The first two commands clear the counters for a specific interface; the last command clears
the counters for all the interfaces.
All counters are unsigned long integers, which means they can go up
to about 4 billion before they roll over to 0 (2^32 - 1).
This router has one Ethernet port, two serial ports, and one built-in CSU/DSU installed on
serial interface 0.
Meaning
Up/down
Line protocol
Network address
translation is disabled
Explanation
Specifies whether NAT is enabled on this interface. The ip nat
command enables address translation. However, it requires some
extensive configuration. For more information, see Chapter 12.
Here's the output from show ip interface brief. The output is fairly straightforward,
except for the meaning of the Method column. This column is the same as the "Address
determined" field in Table 5-6.
Router#show ip interface brief
Interface
IP-Address
Ethernet0
10.200.212.1
Ethernet1
10.200.210.30
Serial0
unassigned
Serial1
unassigned
OK?
YES
YES
YES
YES
Method
NVRAM
NVRAM
unset
unset
Status
Protocol
up
up
up
up
administratively down down
administratively down down