text
stringlengths
0
6.55k
Example 6-9 Verifying DHCP-Learned Information on a Switch
Emma# show dhcp lease
Temp IP addr: 192.168.1.101 for peer on Interface: Vlan1
Temp sub net mask: 255.255.255.0
DHCP Lease server: 192.168.1.1, state: 3 Bound
DHCP transaction id: 1966
Lease: 86400 secs, Renewal: 43200 secs, Rebind: 75600 secs
Temp default-gateway addr: 192.168.1.1
Next timer fires after: 11:59:45
Retry count: 0 Client-ID: cisco-0019.e86a.6fc0-Vl1
Hostname: Emma
Emma# show interfaces vlan 1
Vlan1 is up, line protocol is up
Hardware is EtherSVI, address is 0019.e86a.6fc0 (bia 0019.e86a.6fc0)
Internet address is 192.168.1.101/24
MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255
! lines omitted for brevity
Emma# show ip default-gateway
192.168.1.1
The output of the show interfaces vlan 1 command lists two very important details related to switch IP addressing. First, this show command lists the interface status of the VLAN 1 interface—in this case, “up and up.” If the VLAN 1 interface is not up, the switch cannot use its IP address to send and receive management...
Second, note that the output lists the interface’s IP address on the third line. If you statically configure the IP address, as in Example 6-7, the IP address will always be listed; however,
if you use DHCP and DHCP fails, the show interfaces vlan x command will not list an IP address here. When DHCP works, you can see the IP address with the show interfaces vlan 1 command, but that output does not remind you whether the address is either statically configured or DHCP leased. So it does take a little extra...
Miscellaneous Settings Useful in the Lab
This last short section of the chapter touches on a couple of commands that can help you be a little more productive when practicing in a lab.
History Buffer Commands
When you enter commands from the CLI, the switch saves the last several commands in the history buffer. Then, as mentioned in Chapter 4, “Using the Command-Line Interface,” you
|||||||||||||||||||| Technet24
||||||||||||||||||||
Chapter 6: Configuring Basic Switch Management 145
can use the up-arrow key or press Ctrl+P to move back in the history buffer to retrieve a command you entered a few commands ago. This feature makes it very easy and fast to use a set of commands repeatedly. Table 6-2 lists some of the key commands related to the history buffer.
Table 6-2 Commands Related to the History Buffer
Command show history
terminal history size x
history size x
Description
An EXEC command that lists the commands currently held in the history buffer.
From EXEC mode, this command allows a single user to set, just for this one login session, the size of his or her history buffer.
A configuration command that, from console or vty line configuration mode, sets the default number of commands saved in the history buffer for the users of the console or vty lines, respectively.
The logging synchronous, exec-timeout, and no ip domain-lookup
Commands 6
These next three configuration commands have little in common, other than the fact that they can be useful settings to reduce your frustration when using the console of a switch or router.
The console automatically receives copies of all unsolicited syslog messages on a switch. The idea is that if the switch needs to tell the network administrator some important and possibly urgent information, the administrator might be at the console and might notice the message.
Unfortunately, IOS (by default) displays these syslog messages on the console’s screen at any time—including right in the middle of a command you are entering, or in the middle of the output of a show command. Having a bunch of text show up unexpectedly can be a bit annoying.
You could simply disable the feature that sends these messages to the console and then re-enable the feature later using the no logging console and logging console global configura-tion commands. For example, when working from the console, if you want to temporarily not be bothered by log messages, you can disable the ...
However, IOS supplies a reasonable compromise, telling the switch to display syslog messages only at more convenient times, such as at the end of output from a show command. To do so, just configure the logging synchronous console line subcommand, which basically tells IOS to synchronize the syslog message display with...
Another way to improve the user experience at the console is to control timeouts of the login session from the console or when using Telnet or SSH. By default, the switch automati-cally disconnects console and vty (Telnet and SSH) users after 5 minutes of inactivity. The exec-timeout minutes seconds line subcommand ena...
||||||||||||||||||||
||||||||||||||||||||
146 CCNA 200-301 Official Cert Guide, Volume 1
Finally, IOS has an interesting combination of features that can make you wait for a minute or so when you mistype a command. First, IOS tries to use DNS name resolution on IP hostnames—a generally useful feature. If you mistype a command, however, IOS thinks you want to telnet to a host by that name. With all default ...
To avoid this problem, configure the no ip domain-lookup global configuration command, which disables IOS’s attempt to resolve the hostname into an IP address.
Example 6-10 collects all these commands into a single example, as a template for some good settings to add in a lab switch to make you more productive.
Example 6-10 Commands Often Used in the Lab to Increase Productivity
no ip domain-lookup
!
line console 0
exec-timeout 0 0
logging synchronous
history size 20
!
line vty 0 15
exec-timeout 0 0
logging synchronous
history size 20