oak(config) - Chabot College

advertisement
Chabot College
ELEC 99.08
IOS Configuration Commands
CISCO NETWORKING ACADEMY
Configuration Topics
•
•
•
•
Configuration file
Ways to enter a config file to the router
IOS configuration commands
Additive editing
CISCO NETWORKING ACADEMY
Configuration File
•
•
•
•
Just a text file
Text instructions are interpreted by the EXEC.
Loaded to RAM
Changes in the config file take place
instantaneously. No reboot or other process is
required.
CISCO NETWORKING ACADEMY
Configuration File
• Commands may be entered in any order; the
IOS will place the commands in the correct
position in the config file.
• Editing is additive. More about this later...
CISCO NETWORKING ACADEMY
Config may be entered from
• NVRAM This is the default at reload or cold start.
– rtr#config memory
– rtr#copy start run
• Setup Mode dialog
– rtr#setup
• TFTP server
– rtr#config network
– rtr#copy tftp run
• Terminal (con0, aux0, vty0 4)
– rtr#config terminal
CISCO NETWORKING ACADEMY
Also:
CISCO NETWORKING ACADEMY
Review: Which mode is this?
• oak(config)#
• Global configuration mode
Used for:
– General configuration commands
– Static routes
CISCO NETWORKING ACADEMY
Review: Which mode is this?
• oak(config-if)#
• Interface configuration mode
Used for:
– Setting IP addresses and subnet masks
– Setting other interface characteristics
CISCO NETWORKING ACADEMY
Review: Which mode is this?
• oak(config-router)#
• Router configuration mode
Used for:
– Setting routing protocols
CISCO NETWORKING ACADEMY
Review: Which mode is this?
• oak(config-line)#
• Line configuration mode
Used for:
– Setting login passwords on lines:
• con 0
• aux 0
• vty 0 4
CISCO NETWORKING ACADEMY
Global, Interface, Line & Router Modes
CISCO NETWORKING ACADEMY
Global Config Commands
• hostname
– name of router
– format: one word, no spaces
– changes instantaneously
rtr#conf t
rtr(config)#hostname oak
oak(config)#banner motd $Router Admin: J. Jones$
oak(config)#ip route 0.0.0.0 0.0.0.0 s1
oak(config)#enable password cisco
oak(config)#enable secret chabot
CISCO NETWORKING ACADEMY
Global Config Commands
• banner motd
– message of the day (shown at login)
– format: repeated character delimits message
– in example below, $ is delimiter
rtr#conf t
rtr(config)#hostname oak
oak(config)#banner motd $Router Admin: J. Jones$
oak(config)#ip route 0.0.0.0 0.0.0.0 s1
oak(config)#enable password cisco
oak(config)#enable secret chabot
CISCO NETWORKING ACADEMY
Global Config Commands
• ip route
– defines a “static” route
– format: ip route x.x.x.x (address) y.y.y.y (mask) interface
– in example below, the “default route” is set
rtr#conf t
rtr(config)#hostname oak
oak(config)#banner motd $Router Admin: J. Jones$
oak(config)#ip route 0.0.0.0 0.0.0.0 s1
oak(config)#enable password cisco
oak(config)#enable secret chabot
CISCO NETWORKING ACADEMY
Global Config Commands
• enable passwword
– sets the weak “enable” password
– format: enable password [word]
rtr#conf t
rtr(config)#hostname oak
oak(config)#banner motd $Router Admin: J. Jones$
oak(config)#ip route 0.0.0.0 0.0.0.0 s1
oak(config)#enable password cisco
oak(config)#enable secret chabot
CISCO NETWORKING ACADEMY
Global Config Commands
• enable secret
– sets the encrypted “enable secret” password
– format: enable secret [word]
– once entered, will not be readable in config file
rtr#conf t
rtr(config)#hostname oak
oak(config)#banner motd $Router Admin: J. Jones$
oak(config)#ip route 0.0.0.0 0.0.0.0 s1
oak(config)#enable password cisco
oak(config)#enable secret chabot
CISCO NETWORKING ACADEMY
Global Config Commands
• no ip domain-lookup
– turns off DNS lookups
– format: no ip domain lookup
– useful in lab, where there is no DNS
rtr#conf t
rtr(config)#hostname oak
oak(config)#banner motd $Router Admin: J. Jones$
oak(config)#ip route 0.0.0.0 0.0.0.0 s1
oak(config)#enable password cisco
oak(config)#enable secret chabot
oak(config)#no ip domain-lookup
CISCO NETWORKING ACADEMY
Global Config - Practice
• Try it now with Router e-Sim:
• Enter global config mode.
• Enter the following commands:
router>en
router#conf t
router(config)#hostname hayward
hayward(config)#banner motd $Administered by(yourname)$
hayward(config)#enable password cisco
hayward(config)#enable secret chabot
hayward(config)#exit
hayward#exit
• then log in again, and note the motd and passwords
CISCO NETWORKING ACADEMY
Global config: changing to Interface Config
• interface ethernet 0
– selects the interface to be configured
– format: int e0 (substitute s0, s1, or e1 as appropriate)
– prompt gives no indication of the current interface
being configured.
oak#conf t
oak(config)#int e0
oak(config-if)#
CISCO NETWORKING ACADEMY
Interface Config Commands
• ip address
– sets ip address & subnet mask
– format: ip address x.x.x.x (address) y.y.y.y (mask)
oak#conf t
oak(config)#int e0
oak(config-if)#ip address 192.168.4.1 255.255.255.0
oak(config-if)#
CISCO NETWORKING ACADEMY
Interface Config Commands
• descripton
– comment to describe the interface
– format: desc [text text text]
oak#conf t
oak(config)#int e0
oak(config-if)#ip address 192.168.4.1 255.255.255.0
oak(config-if)#desc Oakland LAN
oak(config-if)#
CISCO NETWORKING ACADEMY
Interface Config Commands
• no shutdown
– brings up an interface that was
administratively shut down
– format: no shut
oak#conf t
oak(config)#int e0
oak(config-if)#ip address 192.168.4.1 255.255.255.0
oak(config-if)#desc Oakland LAN
oak(config-if)#no shut
oak(config-if)#
CISCO NETWORKING ACADEMY
Interface Config Commands
• exit
– returns to Global Config mode
– format: exit
oak#conf t
oak(config)#int e0
oak(config-if)#ip address 192.168.4.1 255.255.255.0
oak(config-if)#desc Oakland LAN
oak(config-if)#no shut
oak(config-if)#exit
oak(config)#
CISCO NETWORKING ACADEMY
Interface Config - Practice
• Try it now with Router e-Sim:
• show interface e0 and note:
– is the interface UP and UP?
– is an IP address shown?
• Enter interface config mode for Ethernet 0.
• Enter the following commands:
hayward(config)#int eo
hayward(config-if)#ip address 192.168.3.1 255.255.255.0
hayward(config-if)#desc This is the Hayward LAN
hayward(config-if)#no shut
hayward(config)#exit
hayward#exit
• then show int e0 and note the effects of your configuration
CISCO NETWORKING ACADEMY
Global config: changing to Line Config
• line con 0
– selects the line to be configured
– format: line vty 0 4 (substitute con 0 or aux 0 as appropriate)
– prompt gives no indication of the current line being
configured.
oak#conf t
oak(config)#line con 0
oak(config-line)#
CISCO NETWORKING ACADEMY
Line Config Commands
• login
– enables password control for login
– format: login
oak#conf t
oak(config)#line con 0
oak(config-line)login
oak(config-line)#
CISCO NETWORKING ACADEMY
Line Config Commands
• password
– defines the password for this line
– format: password [word]
oak#conf t
oak(config)#line con 0
oak(config-line)login
oak(config-line)#password cisco
oak(config-line)#
CISCO NETWORKING ACADEMY
Line Config Commands
• exit
– returns to Global Config mode
– format: exit
oak#conf t
oak(config)#line con 0
oak(config-line)login
oak(config-line)#password cisco
oak(config-line)#exit
oak(config)#
CISCO NETWORKING ACADEMY
Line Config - Practice
• Try it now with Router e-Sim:
• show run and note whether there are passwords on line con 0,
aux 0, and vty 0
• Enter line config mode for con 0.
• Enter the following commands:
Notice
the
change
here
hayward(config)#line con 0
hayward(config-line)#login
hayward(config-line)#password cisco
hayward(config-line)#line vty 0 4
hayward(config-line)#login
hayward(config-line)#password cisco
hayward(config-line)#exit
hayward#^Z
• then show run and note the effects of your configuration
CISCO NETWORKING ACADEMY
Additional Line Config Command
• logging synchronous
– prevents system messages from interrupting
your typing input in the middle of a line
– add to console line
– format: logging synchronous
oak#conf t
oak(config)#line con 0
oak(config-line)logging synchronous
oak(config-line)#
CISCO NETWORKING ACADEMY
Additional Line Config Command
• logging synchronous
– Router e-Sim doesn’t understand this
command, so you can’t practice with it.
– Useful in in your real config files.
oak#conf t
oak(config)#line con 0
oak(config-line)login
oak(config-line)#password cisco
oak(config-line)logging synchronous
oak(config-line)#
CISCO NETWORKING ACADEMY
Global config: changing to Router Config
• router rip
– selects the dynamic routing protocol
– format: router [protocol] (rip or igrp as appropriate)
oak#conf t
oak(config)#router rip
oak(config-router)#
CISCO NETWORKING ACADEMY
Router Config Commands
• network
– sets the networks on which the protocol will
send and receive updates
– format: network x.x.x.x
oak#conf t
oak(config)#router rip
oak(config-router)#network 192.168.4.0
oak(config-router)#network 10.0.0.0
oak(config-router)#
CISCO NETWORKING ACADEMY
Router Config Commands
• exit
– returns to Global Config mode
– format: exit
oak#conf t
oak(config)#router rip
oak(config-router)#network 192.168.4.0
oak(config-router)#network 10.0.0.0
oak(config-router)#exit
oak(config)#
CISCO NETWORKING ACADEMY
Router Config - Practice
• Try it now with Router e-Sim:
• show run and note whether RIP has been set as the dynamic
routing protocol
• Enter line router config mode
• Enter the following commands:
hayward(config)#router rip
hayward(config-router)#network 10.0.0.0
hayward(config-router)#network 192.168.3.0
hayward(config-router)#exit
hayward(config)#exit
hayward#exit
• then show run and note the effects of your configuration
CISCO NETWORKING ACADEMY
“No” Commands
• To remove or reverse any command, type
the command again, preceded by no
oak#conf t
oak(config)#no router rip
oak(config)#
CISCO NETWORKING ACADEMY
“No” Command - Practice
• Try it now with Router e-Sim:
• show run and note whether RIP has been set as the dynamic
routing protocol
• Enter global config mode
• Enter the following commands:
hayward(config)#no router rip
hayward(config)#exit
hayward#sh ru
• then show run and note whether RIP has been deleted
CISCO NETWORKING ACADEMY
“No” Command - Practice
• Earlier, you set the ethernet 0
– IP address and subnet mask
– description
• Now try using the no command to remove them.
• Answer:
hayward(config)#int e0
hayward(config-if)#no ip address
hayward(config-if)#no desc
hayward(config-if)#exit
hayward(config)#exit
hayward#sh ru
CISCO NETWORKING ACADEMY
Additive Editing
• New commands add to the file and replace like
commands only.
• Other commands remain in the config.
• Even if you load an entire config file to RAM,
old commands not included in the new config
file will remain in RAM.
• Confusion and problems can result.
• Principle: Start clean to be sure:
– erase start, reload
CISCO NETWORKING ACADEMY
Additive Editing - Results of Loading a Config on Top of a Current Config
2. New Config
Loaded from
NVRAM or TFTP
!
hostname oakland
!
enable password cisco
!
!
!
ip route 0.0.0.0 0.0.0.0 s1
!
no router rip
+
1. Current
Running Config
in RAM
!
hostname hayward
!
enable password cisco
!
banner motd $Shutdown 4PM$
!
!
!
router rip
=
3. Resulting
Running Config
in RAM
!
hostname oakland
!
enable password cisco
!
banner motd $Shutdown 4PM$
!
ip route 0.0.0.0 0.0.0.0 s1
!
!
Whatthe
Will
will
resulting
be the resulting
config include
hostname?
enable
apassword?
rip
banner
static
routing?
ipmotd?
route?
CISCO NETWORKING ACADEMY
Download