CLI Commands
Transcript of CLI Commands
-
7/29/2019 CLI Commands
1/7
Router Command
Commands Uses Short Cut Commands a
Command USE Short cut commnad
>enable enable privilage mode >en
# configure terminal configure terminal #conf t
#exit Exit #ex
#erase start-up configure Erase start up config #erase start up config
(config)#hostname Name Change router name (config)#hostname Name(config)#ip subnet -zero allows ip subnet (config)#ip subnet -zero
(config)# ip http server allows the use of a brower (config)# ip http server
(config)#no ip domain-lookup a misspell a command (config)#no ip domain-lookup
(config-if)#bandwidth to set a bandwidth in kilobits (config-if)#band
(config-if)#no bandwidth to restore to default bandwidth (config-if)#no band
(config)#enable secret Cisco enter encrypted password (config)#enable secret Cisco
(config)#line console 0 there are 5 line console (one widow) (config)#line console 0
(config-line)#password ##### enterconsole Password (config-line)#password #####
(config-line)# login Enable password checking (config-line)# login
(config-line)#logging synchronus Returns to a fresh line (config-line)#logging synchronus(config-line)#lexec-time out 0 0 prevent sesion from timing out (config-line)#lexec-time out 0 0
(config-line)#lexit exit console (config-line)#exit
(config)#line vty 0 4 enter Telnet( creat 5 windows) (config)#line vty 0 4
(config-line)#password ##### password for vty (config-line)#password #####
(config-line)# no enable secret gets rid of password for console and vty
(config-line)# login Enable password checking (config-line)# login
(config-line)#lexit exit Telnet (config-line)#exit
(config)#service password-encryption encrypts every password on router (config)#service password-encryption
(config)# do show run shows running config
(config)#Banner motd #Message# will appear that will first on router #Banner motd #Message#
(config)#Banner login #Message# login in banner after MOTD banner (config)#Banner login #Message#
(config)#Banner exec #Message# banner appears at privilage mode (config)#Banner exec #Message#
(config)#interface f0/0 enter configuration mode (config)#int f0/0
(config-if)#description purpose of interface (config-if)#description
1
-
7/29/2019 CLI Commands
2/7
Router Command
Commands Uses Short Cut Commands a
(config-if)#ip address 0.0.0.0 255.255.255.255 ip address (config-if)#ip add 0.0.0.0 255.255.255.255
(config-if)#no shutdown turn on interface (config-if)#no shut
(config-if)#shutdown turn off interface (config-if)#shut
(config)#interface s0/0/0 enter configuration mode (config)#int s0/0/0
(config-if)#description purpose of interface (config-if)#description(config-if)#ip address 0.0.0.0 255.255.255.255 ip address (config-if)#ip address 0.0.0.0 255.255.255.255
(config-if)#clock rate 64000 clock rate must be set on DCE side (config-if)#clock rate 64000
(config-if)#no shutdown turn on interface (config-if)#no shut
(config-if)#shutdown turn off interface (config-if)#shut
(config)#int Lo0 To create a loop back address (config)#int L0
#cdp run Enable CDP on router #cdp run
#no cdp enable disable Cdp on fast Ethernet #no cdp enable
#show ip protocal shows protocols current #show ip protocol
#show ip interface brief #show ip interface brief #show ip route #how ip route
#clear ip route * clears all static routes #clear ip route *
(config)# router Rip (config)#router rip
(configure-router)#network 0.0.0.0 (config-router)#network 0.0.0.0
(configure-router)#version 2 to enable RIPv2 (config-router)#ver 2
(configure- router)#passive-interface fa0/0 get passive interface (configure- router)#passive-interface fa0/0
(configure- router)# no passive-interface fa0/0 remove passive interface (configure- router)# no passive-interface fa0/0
(configure-router)#no auto-summary disable auto summerization in protocal (configure-router)#no auto-summary
#Debug Ip rip #debug ip rip
#undebug all #undebug rip
Cisco Express forwarding
(config)# no ip cef not enable cisco express forwarding (config)# no ip cef
R1(config)# key chain Romeo R1(config)# key chain Romeo
R1(config-keychain)# key 1 R1(config-keychain)# key 1
R1(config-keychain-key)# key-string Juliet R1(config-keychain-key)# key-string Juliet
(config)# interface s0/0/0 (config)# interface s0/0/0
2
-
7/29/2019 CLI Commands
3/7
Router Command
Commands Uses Short Cut Commands a
(config-if)# ip rip authentication key-chain Romeo (config-if)# ip rip authentication key-chain Romeo
(config-if)# ip rip authentication mode md5 (config-if)# ip rip authentication mode md5
Routing bahaveiors only 1 behavior per router @ 1 time
(config)#no ip classless tell routers to work only in classfulls (config)#no ip classless
config)#no ip classfull IOS 11.3 & up is the default (config)#no ip classfull(config-router)#default-information originate sends out default address (config-router)#default-information originate
(config)#router eigrp #< 1-65535># Enable EIGRP (config)#router eigrp #< 1-65535>#
(config-router)#metric weights tos k1 k2 k3 k4 k5 Tos=types of service
K1(Bandwidth)
K2(Load)
K3(Delay)
K4(Reliability)
K5(Reliabiilty)
#show ip eigrp topology show EIGRP Topology in a router #show ip eigrp topology#show ip eigrp topology all-links shows all feasible successors and links #show ip eigrp topology all-links
(config-if)#no keepalive to activate a fastethernet interface
w/out havinga node attached
(configure-router)#eigrp log-neighbor-changes converts summerization into no (configure-router)#eigrp log-neighbor-changes
summerization
(config-if)#ip summary address eigrp 1 0.0.0.0 2.2.2.2 (config-if)#ip summary address eigrp 1 0.0.0.0 2.2.2.2
(configure-router)#redistribute static inlcudes the static route in EIGRP updates (configure-router)#redistribute static
(config)#int s0/0/0 can be used to configure the percentage (config)#int s0/0/0
(config-if)#bandwidth 64 of bandwidth that may (config-if)#bandwidth 64
(config-if)#ip bandwidth-percent eigrp 1 50 be used by EIGRP on an interface (config-if)#ip bandwidth-percent eigrp 1 50
(config)#int s0/0/0 If you change the hello interval, make (config)#int s0/0/0
(config-if)#ip hello-interval eigrp 1 60 sure that you also change the hold time (config-if)#ip hello-interval eigrp 1 60
(config-if)#ip hold-time eigrp 1 180 to a value equal to or greater than the (config-if)#ip hold-time eigrp 1 180
hello interval
3
-
7/29/2019 CLI Commands
4/7
Router Command
Commands Uses Short Cut Commands a
#debug eigrp fsm Turns on DUAL debugging #debug eigrp fsm
#undebug all Turns off DUAL debuging #undebug all
R1(config)#router ospf 1 to Enable OSPF R1(config)#router ospf 1
(config-router)#network 172.16.1.16 0.0.0.15 area 0 Single area OSPF w/ wildcard mask (config-router)#network 172.16.1.16 0.0.0.15 area 0(config-router)#router ID Rotuer ID comand (config-router)#router ID
(config-router)#router-id 2.2.2.2 Build rotuer ID (config-router)#router-id 2.2.2.2
#clear ip ospf process clears the id in running config with #clear ip ospf process
#show ip ospf #show ip ospf
#show ip ospf interface s0/0/0 show interface informaition #show ip ospf interface s0/0/0
(config-router)#network 172.16.1.17 0.0.0.0 area 0 if use 0.0.0.0 refer to interface subnet mask (config-router)#network 172.16.1.17 0.0.0.0 area 0
#show ip ospf neighbor verifites Neighbor Adjacencies #show ip ospf neighbor
flapping link
(config-router)#auto-cost reference-bandwidth ### Cisco ios if running @ >100Mbps use command (config-router)#auto-cost reference-bandwidth ###
(config)#int s0/0/0 (config)#int s0/0/0
(config-if)#ip ospf cost #### used non-cisco routers,no calculation need (config-if)#ip ospf cost ####
R1(config)#ip route 0.0.0.0 0.0.0.0 loopback 1 configure a default static route forwarding R1(config)#ip route 0.0.0.0 0.0.0.0 loopback 1
traffic toward ISP router
R1(config-router)#default-information origina gateway of last resort R1(config-router)#default-information origina
(config)#interface s0/0/0 hello& dead intervals on interfaces () (config)#interface s0/0/0
(config-if)#ip ospf hello-interval 10 (default n seconds hello interval, must match on all routers (config-if)#ip ospf hello-interval seconds
(config-if)#ip ospf dead-interval40 (default n seconds dead interval, must match on all routers (config-if)#ip ospf dead-intervalseconds
Dead interval must be 4x the hello interval
(config)#interface f0/0 (config)#int f0/0
(config-if)#ip ospf priority {0-255} To set a default interface proiorty (config-if)#ip ospf priority {0-255}
(config)#show ip ospf interface f0/0 to see priority on interface (config)#show ip ospf int f0/0
Sw# issue a mac-address table Sw# issue a mac-address table
4
-
7/29/2019 CLI Commands
5/7
Router Command
Commands Uses Short Cut Commands a
#show inventory show inventory #show inventory
#Copy runing -config startup-config Saves the current config to NVRAM #Copy runing -config startup-config
Inter -Vlan RoutingR1(config)#interface f0/0
R1(config-if)#no ip address
R1(config-if)#no shutdown
R1(config-if)#interface f0/0.10
R1(config-subif)#encapsulation dot1q 10
R1(config-subif)#ip address 172.17.10.1 255.255.255.0
R1(config-subif)#interface f0/0.30
R1(config-subif)#encapsulation dot1q 30
R1(config-subif)#ip address 172.17.30.1 255.255.255.0
making a native vlan on a router sub-interface
interface FastEthernet0/1.99
encapsulation dot1q 999 native
PPP point-to point protocol
Configuring PPP
R1#(config)#int s0/0/0 on serial connections only
R1(config)#encapsulation hdlc default encapsulation on cisco routers
or
R1(config)#encapsulation PPP used encapsulation to non cisco routers
R1(config)#ppp quality 80 Link Quality monitoring on a %
R1(config)#no ppp quality to remove LQM
PAP
R1#(config)#username R2 password cisco username & password of other router
R1#(config)#int s0/0/0
R1#(config-if)#ppp authentication ppp
R1#(config-if)#ppp pap sent-username R1 passowrd cisco
5
-
7/29/2019 CLI Commands
6/7
Router Command
Commands Uses Short Cut Commands a
R2#(config)#username R1 password cisco
R2#(config)#int s0/0/0
R2#(config-if)#ppp authentication ppp
R2#(config-if)#ppp pap sent-username R2 passowrd cisco
CHAPR1#(config)#username R2 password cisco
R1#(config)#int s0/0/0
R1#(config-if)#ppp authentication chap
R1#(config-if)#ppp pap sent-username R1 passowrd cisco
R2#(config)#username R1 password cisco
R2#(config)#int s0/0/0
R2#(config-if)#ppp authentication chap
R2#(config-if)#ppp pap sent-username R2 passowrd cisco
Multilink PPPR1#(config)#int s0/0/0
R1#(config-if)#pp multlilink
Configuring Frame Rely
R2#(config)#int s0/0/0
R2#(config-if)#encapsulation frame-relay ?
MFR Multilink fram relay bundle interface
ietf use RFC 1490/RFC 2427 encapuslaion to non
cisco routers
R2#(config-if)#frame-relay lmi-type ? if you are using a older router before IOS 11.2
cisco
ansi
q933a
Mapping Frame relay
R2#(config)#int s0/0/0
R2#(config-if)# frame-relay map ip 1982.168.10.1 102 ip addres dDLCI broadcast ?
cisco
ietf
6
-
7/29/2019 CLI Commands
7/7
Router Command
Commands Uses Short Cut Commands a
Split Horizon issues
R2#(config)#int s0/0/0
R2#(config-if)# no ip split-horizon
Network Security Configuration
TO get and deleft flash IOS to a router
R1#copy tftp: flash: to copy from tftp server to upgrade IOS
R1#delet flash: filename to delete a IOS from flash memory
Cisco auto secure
R1#auto secure to disable non-essential process & services,
eliminating potential security threat.
7