Basic Router Configurations
Basic Router Configurations
SUMMARY STEPS
1. configure terminal
2. hostname name
3. enable secret password
4. no ip domain-lookup
DETAILED STEPS
Command Purpose
Step configure terminal Enters global configuration
1 Example: mode, when using the console
Router> enable port.
Router# configure terminal
Step hostname name Specifies the name for the
2 Example: router.
Router(config)# hostname Router
Step enable secret password Specifies an encrypted
3 Example: password to prevent
Router(config)# enable secret cr1ny5ho unauthorized access to the
router.
Step no ip domain-lookup Disables the router from
4 Example: translating unfamiliar words
Router(config)# no ip domain-lookup (typos) into IP addresses.
SUMMARY STEPS
1. configure terminal
2. line [ aux | console | tty | vty ] line-number
3. password password
4. login
5. exec-timeout minutes [ seconds ]
6. line [ aux | console | tty | vty ] line-number
7. password password
8. login
9. end
DETAILED STEPS
Command Purpose
Step configure terminal Enters global configuration
1 Example: mode.
Router# configure terminal
Step line [ aux | console | tty | vty ] line-number Enters line configuration mode,
2 Example: and specifies the type of line.
Router(config)# line console 0
Step password password Specifies a unique password for
3 Example: the console terminal line.
Router(config)# password 5dr4Hepw3
Step login Enables password verification
4 Example: at the terminal login session.
Router(config-line)# login
Step exec-timeout minutes [ seconds ] Sets the interval that the EXEC
5 Example: command interpreter waits until
Router(config-line)# exec-timeout 5 30 user input is detected. The
default is 10 minutes. You can
also optionally add seconds to
the interval value.
Step line [ aux | console | tty | vty ] line-number Specifies a virtual terminal for
6 Example: remote console access.
Router(config-line)# line vty 0 4
Step password password Specifies a unique password for
7 Example: the virtual terminal line.
Router(config-line)# password aldf2ad1
Step login Enables password verifiation at
8 Example: the virtual terminal login
Router(config-line)# login session.
Step end Exits line configuration mode,
9 Example: and returns to privileged EXEC
Router(config-line)# endRouter# mode.
SUMMARY STEPS
1. configure terminal
2. interface gigabitethernet slot/port
3. ip address ip-address mask
4. no shutdown
5. exit
DETAILED STEPS
Command Purpose
Step configure terminal Enters global configuration
1 Example: mode.
Router# configure terminal
Step interface gigabitethernet slot/port Enters the configuration mode
2 Example: for a Gigabit Ethernet interface
Router(config)# interface gigabitethernet 0/1 on the router.
Note GigabitEthernet LAN
Interfaces are 0/0 to 0/7 for
Cisco C841M-8X ISR and 0/0
to 0/3 for Cisco C841M-4X
ISR.
Step ip address ip-address mask Sets the IP address and subnet
3 Example: mask for the specified GE
Router(config-if)# ip address 192.168.12.2 interface.
255.255.255.0
SUMMARY STEPS
1. configure terminal
2. interface gigabitethernet slot/port
3. ip address ip-address mask
4. no shutdown
5. exit
DETAILED STEPS
Command Purpose
Step configure terminal Enters global configuration
1 Example: mode.
Router# configure terminal
Step interface gigabitethernet slot/port Enters the configuration mode
2 Example: for a Gigabit Ethernet interface
Router(config)# interface gigabitethernet 0/8 on the router.
Note GigabitEthernet WAN
Interfaces are 0/8 and 0/9 for
Cisco C841M-8X ISR and 0/4
to 0/5 for Cisco C841M-4X
Step ip address ip-address mask Sets the IP address and subnet
3 Example: mask for the specified GE
Router(config-if)# ip address 192.168.12.2 interface.
255.255.255.0
SUMMARY STEPS
1. configure terminal
2. interface type number
3. ip address ip-address mask
4. exit
DETAILED STEPS
Command Purpose
Step configure terminal Enters global configuration
1 Example: mode.
Router# configure terminal
Step interface type number Enters configuration mode for
2 Example: the loopback interface.
Router(config)# interface Loopback 0
SUMMARY STEPS
1. configure terminal
2. ip route prefix mask { ip-address | interface-type interface-number [ ip-address ]}
3. end
DETAILED STEPS
Command Purpose
Step configure terminal Enters global configuration
1 Example: mode.
Router# configure terminal
Step ip route prefix mask { ip-address | interface- Specifies the static route for the
2 type interface-number [ ip-address ]} IP packets.
Example:
Router(config)# ip route 192.168.1.0 255.255.0.0
10.10.10.2
SUMMARY STEPS
1. configure terminal
2. router rip
3. version { 1 | 2 }
4. network ip-address
5. no auto-summary
6. end
DETAILED STEPS
Command Task
Step configure terminal Enters global configuration
1 Example: mode.
Router> configure terminal
Step router rip Enters router configuration
2 Example: mode, and enables RIP on the
Router(config)# router rip router.
Step version { 1 | 2 } Specifies use of RIP version 1
3 Example: or 2.
Router(config-router)# version 2
Configuring OSPF 1
OSPF’s basic configuration is very simple. Just like with other routing protocols covered so far
(RIP, EIGRP) first you need to enable OSPF on a router. This is done by using the router ospf
PROCESS-ID global configuration command. Next, you need to define on which interfaces OSPF
will run and what networks will be advertised. This is done by using the network IP_ADDRESS
WILDCARD_MASK AREA_ID command from the ospf configuration mode.
Let’s get started with some basic OSPF configuration. We will use the following network
topology:
First, we need to enable OSPF on both routers. Then we need to define what network will be
advertised in OSPF. This can be done by using the following sequence of commands on both
routers:
R1(config-router)#router ospf 1
R1(config-router)#network 10.0.1.0 0.0.0.255 area 0
R1(config-router)#network 172.16.0.0 0.0.255.255 area 0
R2(config-router)#router ospf 1
R2(config-router)#network 192.168.0.0 0.0.0.255 area 0
R2(config-router)#network 172.16.0.0 0.0.255.255 area 0
The network commands entered on both routers include subnets directly connected to both routers.
We can verify that the routers have become neighbors by typing the show ip ospf
neighbors command on either router: