Basic Router Configuration (DOC)

Document Sample
Basic Router Configuration (DOC) Powered By Docstoc
					Basic Router Configuration:      (Open HyperTerminal connection to R1 using COM port on PC: 9600 baud, 8 data bits, No parity, 1 stop bit, No flow control)

RTR#erase startup-config                              (to erase NVRAM)
……to enter config. Dialog? no                         (If yes, you can end it Ctrl+C)
Router>?                                              (write all commands)
Router>enable                                         (disable – come back to user mode)
Router#show version                                    (IOS ver., Bootstrap ver., Model and CPU, RAM 60 416KB/5 120KB-buffer=64MB, number of interfaces,
                                                       amount of NVRAM, Flash, conf. reg. 0x2102)
(Router#clock set 18:53:00 15 September 2008)

Router#configure terminal
Router(config)#hostname R1                            (Note: To negate the effects of a command, preface the command with the no keyword.)

                     (R1(config)#no hostname R1) (to remove the name of a device)
R1(config)#no ip domain-lookup               (Disable DNS lookup – only in LABs!)
R1(config)#enable secret class               (MD5 Encryption - a password for entering the privileged EXEC mode or enable password class)
R1(config)#banner motd #WARNING!! Unauthorized Access Prohibited!!#        (the message-of-the-day, Ľ Alt+35 = #)

R1(config)#line console 0                             (configure the console and Telnet lines with the password cisco)
R1(config-line)#logging synchronous                   (no more Unsolicited Messages from IOS)
R1(config-line)#exec-timeout 0 0                      (it means no time out!) (integer= minutes [seconds]max time session opened)
R1(config-line)#password cisco

R1(config)#line vty 0 4
R1(config-line)#logging synchronous
R1(config-line)#password cisco

R1#debug ip routing or debug all           (before we start config interfaces to see adding the routes into routing rable; to monitor router operations in real time)
R1#undebug ip routing or undebug all       (disable debuging, debug commands should be used sparingly, because desrupt router operation - CPU and RAM)

Configure an ip interfaces:
R1#show ip interface brief                            (to configure unknown interfaces; show tech – to view all show commands)
R1#show controllers serial 0/0                        (to find DCE on serial interface – set a clock rate, and DTE cables on interfaces)

R1#configure terminal
R1(config)#interface Serial 0/0 or int s0/0          (DB-60 = 5-in-1 Serial port = 26-pin connector, DCE = mamina - a crossover serial cable)
R1(config-if)#ip address
R1(config-if)#description Circuit#VBN32696-123 (help desk:1-800-555-1234)           (text is limited to 240 characters – good for troubleshooting)
R1(config-if)#clock rate 64000                      (only on Data Circuit-terminating Equip.-DCE device, in show run router spels them as one = clockrate
                                                    64000, Data Link Layer protocol is up for WAN serial point-to-point connection)
R1(config-if)#no shutdown

R1(config)#interface FastEthernet 0/0 or int fa0/0    (each interface belongs to a different network)
R1(config-if)#ip address
R1(config-if)#description R1 LAN
R1(config-if)#no shutdown

Changing an ip addresses on ip interfaces:
R1(config)#interface fa0/0
R1(config-if)#ip address               (write a new ip address)
R1(config-if)# interface s0/0                                    (Is it possible to switch between interfaces on R1)
R1(config-if)# ip address              (write a new ip address)
R1(config-if)#no ip address                                      (only delete a specific ip address)
R1(config-if)#no router rip                                      (disable RIP on Router)

Configuring ip hosts:
R1(config)#ip host R2                    (all ip interfaces on R2, R3,…)
R1(config)#ip host DNS1             (Servers, printers,…)

Configuring Static routes on Serial interfaces:
R1(config)#ip route 254 (next hop ip iterface on R2) (0-255, if not set=1 - best administrative distance)
                                                              (Router will use Recursive Route Lookup = befor forwarding a packet:1-looks for route; 2-looks
                                                               for exit or outgoing interface = DISADVANTAGE!)
R1(config)#ip route Serial 0/0 254 (exit or outgoing serial interface on R1; use this command! for serial point-to-point networks
                                                               that use protocols HDLC- High-level Data Link Control of Layer 2 and PPP)
Modifying Static routes:
R1(config)#no ip route 254 (delete an ip route)
R1(config)#ip route Serial 0/0         (write a new ip route)

Configuring Static routes on FastEthernet interfaces:
R1(config)#ip route 10     (exit interface on R1, Router will use Recursive Route Lookup process)
                                                                (0-255, if not set=1 - best administrative distance, 255=floating static route is backup route)
R1(config)#ip route fa 0/0 (exit serial interface on R1 + next hop ip iterface on R2= no Recursive Route Lookup process

Configuring dynamic routes:                  (!!! Before configuration make sure all necessary interfaces are “up” and “up” with: R1#show ip interface brief )
R2(config)#router ?                          (Shows routing protocols)

R2(config)#router rip                         (RIP Message format: Dest. add: FF-FF-FF-FF-FF-FF, //Dest. IP:, protocol field 17 for UDP; 01-ICMP,
                                              06-TCP; // UDP segment source and dest. Ports: 520 // RIP Message: 512 bytes, up to 25 entries, Maximum path: 4 equal-
                                              cost load balancing, AD: 120, Metric: max Hop Count 15, each 30sec., advertising classful address without sbn.mask,
R2(config-router)#network         (All directly-connected-classful-network-addresses on R1)
R2(config-router)#passive-interface fa0/0 (Stops sending routing updates out the specified interface. However, the network of the specified interface still will be
                                           advertised in routing table)
R2(config-router)#default-information originate      (Propagation default route = “quad-zero” route, in the RIP updates)
R2(config)#no router rip                  (Cancel RIP processes on R1)
R2(config-if)#no router rip               (Cancel RIP processes on R1)

R2#copy running-config startup-config       (Save changes into config file into NVRAM)
R2#show ip protocols                        (Shows which routing processes are enabled)
R2#debug ip rip                             (Interpreting debug ip rip Output)
R2#undebug all or no debug ip rip           (End debugging)

Summarizing Routes to Reduce the Size of the Routing Table:

Creating smaller routing tables makes the routing table lookup process more efficient, because there are fewer routes to search. If one static route can be used instead
of multiple static routes, the size of the routing table will be reduced. In many cases, a single static route can be used to represent dozens, hundreds, or even
thousands of routes.
We can use a single network address to represent multiple subnets. For example, the networks,,,,,, all the way through can be represented by a single network address:

Route Summarization:
Multiple static routes can be summarized into a single static route if:
            -The destination networks can be summarized into a single network address, and
            -The multiple static routes all use the same exit-interface or next-hop IP address
This is called route summarization.
In our example, R3 has three static routes. All three routes are forwarding traffic out the same Serial0/0/1 interface. The three static routes on R3 are:

ip route Serial0/0/1
ip route Serial0/0/1
ip route Serial0/0/1

If possible, we would like to summarize all of these routes into a single static route., and can be summarized to the network. Because all three routes use the same exit interface, they can be summarized to the single network, and we can
create a single summary route.

Calculating a summary route
Here's the process of creating the summary route, as shown in the figure:

1. Write out the networks that you want to summarize in binary.
2. To find the subnet mask for summarization, start with the left-most bit.
3. Work your way to the right, finding all the bits that match consecutively.
4. When you find a column of bits that do not match, stop. You are at the summary boundary.
5. Now, count the number of left-most matching bits, which in our example is 22. This number becomes your subnet mask for the summarized route, /22 or
6. To find the network address for summarization, copy the matching 22 bits and add all 0 bits to the end to make 32 bits.

By following these steps, we can discover that the three static routes on R3 can be summarized into a single static route, using the summary network address of       ip route Serial0/0/1

Most specific match – the routing table lookup process will use the most-specific match for making decission to forward the packet according to the subnetmask.

default Static route (Quad-zero route)
 R1(config)#ip route exit-interface/next hop ip-address      (0-255, if not set=1 - best administrative distance) (If Stub or Edge router to ISP.)

Testing connectivity from R1, PC:
R1#ping _._._._ -n 10                         (brief ping – ICMP message n =10 times) (ping /? = show all command for ping)
R1#ping                                       (extended ping – ICMP message)
R1#traceroute _._._._ or        (or ip host, or ip domain; Ctrl+Shift+6=interrupt the proces; * = R is unreachable =ICMP message from UDP port-
                                              33434 = time to live - TTL exceeded)

C:\>help                                        (Displays the list of available commands)
C:\>ping -n 10
C:\>ipconfig /all or ? (winipcfg –win98)     (F3 - press to invoke last command in cmd line)
C:\>ipconfig /renew (winipcfg –win98)        (F3 - press to invoke last command in cmd line)
C:\>netstat /?                               (Zobrazí štatistiku protokolu a aktuálne sieťové pripojenia TCP/IP.)
C:\>route print /?                           (Pracuje so sieťovými smerovacími tabuľkami.)
C:\>arp -a                                   (Displays the arp table)
C:\>nslookup                                 (Finds DNS Server ip address and its domain name)

1.) Initiate a Telnet session: (> or #)       (virtual terminal protocol, part of TCP/IP suite, allows a remote connection, is a IOS exec command used for
                                              verifycation of the application layer software between source and destination)
R1>_._._._                                    (if ip host tables have not been configured yet on routers = use only ip address of host instead of its ip host name)
R1>telnet R2                                  R2 or (_._._._)
R1>connect R2

R1>show sessions                              (to see all established sessions: 1. a number of open sessions, 2. host, 3. ip address, 4. idle, 5. connection name)
R1#session limit                              (a number of open sessions at one time)
R1>show user

2.) Suspend the current Telnet session:
R2# (Ctrl+Shift+6)X                           ((Ctrl+Shift+6) in brackets push all at once and then press “X” = exit, escapes the current connection)

3.) Resume a Telnet session:
R1> (Enter key)                               ((Enter key) press, to resume last connection-session)
R1>resume 2                                   (to resume 2. connection-session)
4.) Close a Telnet session: (> or #)         (by defaul the Telnet is finished up to 10 min. of inactivity)
R2>exit (or disconnect or logout)            (to close a session from R2)
R1>disconnect R2                             (to close a session from R1)

Show commands:
R1#show tech                    (displays all shows)
Router#show running-config       (Verifying Basic Router Configuration in RAM)
Router#show ip route             (To display the Routing table that the IOS is currently using to choose the best path to its destination networks in RAM)
Router#show arp                  (To display the Address Resolution Protocol table that the IOS is currently using in RAM)
Router#show ip interface brief   (displays abbreviated interface configuration information, including IP address and interface status, tool for troubleshooting and a
                                quick way to determine the status of all router interfaces)
Router#show interfaces fastethernet 0/0 (displays HW, MAC address for ARP and the default gateway IP address)
Router#show interfaces Serial 0/0          (displays HW and the default gateway IP address, administratively up, line protocol up)
Router#show interfaces                     (displays MAC and all of the interface configuration parameters and statistics)

R1#show startup-config           (also displays how many bytes of NVRAM the saved configuration is using)
R1#show controllers serial       (to find DCE – set a clock rate, and DTE cables on interfaces =Data Terminal Equipment)

CDP commands: Disabling CDP:
   -   BW is low at particular interface,
   -   there is only one device of cisco,
   -   connection to other network-ISP,
   -   CDP can be disabled for security reasons,
   -   by default on asynchronous interfaces it is disabled and on other enabled.

R1(config)#no cdp run                       (At global config level on all interfaces = individual interfaces can not be enabled for cdp now)
R1(config)#cdp run                          (At global config level on all interfaces = individual interfaces can be disabled for cdp now)
R1(config-if)#no cdp enable                 (At specific interface level only)            or no cdp advertise-v2
R1(config-if)#cdp enable                    (At specific interface level only)

R1>or #show cdp                              (At user or privileged exec mode; displays global cdp info = interval between transmission of cdp
                                             advertisements=timer, TTL-time to live for advertisements for given port = hold time, version of advertisements)

R1#show cdp neighbors                        (displays neighbor device ID, Local interface, Holtime value in seconds, neighbor: device capability code-device is R or
                                             S, hardware platform, remote port ID)

R1#show cdp neighbors detail               (displays info about cdp updates on R1)
R1#clear cdp table                         (deletes info about neighbors in cdp table)
R1#show cdp entry *                        (displays all connections to neighbors)
R1#show cdp entry R2                       (displays info about R2)
R1#show cdp interface serial 0/0 or fa 0/1 (displays how often cdp packets are sent and if the interfaces are up or down)
R1#show cdp traffic                        (displays cdp counters, number of packets sent and received and checksum errors)
R1#clear cdp counters                      (resets traffic cdp counters to zero)

R1#debug cdp packets                        (wait for 2 min. to see cdp packets); (R1#debug cdp adjacency or events or ip)
R1#undebug all                              (to stop debugging activity)
R1#cdp timer                                (specifies how often the cisco IOS SW sends cdp updates)
R1#cdp holdtime                             (specifies the hold time to be sent in the cdp update packet)
CDP commands: Disabling CDP:

R1(config)#service dhcp or no service dhcp                        (Default is enabled; Enables the Cisco IOS DHCP server and relay features on router)
R1(config)#ip dhcp pool mypool1                                   (Create a DHCP IP address pool for the IP addresses you want to use)
R1(dhcp-config)#network                 (Specify the network and subnet for the addresses you want to use from the pool)
R1(dhcp-config)#domain-name                          (Specify the DNS domain name for the clients)
R1(dhcp-config)#dns-server                (Specify the primary and secondary DNS servers)
R1(dhcp-config)#default-router                        (Hosts will use this address as default gateway)
R1(dhcp-config)#lease 7 days[hours][minutes]|infinite             (Specify the lease duration for the addresses you're using from the pool)
R1(dhcp-config)#exit                                              (Exit Pool Configuration Mode)

R1(config)#no ip dhcp conflict logging                       (Disables DHCP address conflict logging.)
R1(config)#ip dhcp excluded-address (Exclude any addresses in the pool range – for static ip devices: printers, servers)

R1# show ip dhcp bindings                                         (To view which DHCP IP addresses currently have leases)
R1#copy running-config startup-config                              (or copy run start - Save changes into config file into NonVolatile memory NVRAM)
R1#configure terminal

Managing configuration files*,**

*Create a start.txt File – backup the configuration file 1.5.1 Lab
Router configurations can be saved to a text (.txt) file and saved for later use:
1. On HyperTerminal screen:
        1. Select Transfer/ capture text
        2. Specify a name and route for text file for capturing – “R1-config.txt”
        3. Select Transfer/ capture text / start – to start capturing text.
        4. Issue a R1#show running-config command. (–More-) all config to be displayed.
        5. Select Transfer/ capture text / stop
2. Open Notepad and select Paste from the Notepad Edit menu. Remove extra text in “R1-config.txt”, DELETE:
     -     non-command text such as,
     -     "--More--" and IOS messages,
     -     show running-config
     -     building configuration
     -     current configuration
     -     unused interfaces,
     -     the mac-address command from the interfaces,
     -     only one exclamation mark is sufficient, delete others,
     -     any lines that appear after the word “End”
     -     add a no shutdown command to FastEthernet and Serial interfaces that are being used.
     -     add a clock rate 64000 command to Serial DCE interfaces that are being used.
     -     enable secret class ( issue a non-encrypted password)
     -     ip classless,
     -     clock set
3. Save the open file in Notepad to start.txt – “R1-config.txt “

*Load the start.txt File onto the R1 Router
RTR#erase startup-config                                (to erase NVRAM)
RTR#reload ……to enter config. Dialog? no                (If yes, you can end it Ctrl+C)
Router>enable                                           (disable – come back to user mode)
Router#configure terminal
Router(config)#                                         (Select in HyperTerminal - Transfer/ Send Text File – and select “R1-config.txt”)
R1(config)#                                             (Watch as the lines enter into router….)
R1#copy run start

Document the Router Configurations
On each router, capture the following command output to a text (.txt) file and save for future reference.
     1. Running configuration                                     - R1#show running-config
     2. Routing table                                             - R1#show ip route
     3. Summary of status information for each interface          - R1#show ip interface brief

Backing Up Configurations Offline**
Configuration files should be stored as backup files in the event of a problem. Can be stored on:
- Trivial File Transfer Protocol (TFTP server, a CD, a USB memory stick, or a floppy disk stored in a safe place.
A configuration file should also be included in the network documentation.

**Backup Configuration on TFTP Server
R1#copy running-config tftp or copy startup-config tftp

Verify the transfer on TFTP Server by clicking on View/Log File

**Restoration Configuration Fines from TFTP Server

Router# copy tftp running-config
          Address of remote host () ?
          Source filname () ? R1-config
          Destination filename (running-config)? Enter …
R1#copy run start
          Destination filename (startup-config)? Enter …

R1#sh start           (to test the restored file)

Managing IOS images using TFTP or X-modem***

***Restoration Configuration Fines from TFTP Server


Shared By: