Example 6-15 Entering Enable Mode in Preparation to Paste Script

   

Writing a Basic Script in Notepad

Your objective is to configure R2 through R6 with the same items just configured on R1. You can do this either manually or through an automated method. When generic configuration commands are configured on multiple routers, it is useful to create a script that will expedite the configuration process.

In this scenario, use Notepad to write the script and then paste what was scripted to the desired router as you are connected to the router through reverse Telnet.

To accomplish this, open the text editor Notepad by clicking Start, Run, and typing notepad, as shown in Figure 6-1.

Figure 6-1. Starting the Notepad Application to Use when Writing the Router Script

graphics/06fig01.gif

Notepad then opens, as shown in Figure 6-2.

Figure 6-2. Notepad Application Opened to Use when Writing Script

graphics/06fig02.gif

The next step is to enter the configuration commands in Notepad as if you are beginning from a particular configuration point in the CLI.

For the purposes of this chapter, the configuration point begins in enable mode. Because of this choice, you will need to ensure that the script begins with the configure terminal command, which gets you into the correct mode so that the scripted commands will execute in the proper mode. The following configuration items must be included in the script:

  • Enable password

  • Password of falcons on line con0 and vty 0 4

  • No IP domain lookup

  • No exec timeout on line con0

  • Logging synchronous on line con0

  • IP host table

  • MOTD banner

For the script in Notepad, you should order these items in such a way that the router can interpret them. The commands should follow a natural sequence within a script. For example, you must assign IP addresses to interfaces before you can advertise a network in a routing protocol. By placing them in the same sequence that you would when configuring the router, Cisco IOS software will be capable of interpreting and then executing them accordingly . End the script with the banner motd command. This is because the banner will have input unique to the router you are configuring. When the script is pasted, it will end with the banner motd command and you will need to manually enter the input appropriate for the respective router that you're configuring. Now enter each command in Notepad as shown in Figure 6-3.

Figure 6-3. The Configuration Script as it Appears in Notepad

graphics/06fig03.gif

As you will notice, the script in Figure 6-3 begins with the configure terminal command. This gets you into global configuration mode. In global configuration mode, you set the enable password, disable DNS lookup, and then enter line configuration mode for the console port. Then you set the password for console 0, ensure that the console connection won't time out with the no exec-timeout command, and enable synchronous logging. Then enter line configuration mode for vty lines 0 through 4. Then you set the password on the vty lines to falcons and exit line configuration mode again. Now you are back into global configuration mode and can issue the ip host commands for the host table. Finally, you issue the banner motd command and specify the delimiting character. You then type the banner and end with a space following Router. This enables you to manually type the number of the router that you are configuring, hit the Enter key, and then end the banner by typing the delimiting character #. Now the script is ready.

As R1 was manually configured with these items, begin with R2 using the script. Before pasting the script to the router, reverse Telnet to the router and enter enable mode, as shown in Example 6-15.

 Termserver  #2  [Resuming connection 2 to r2 ... ] R2> 2w1d: %SYS-5-CONFIG_I: Configured from console by console R2>  enable  R2# 

Now switch back to Notepad and copy the script to the Clipboard by highlighting the scripted commands. Now copy the script to the Clipboard by selecting Edit and then Copy from within Notepad, as shown in Figure 6-4.

Figure 6-4. Copying the Script from Notepad to the Clipboard in Preparation for the Paste to R2

graphics/06fig04.gif

Now switch to HyperTerminal that is connected to R2 and, from enable mode, select Edit and Paste to Host, as shown in Figure 6-5.

Figure 6-5. Pasting the Script to R2 using HyperTerminal

graphics/06fig05.gif

The configuration commands are pasted in the terminal application program, and the router executes each one as they were typed in the script, ending with the last configuration command, as shown in Example 6-16.

Example 6-16 Each Command Is Pasted as Type in the Script
 R2  #configure terminal  Enter configuration commands, one per line.  End with CNTL/Z. R2(config)#  enable password falcons  R2(config)#  no ip domain-lookup  R2(config)#  line con 0  R2(config-line)#  password falcons  R2(config-line)#  no exec-timeout  R2(config-line)#  logging synchronous  R2(config)#  line vty 0 4  R2(config-line)#  password falcons  R2(config)#  ip host R1 192.169.1.1  R2(config)#  ip host R2 192.169.2.2  R2(config)#  ip host R3 192.169.3.3  R2(config)#  ip host R4 192.169.4.4  R2(config)#  ip host R5 192.169.5.5  R2(config)#  ip host R6 192.169.6.6  R2(config)#  banner motd #  Enter TEXT message.  End with the character '#'. This is Router  _  

CAUTION

It is important to verify that each command was pasted properly and that no errors were reported for erroneous or ambiguous commands during the paste. If an ambiguous command was reported , you might have mistyped a command in your script. Simply return to the script, correct the error, and then repaste the corrected script to the router. When this is successful, you can save the configuration.


Example 6-16 leaves you with the option to enter the router number (that is, 2, 3, and so on), hit the Enter key, and then end with the delimiting character #. Do this now, as demonstrated in Example 6-17.

Example 6-17 Completing the Script Configuration by Finishing the Banner and Entering the Delimiting Character
 R2  #configure terminal  Enter configuration commands, one per line.  End with CNTL/Z. R2(config)#  enable password falcons  R2(config)#  no ip domain-lookup  R2(config)#  line con 0  R2(config-line)#  password falcons  R2(config-line)#  no exec-timeout  R2(config-line)#  logging synchronous  R2(config-line)#  exit  R2(config)#  line vty 0 4  R2(config-line)#  password falcons  R2(config-line)#  exit  R2(config)#  ip host R1 192.169.1.1  R2(config)#  ip host R2 192.169.2.2  R2(config)#  ip host R3 192.169.3.3  R2(config)#  ip host R4 192.169.4.4  R2(config)#  ip host R5 192.169.5.5  R2(config)#  ip host R6 192.169.6.6  R2(config)#  banner motd #  Enter TEXT message.  End with the character '#'. This is Router  2   #  R2(config)#  exit  R2# 

Now save the configuration, as shown in Example 6-18.

Example 6-18 Saving the Configuration After the Script Is Pasted Successfully
 R2  #copy running-config startup-config  Building configuration... [OK] R2# 

If you do a show running-config, you can see that all the information has been correctly configured per the script, as intended (see Example 6-19).

Example 6-19 The Configuration Changes Appear Correctly in the Running-Config
 R2  #show running-config  Building configuration... Current configuration: ! version 12.0 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R2 !  enable password falcons  ! ip subnet-zero  no ip domain-lookup   ip host R1 192.169.1.1   ip host R2 192.169.2.2   ip host R3 192.169.3.3   ip host R4 192.169.4.4   ip host R5 192.169.5.5   ip host R6 192.169.6.6  ! ! ! interface Ethernet0  no ip address  no ip directed-broadcast  shutdown ! interface Ethernet1  no ip address  no ip directed-broadcast  shutdown ! interface Serial0  no ip address  no ip directed-broadcast  no ip mroute-cache  shutdown ! ip classless !  banner motd ^C   This is Router 2   ^C  ! line con 0  exec-timeout 0 0   password falcons   logging synchronous  transport input none line vty 0 4  password falcons  login ! end R2# 

To finish, this process must be repeated for each remaining lab router, R3 through R6. Begin with R3 by reverse Telnetting to R3, entering enable mode, pasting the script, completing the appropriate message of the day banner, and then saving the configuration, as shown in Example 6-20.

Example 6-20 Pasting Script to R3, Completing the Banner, and Saving the Configuration
 Termserver  #3  [Resuming connection 3 to r3 ... ] R3> 2w1d: %SYS-5-CONFIG_I: Configured from console by console R3>  enable  R3#  configure terminal  Enter configuration commands, one per line.  End with CNTL/Z. R3(config)#  enable password falcons  R3(config)#  no ip domain-lookup  R3(config)#  line con 0  R3(config-line)#  password falcons  R3(config-line)#  no exec-timeout  R3(config-line)#  logging synchronous  R3(config)#  line vty 0 4  R3(config-line)#  password falcons  R3(config)#  ip host R1 192.169.1.1  R3(config)#  ip host R2 192.169.2.2  R3(config)#  ip host R3 192.169.3.3  R3(config)#  ip host R4 192.169.4.4  R3(config)#  ip host R5 192.169.5.5  R3(config)#  ip host R6 192.169.6.6  R3(config)#  banner motd #  Enter TEXT message.  End with the character '#'. This is Router 3 # R3(config)#  exit  R3# %SYS-5-CONFIG_I: Configured from console by console R3#  copy running-config startup-config  Building configuration... [OK] R3# 

Now escape back to the terminal server using Ctrl-Shift-6, x and repeat the process for R4, as shown in Example 6-21.

Example 6-21 Pasting Script to R4, Completing the Banner, and Saving the Configuration
 Termserver  #4  [Resuming connection 4 to r4 ... ] R4> 2w1d: %SYS-5-CONFIG_I: Configured from console by console R4>  enable  R4#  configure terminal  Enter configuration commands, one per line.  End with CNTL/Z. R4(config)#  enable password falcons  R4(config)#  no ip domain-lookup  R4(config)#  line con 0  R4(config-line)#  password falcons  R4(config-line)#  no exec-timeout  R4(config-line)#  logging synchronous  R4(config)#  line vty 0 4  R4(config-line)#  password falcons  R4(config)#  ip host R1 192.169.1.1  R4(config)#  ip host R2 192.169.2.2  R4(config)#  ip host R3 192.169.3.3  R4(config)#  ip host R4 192.169.4.4  R4(config)#  ip host R5 192.169.5.5  R4(config)#  ip host R6 192.169.6.6  R4(config)#  banner motd #  Enter TEXT message.  End with the character '#'. This is Router 4 # R4(config)#  exit  R4# %SYS-5-CONFIG_I: Configured from console by console R4#  copy running-config startup-config  Building configuration... [OK] R4# 

Next, escape back to the terminal server using Ctrl-Shift-6, x and repeat the process for R5, as shown in Example 6-22.

Example 6-22 Pasting Script to R5, Completing the Banner, and Saving the Configuration
 Termserver  #5  [Resuming connection 5 to r5 ... ] R5> 2w1d: %SYS-5-CONFIG_I: Configured from console by console R5>enable R5#  configure terminal  Enter configuration commands, one per line.  End with CNTL/Z. R5(config)#  enable password falcons  R5(config)#  no ip domain-lookup  R5(config)#  line con 0  R5(config-line)#  password falcons  R5(config-line)#  no exec-timeout  R5(config-line)#  logging synchronous  R5(config)#  line vty 0 4  R5(config-line)#  password falcons  R5(config)#  ip host R1 192.169.1.1  R5(config)#  ip host R2 192.169.2.2  R5(config)#  ip host R3 192.169.3.3  R5(config)#  ip host R4 192.169.4.4  R5(config)#  ip host R5 192.169.5.5  R5(config)#  ip host R6 192.169.6.6  R5(config)#  banner motd #  Enter TEXT message.  End with the character '#'. This is Router 5 # R5(config)#  exit  R5# %SYS-5-CONFIG_I: Configured from console by console R5#  copy running-config startup-config  Building configuration... [OK] R5# 

Finally, return back to the terminal server using Ctrl-Shift-6, x and repeat the process for R6, as shown in Example 6-23.

Example 6-23 Pasting Script to R6, Completing the Banner, and Saving the Configuration
 Termserver  #6  [Resuming connection 6 to r6 ... ] R6> 2w1d: %SYS-5-CONFIG_I: Configured from console by console R6>enable R6#  configure terminal  Enter configuration commands, one per line.  End with CNTL/Z. R6(config)#  enable password falcons  R6(config)#  no ip domain-lookup  R6(config)#  line con 0  R6(config-line)#  password falcons  R6(config-line)#  no exec-timeout  R6(config-line)#  logging synchronous  R6(config)#  line vty 0 4  R6(config-line)#  password falcons  R6(config)#  ip host R1 192.169.1.1  R6(config)#  ip host R2 192.169.2.2  R6(config)#  ip host R3 192.169.3.3  R6(config)#  ip host R4 192.169.4.4  R6(config)#  ip host R5 192.169.5.5  R6(config)#  ip host R6 192.169.6.6  R6(config)#  banner motd #  Enter TEXT message.  End with the character '#'. This is Router 6 # R6(config)#  exit  R6# %SYS-5-CONFIG_I: Configured from console by console R6#copy running-config startup-config Building configuration... [OK] R6# 

You have now completed the basic router configuration steps for the lab. You have configured each router with a host name ; set the enable, console, and vty password; and created a message of the day banner. Each router is now configured for Telnet access, and you have created a host table that will be used to facilitate Telnet access after IP has been configured on the required interfaces. In addition, you have learned how to use a script to configure multiple routers with similar configuration information.

You are now ready to proceed to the router interface configuration section of the lab, covered in Chapter 7.


   
Top


CCNA Practical Studies
CCNA Practical Studies (Cisco Certification & Training)
ISBN: 1587200465
EAN: 2147483647
Year: 2005
Pages: 127

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net