Descriptions
Setting descriptions on an interface is another administratively helpful
thing, and like the hostname, it’s also only locally significant. One case
where the
description
command comes in really handy is when you want
to keep track of circuit numbers on a switch or a router’s serial WAN port.
Here’s an example on my switch:
Todd#
config t
Todd(config)#
int fa0/1
Todd(config-if)#
description Sales VLAN Trunk Link
Todd(config-if)#
^Z
Todd#
And on a router serial WAN:
Router#
config t
Router(config)#
int s0/0/0
Router(config-if)#
description WAN to Miami
Router(config-if)#
^Z
You can view an interface’s description with either the
show running-
config
command or the
show interface
—even with the
show interface
description
command:
Todd#sh run
Building configuration...
Current configuration : 855 bytes
!
interface FastEthernet0/1
description Sales VLAN Trunk Link
!
[output cut]
Todd#
sh int f0/1
FastEthernet0/1 is up, line protocol is up (connected)
Hardware is Fast Ethernet, address is ecc8.8202.8282 (bia
ecc8.8202.8282)
Description: Sales VLAN Trunk Link
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
[output cut]
Todd#
sh int description
Interface Status Protocol Description
Vl1 up up
Fa0/1 up up Sales VLAN
Trunk Link
Fa0/2 up up
description: A Helpful Command
Bob, a senior network admin at Acme Corporation in San Francisco,
has over 50 WAN links to branches throughout the United States and
Canada. Whenever an interface goes down, Bob wastes lots of time
trying to figure out the circuit number and the phone number of the
provider of his ailing WAN link.
This kind of scenario shows just how helpful the interface
description
command can be. It would save Bob a lot of work because he could
use it on his most important switch LAN links to find out exactly
where every interface is connected. Bob’s life would also be made a lot
easier by adding circuit numbers to each and every WAN interface on
his routers, along with the phone number of the responsible provider.
So if Bob had just taken time in advance to preventively add this
information to his interfaces, he would have saved himself an ocean of
stress and a ton of precious time when his WAN links inevitably go
down!
Doing the do Command
In every previous example so far, we’ve had to run all
show commands
from
privileged mode. But I’ve got great news—beginning with IOS version
12.3, Cisco has finally added a command to the IOS that allows you to
view the configuration and statistics from within configuration mode!
In fact, with any IOS, you’d get the following error if you tried to view the
configuration from global config:
Todd(config)#
sh run
^
% Invalid input detected at '^' marker.
Compare that to the output I get from entering that same command on
my router that’s running the 15.0 IOS using the “do” syntax:
Todd(config)#
do show run
Building configuration...
Current configuration : 759 bytes
!
version 15.0
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Todd
!
boot-start-marker
boot-end-marker
!
[output cut]
So now you can pretty much run any command from any configuration
prompt—nice, huh? Looking back through all those examples for
encrypting our passwords, you can see that the
do
command would
definitely have gotten the party started sooner, making this innovation
one to celebrate for sure!
Router and Switch Interfaces
Interface configuration is arguably the most important router
configuration because without interfaces, a router is a pretty useless
object. Furthermore, interface configurations must be totally precise to
enable communication with other devices. Network layer addresses,
media type, bandwidth, and other administrator commands are all used
to configure an interface.
On a layer 2 switch, interface configurations typically involve a lot less
work than router interface configuration. Check out the output from the
powerful verification command
show ip interface brief
, which reveals
all the interfaces on my 3560 switch:
Todd#
sh ip interface brief
Interface IP-Address OK? Method Status
Protocol
Vlan1 192.168.255.8 YES DHCP up
up
FastEthernet0/1 unassigned YES unset up
up
FastEthernet0/2 unassigned YES unset up
up
FastEthernet0/3 unassigned YES unset down
down
FastEthernet0/4 unassigned YES unset down
down
FastEthernet0/5 unassigned YES unset up
up
FastEthernet0/6 unassigned YES unset up
up
FastEthernet0/7 unassigned YES unset down
down
FastEthernet0/8 unassigned YES unset down
down
GigabitEthernet0/1 unassigned YES unset down
down
The previous output shows the default routed port found on all Cisco
switches (VLAN 1), plus nine switch FastEthernet interface ports, with
one port being a Gigabit Ethernet port used for uplinks to other switches.
Different routers use different methods to choose the interfaces used on
them. For instance, the following command shows one of my 2800 ISR
Cisco routers with two FastEthernet interfaces along with two serial WAN
interfaces:
Router>
sh ip int brief
Interface IP-Address OK? Method Status
Protocol
FastEthernet0/0 192.168.255.11 YES DHCP up
up
FastEthernet0/1 unassigned YES unset administratively down
down
Serial0/0/0 unassigned YES unset administratively down
down
Serial0/1/0 unassigned YES unset administratively down
down
Router>
Previously, we always used the
interface type
number
sequence to
configure an interface, but the newer routers come with an actual
physical slot and include a port number on the module plugged into it. So
on a modular router, the configuration would be
interface
type
slot/port
, as demonstrated here:
Todd#
config t
Todd(config)#
interface GigabitEthernet 0/1
Todd(config-if)#
You can see that we are now at the Gigabit Ethernet slot 0, port 1 prompt,
and from here we can make configuration changes to the interface. Make
note of the fact that you can’t just type
int gigabitethernet 0
. No
shortcuts on the slot/port—you’ve got to type the slot/port variables in
the command:
type slot/port
or, for example,
intgigabitethernet 0/1
(or just
int g0/1
).
Once in interface configuration mode, we can configure various options.
Keep in mind that speed and duplex are the two factors to be concerned
with for the LAN:
Todd#
config t
Todd(config)#
interface GigabitEthernet 0/1
Todd(config-if)#
speed 1000
Todd(config-if)#
duplex full
So what’s happened here? Well basically, this has shut off the auto-detect
mechanism on the port, forcing it to only run gigabit speeds at full
duplex. For the ISR series router, it’s basically the same, but you get even
more options! The LAN interfaces are the same, but the rest of the
modules are different—they use three numbers instead of two. The three
numbers used here can represent
slot/subslot/port
, but this depends on
the card used in the ISR router. For the objectives, you just need to
remember this: The first 0 is the router itself. You then choose the slot
and then the port. Here’s an example of a serial interface on my 2811:
Todd(config)#
interface serial ?
<0-2> Serial interface number
Todd(config)#
interface serial 0/0/?
<0-1> Serial interface number
Todd(config)#
interface serial 0/0/0
Todd(config-if)#
This might look a little dicey to you, but I promise it’s really not that
hard! It helps to remember that you should always view the output of the
show ip interface brief
command or a
show running-config
output first
so you know the exact interfaces you have to deal with. Here’s one of my
2811’s output that has even more serial interfaces installed:
Todd(config-if)#
do show run
Building configuration...
[output cut]
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0/0
no ip address
shutdown
no fair-queue
!
interface Serial0/0/1
no ip address
shutdown
!
interface Serial0/1/0
no ip address
shutdown
!
interface Serial0/2/0
no ip address
shutdown
clock rate 2000000
!
[output cut]
For the sake of brevity, I didn’t include my complete running-config, but
I’ve displayed all you really need. You can see the two built-in
FastEthernet interfaces, the two serial interfaces in slot 0 (0/0/0 and
0/0/1), the serial interface in slot 1 (0/1/0), and the serial interface in slot
2 (0/2/0). And once you see the interfaces like this, it makes it a lot easier
to understand how the modules are inserted into the router.
Just understand that if you type
interface e0
on an old 2500 series
router,
interface fastethernet 0/0
on a modular router (such as the
2800 series router), or
interface serial 0/1/0
on an ISR router, all
you’re actually doing is choosing an interface to configure. Essentially,
they’re all configured the same way after that.
Let’s delve deeper into our router interface discussion by exploring how
to bring up the interface and set an IP address on it next.
Bringing Up an Interface
You can disable an interface with the interface command
shutdown
and
enable it with the
no shutdown
command. Just to remind you, all switch
ports are enabled by default and all router ports are disabled by default,
so we’re going to talk more about router ports than switch ports in the
next few sections.
If an interface is shut down, it’ll display as administratively down when
you use the
show interfaces
command (
sh int
for short):
Router#
sh int f0/0
FastEthernet0/1 is administratively down, line protocol is down
[output cut]
Another way to check an interface’s status is via the
show running-config
command. You can bring up the router interface with the
no shutdown
command (
no shut
for short):
Router(config)#
int f0/0
Router(config-if)#
no shutdown
*August 21 13:45:08.455: %LINK-3-UPDOWN: Interface FastEthernet0/0,
changed state to up
Router(config-if)#
do show int f0/0
FastEthernet0/0 is up, line protocol is up
[output cut]
Configuring an IP Address on an Interface
Even though you don’t have to use IP on your routers, it’s usually what
everyone uses. To configure IP addresses on an interface, use the
ip
address
command from interface configuration mode and remember that
you do not set an IP address on a layer 2 switch port!
Todd(config)#
int f0/1
Todd(config-if)#
ip address 172.16.10.2 255.255.255.0
Also, don’t forget to enable the interface with the
no shutdown
command.
Remember to look at the command
show interface
int
output to see if
the interface is administratively shut down or not.
Show ip int brief
and
show running-config
will also give you this information.
The
ip address
address mask
command starts the IP
processing on the router interface. Again, you do not configure an IP
address on a layer 2 switch interface!
Okay—now if you want to add a second subnet address to an interface,
you have to use the
secondary
parameter. If you type another IP address
and press Enter, it will replace the existing primary IP address and mask.
This is definitely one of the Cisco IOS’s coolest features!
So let’s try it. To add a secondary IP address, just use the
secondary
parameter:
Todd(config-if)#
ip address 172.16.20.2 255.255.255.0 ?
secondary Make this IP address a secondary address
Todd(config-if)#
ip address 172.16.20.2 255.255.255.0 secondary
Todd(config-if)#
do sh run
Building configuration...
[output cut]
interface FastEthernet0/1
ip address 172.16.20.2 255.255.255.0 secondary
ip address 172.16.10.2 255.255.255.0
duplex auto
speed auto
!
But I’ve got to stop here to tell you that I really wouldn’t recommend
having multiple IP addresses on an interface because it’s really
inefficient. I showed you how anyway just in case you someday find
yourself dealing with an MIS manager who’s in love with really bad
network design and makes you administer it! And who knows? Maybe
someone will ask you about it someday and you’ll get to seem really smart
because you know this.
Using the Pipe
No, not that pipe. I mean the output modifier. Although, I’ve got to say
that some of the router configurations I’ve seen in my career make me
wonder! Anyway, this pipe ( | ) allows us to wade through all the
configurations or other long outputs and get straight to our goods fast.
Here’s an example:
Router#
sh run | ?
append Append redirected output to URL (URLs supporting append
operation only)
begin Begin with the line that matches
exclude Exclude lines that match
include Include lines that match
redirect Redirect output to URL
section Filter a section of output
tee Copy output to URL
Router#
sh run | begin interface
interface FastEthernet0/0
description Sales VLAN
ip address 10.10.10.1 255.255.255.248
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 172.16.20.2 255.255.255.0 secondary
ip address 172.16.10.2 255.255.255.0
duplex auto
speed auto
!
interface Serial0/0/0
description Wan to SF circuit number 6fdda 12345678
no ip address
!
So basically, the pipe symbol—the output modifier—is what you need to
help you get where you want to go light years faster than mucking around
in a router’s entire configuration. I use it a lot when scrutinizing a large
routing table to find out whether a certain route is in the routing table.
Here’s an example:
Todd#
sh ip route | include 192.168.3.32
R 192.168.3.32 [120/2] via 10.10.10.8, 00:00:25,
FastEthernet0/0
Todd#
First, you need to know that this routing table had over 100 entries, so
without my trusty pipe, I’d probably still be looking through that output!
It’s a powerfully efficient tool that saves you major time and effort by
quickly finding a line in a configuration—or as the preceding example
shows, a single route within a huge routing table.
Give yourself a little time to play around with the pipe command to get
the hang of it and you’ll be naturally high on your newfound ability to
quickly parse through router output!
Serial Interface Commands
But wait! Before you just jump in and configure a serial interface, you
need some key information, like knowing the interface will usually be
attached to a CSU/DSU type of device that provides clocking for the line
to the router. Check out
Figure 6.3
for an example.
FIGURE 6.3
A typical WAN connection. Clocking is typically provided
by a DCE network to routers. In nonproduction environments, a DCE
network is not always present.
Here you can see that the serial interface is used to connect to a DCE
network via a CSU/DSU that provides the clocking to the router interface.
But if you have a back-to-back configuration, such as one that’s used in a
lab environment like the one in
Figure 6.4
, one end—the data
communication equipment (DCE) end of the cable—must provide
clocking!
FIGURE 6.4
Providing clocking on a nonproduction network
By default, Cisco router serial interfaces are all data terminal equipment
(DTE) interfaces, which means that you must configure an interface to
provide clocking if you need it to act like a DCE device. Again, you would
not provide clocking on a production WAN serial connection because you
would have a CSU/DSU connected to your serial interface, as shown in
Figure 6.3
.
You configure a DCE serial interface with the
clock rate
command:
Router#
config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
int s0/0/0
Router(config-if)#
clock rate ?
Speed (bits per second)
1200
2400
4800
9600
14400
19200
28800
32000
38400
48000
56000
57600
64000
72000
115200
125000
128000
148000
192000
250000
256000
384000
500000
512000
768000
800000
1000000
2000000
4000000
5300000
8000000
<300-8000000> Choose clockrate from list above
Router(config-if)#
clock rate 1000000
The
clock rate
command is set in bits per second. Besides looking at the
cable end to check for a label of DCE or DTE, you can see if a router’s
serial interface has a DCE cable connected with the
show controllers
int
command:
Router#
sh controllers s0/0/0
Interface Serial0/0/0
Hardware is GT96K
DTE V.35idb at 0x4342FCB0, driver data structure at 0x434373D4
Here is an example of an output depicting a DCE connection:
Router#
sh controllers s0/2/0
Interface Serial0/2/0
Hardware is GT96K
DCE V.35, clock rate 1000000
The next command you need to get acquainted with is the
bandwidth
command. Every Cisco router ships with a default serial link bandwidth
of T1 (1.544 Mbps). But this has nothing to do with how data is
transferred over a link. The bandwidth of a serial link is used by routing
protocols such as EIGRP and OSPF to calculate the best cost path to a
remote network. So if you’re using RIP routing, the bandwidth setting of
a serial link is irrelevant since RIP uses only hop count to determine this.
You may be rereading this part and thinking, “Huh? What?
Routing protocols? Metrics?” But don’t freak! I’m going over all of
that soon in Chapter 9.
Here’s an example of using the
bandwidth
command:
Router#
config t
Router(config)#
int s0/0/0
Router(config-if)#
bandwidth ?
<1-10000000> Bandwidth in kilobits
inherit Specify that bandwidth is inherited
receive Specify receive-side bandwidth
Router(config-if)#
bandwidth 1000
Did you notice that, unlike the
clock rate
command, the
bandwidth
command is configured in kilobits per second?
After going through all these configuration examples
regarding the
clock rate
command, understand that the new ISR
routers automatically detect DCE connections and set
clock rate
to
2000000. But know that you still need to understand the
clock rate
command for the Cisco objectives, even though the new routers set it
for you automatically!
Viewing, Saving, and Erasing Configurations
If you run through setup mode, you’ll be asked if you want to use the
configuration you just created. If you say yes, the configuration running
in DRAM that’s known as the
running-config
will be copied into NVRAM,
and the file will be named
startup-config
. Hopefully, you’ll be smart and
always use the CLI, not setup mode!
You can manually save the file from DRAM, which is usually just called
RAM, to NVRAM by using the
copy running-config startup-config
command. You can use the shortcut
copy run start
as well:
Todd#
Dostları ilə paylaş: |