Basic Router & Switch IOS configuration commands - CCNA beginner
Table of Contents
Introduction
This tutorial provides a comprehensive guide on basic router and switch IOS configuration commands essential for beginners in Cisco's CCNA program. These commands are foundational for setting up and managing network devices, ensuring you can navigate and configure your router and switch effectively.
Step 1: Accessing Device Modes
To start configuring your router or switch, you need to access different command modes:
-
User EXEC Mode
- Access this mode by connecting to the device. The prompt will display as
Router>
orSwitch>
. - Exit this mode by typing
exit
.
- Access this mode by connecting to the device. The prompt will display as
-
Privileged EXEC Mode
- Enter this mode by typing
enable
. The prompt changes toRouter#
orSwitch#
. - Exit by typing
disable
orexit
.
- Enter this mode by typing
-
Global Configuration Mode
- From the Privileged EXEC mode, type
configure terminal
. The prompt changes toRouter(config)#
orSwitch(config)#
. - Exit by typing
exit
,end
,Ctrl+C
, orCtrl+Z
.
- From the Privileged EXEC mode, type
Step 2: Configuring Line and Interface Settings
To set up user access and interface configurations, follow these steps:
-
Line Configuration
- Access VTY lines configuration:
Router(config)# line vty 0 15
- Access the console line configuration:
Router(config)# line console 0
- Access VTY lines configuration:
-
Interface Configuration
- To configure a specific interface, use:
Router(config)# interface gigabitEthernet 0/0/0
- To configure a specific interface, use:
-
Setting Passwords and Login
- In line configuration mode:
Router(config-line)# password cisco Router(config-line)# login Router(config-line)# transport input all // for VTY lines
- In line configuration mode:
-
Configuring Interface IP Address
- While in interface configuration mode:
Router(config-if)# ip address 192.168.1.1 255.255.255.0 Router(config-if)# no shutdown
- While in interface configuration mode:
Step 3: Configuring Router Settings
Next, set essential router configurations:
-
Setting Hostname and Banner
- Change the hostname:
Router(config)# hostname R1
- Set a message of the day (MOTD):
Router(config)# banner motd "No unauthorized access allowed!"
- Change the hostname:
-
Configuring Passwords
- Set the enable password:
Router(config)# enable password class Router(config)# enable secret class Router(config)# service password-encryption
- Set the enable password:
-
Save Configuration
- Save your running configuration to startup configuration:
Router# copy running-config startup-config
- Save your running configuration to startup configuration:
Step 4: Testing Network Connectivity
You can test connectivity with the following commands:
- To check if a device is reachable, use:
Router# ping 192.168.1.100
- To trace the route to a device:
Router# traceroute 192.168.1.100
Step 5: Additional Helpful Commands
Consider adding these commands to improve your configuration experience:
-
Disable DNS lookups to avoid delays from mistyped commands:
Router(config)# no ip domain-lookup
-
Prevent logging output from interrupting command input:
Router(config-line)# logging synchronous
Conclusion
In this tutorial, we've covered essential IOS configuration commands for both routers and switches. Mastering these commands will prepare you for more advanced configurations and troubleshooting. As you continue your CCNA journey, practice these commands regularly to build your confidence and proficiency.