Basic Commands

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Basic commands to configure a Router

User mode:
Router>enable .Enter Enable mode
Router#configure terminal .Enter global config mode
Router(config)#
• To rename a router use command:
Router(config)#hostname newroutername
• Password configuration:
- Console password
Router(config)#line console 0
Router(config-line)#login
Router(config-line)#password password
- Vty password
Router(config)#line vty 0 4
Router(config-line)#login
Router(config-line)#password password
- Enable password
Router(config)#enable password password
- Secret password (secret password more priority than enable password. Secret password is
encryption regardless of you are enter the service password-encyption command or not)
Router(config)#enable secret password
- Password encyption
Router(config)#service password-encryption
- A login banner is a message that is displayed at login
Router(config)#banner motd # content of the message # (# begin and finish an message)
- Defines a static hostname-IP mapping
Router(config)#ip host hostname [tcp-port number] address1 [address2…address8]
(up to 08 address)
- Defines one or more DNS servers
Router(config)#ip name-server server-addr1 [server-addr2…server-addr6]
(up to 06 servers)
- DNS Enable by default on cisco Router to Disables the use of DNS on a cisco router use
command:
Router(config)#no ip domain-lookup
• Configure interface ( type includes ethernet, fastethernet, tokenring, serial and other)
Router(config)#interface type port
Router(config)#interface type module/port
Router(config-if)#ip address ip_address subnet_mark (assign ip address for interface)
Router(config-if)#no shutdown (turn on an interface)
(To turn off an interface use command: Router(config-if)#shutdown)
On serial interface in lab you must consider DCE interface and provide clocking (to check an
interface you can use the command: Router#show controllers serial port)
Router(config-if)# clock rate speed (speed=56000, 64000 … <=bandwidth )
Router(config-if)#encapsulation encap_type (On Cisco router, HDLC is the default
encapsulation on serial interface)
Router(config-if)#description description string ( configure descirption for an interface to
notify)
- To creat a loopback interface:
Router(config)#interface loopback loopback_interface_number
Router(config-if)#ip address ip_address subnet_mark
• Show commands
• show interfaces – Displays all the statistics for all the interfaces on the router or show
interfaces serial 0/1
-1-

PDF created with pdfFactory trial version www.pdffactory.com


• show controllers serial – Displays information-specific to the interface hardware
• show clock – Shows the time set in the router
• show hosts – Displays a cached list of host names and addresses
• show users – Displays all users who are connected to the router
• show history – Displays a history of commands that have been entered
• show flash – Displays information about flash memory and what IOS files are stored there
• show version – Displays information about the router and the IOS that is running in RAM
• show ARP – Displays the ARP table of the router
• show protocol – Displays the global and interface specific status of any configured Layer 3
protocols
• show startup-configuration – Displays the saved configuration located in NVRAM
• show running-configuration – Displays the configuration currently running in RAM
• CDP command
On cisco router CDP enable by default
To enable cdp on entire router use command:
Router(config)#cdp run
To enable cdp on an interface of the router use command:
Router(config-if)#cdp enable
Router#clear cdp counters Resets the traffic counters to zero
Router#clear cdp table Deletes the CDP table of information about the neighbors
Router#show cdp Display global cdp information, including timer and hold-time
information
Router#show cdp timer
Router#show cdp holdtime
Router#show cdp entry {*|device-name[*][protocol | version]}
Router#show cdp interface [type number]
Router#show cdp neighbors [type number] [detail]
Router#show cdp traffic
Router#show debuging Displays information about types of debuging that are enable
Router#debug cdp ip
Router#debug cdp packet
Router#debug cdp adjacency
Router#debug cdp events
• If CDP is disabled globally, individual interfaces cannot be enabled for CDP.
To telnet to a device:
Router>connect paris (if DNS available)
Router#paris
Router>131.108.100.152
Router>telnet paris
To terminate a Telnet session any of the following alternatives can be used:
Router>disconnect paris
Router>exit
To suspend a Telnet session:
Press Ctrl-Shift-6, then x
To set ideal timeout (default is 10 mins):
Router(config-line)#exec-timeout minute [second]
• Backup and upgrade IOS and configuration for Router
Router#copy running-config tftp copy running-config file to tftp server
Router#copy tftp running-config copy a file from tftp server to running-config
Router#copy flash tftp copy IOS from flash to tftp server
Router#copy tftp flash upgrade IOS from tftp server to flash of router
• Configure Routing protocol
o Create a static default route:
-2-

PDF created with pdfFactory trial version www.pdffactory.com


Router(config)#ip route 0.0.0.0 0.0.0.0 {out_going_interface | next_hop}
- RIP
Router#conf t
Router(config)#router rip
Router(config-router)#network network_address (each network direct connect to router
interface must have assign by network command)
Router(config-router)#timers basic update invalid holddown flush [sleeptime] Change
routing update timer parameters
Router(config-router)#passive-interface type number Stop sending routing update out
this interface
Router(config-router)#redistribute static propagate static routes over routing updates
Router#clear ip route * Clear routing table
• Other commands to troubleshoot RIP:
– show ip rip database
– show ip protocols
– show ip route
– debug ip rip {events}
– show ip interface brief
- IGRP
Router#conf t
Router(config)#router igrp Autonomous_system_number
Router(config-router)#network network_address (each network direct connect to router
interface must have assign by network command)
Verifying IGRP configuration
– show interface interface [brief]
– show running-config
– show ip protocols
The following commands are useful when troubleshooting IGRP:
– show ip protocols
– show ip route
– debug ip igrp events
– debug ip igrp transactions
– ping
– traceroute
Create a default route on the router which is being configured:
Router(config)#ip route 0.0.0.0 0.0.0.0 {ip_next_hop| interface}
Static routes can be advertised to other router via dynamic routing update using:
Router(config-router)#redistribute static
IGRP has no concept of route 0.0.0.0/0
Tell other router to choose the network as the default route:
Router(config)#ip default-network {network_number}
Network_number must be a known classfull network (taken from routing table)

-3-

PDF created with pdfFactory trial version www.pdffactory.com

You might also like