Cisco Basic Router and Switch Configuration

Cisco Basic Router and Switch Configuration

Router and Switch Configuration

In this Cisco CCNA tutorial, you’ll learn about a basic initial Router and Switch Configuration configuration to put on your routers and switches.

Router IP Addresses ( Router and Switch Configuration)

One of the first things it will do is configure IP addresses. Your routers provide connectivity between your different IP subnets, and that’s their main job. The routers need to have interfaces in the different subnets, and they need to have IP addresses on those interfaces.

Those IP addresses will act as the default gateway address for any hosts that are in that subnet. The command to put an IP address on an interface goes to the interface.

For example, we’ve got a router down at the bottom. The interface FastEthernet0/0 on the right has an IP address, and the interface on the left, FastEthernet0/1, has an IP address /24. The IP addresses need to be in different subnets that are on different interfaces.

Cisco Basic Router and Switch Configuration - Router IP Addresses

From the global configuration mode, we go to interface configuration mode using the command ‘interface FastEthernet0/0’. Then to put the IP address on there, add ‘ip address’, space, ‘’, then another space, and then the ‘subnet mask’.

The IP address and the subnet mask are both entered with one command, and you must enter the subnet mask in full dotted decimal notation. You can’t enter /24 in IOS.

On our routers, interfaces are shut down by default. Use the ‘no shutdown’ command to bring the interface up. So we do that for interface FastEthernet0/0, and then we also need to configure interface FastEthenet0/1. It gets IP address, subnet mask, ‘no shutdown’.

After configuring this, the router can route traffic between those two networks. As well as being able to route traffic, it also gives IP connectivity to the router itself. So after we’ve done this, we could open up a Telnet or SSH client, like Putty, and connect to the router to manage it.

So obviously, this is more convenient than having a walk down there with a console cable and hook it up physically every time. Once you’ve got IP addresses on your router, you’ll be able to connect to those IP addresses to manage the router remotely from wherever you are.

Switch Management IP Address ( Router and Switch Configuration)

We’re also going to need an IP address on our switch to manage that as well. A Layer 2 switch is not IP routing aware and does, however, support a single IP address used for management. You can’t put multiple IP addresses on a Layer 2 switch, and it will only allow you to put one IP address. To manage it, we can again Telnet or Secure Shell (SSH) to the switch remotely.

Unlike on a router, where we configure the IP address on an interface, on a switch, a Layer 2 switch, the management IP address goes on a VLAN interface, a virtual interface. So when we configure our VLAN interface, that’s called an SVI, Switched Virtual Interface, which will be in VLAN 1.

Cisco Basic Router and Switch Configuration - Switch Management IP Address

Now, I know we haven’t covered VLANs yet. They’re going to be configured in another section, for all you need to know for now is that the default VLAN is VLAN 1, and all of our Layer 2 switch ports on a switch will be in VLAN 1 by default.

We configure our management IP address on the virtual VLAN 1 interface to get management connectivity to the switch. That will allow us to connect to the switch from the same IP subnet that the IP address is in.

However, our administrators will probably be located somewhere else, and they will be in a different IP subnet, so this switch also needs to be able to get out to that subnet. Like a normal host would need, it will also need a default gateway.

Cisco Basic Router and Switch Configuration - Switch Management IP Address 1

Router and Switch Configuration

Our configuration on our switch for our management IP address, ‘interface vlan 1’, then we configure the IP address the same way. So I’ve got IP address, subnet mask Now, interfaces are shut down on a router by default, and on a switch, interfaces are enabled by default. So there wasn’t any need to do a ‘no shutdown’ here.

However, I’m just in the practice that whenever I configure an interface, I always do a ‘no shutdown’ on there. It doesn’t do any harm, and it saves me having to think, “Do I need to do a ‘no shutdown’ or not?” Just always do a ‘no shutdown’ whenever you configure an interface, which saves you from forgetting it.

We exit to global configuration mode, and to configure the default gateway, the command is ‘ip default-gateway’. That will give us IP connectivity on this switch, and we’ll be able to ping this switch and ping it out. Now, I said that this IP address is for management. We still need to do some additional commands to allow Telnet and/or SSH access to the switch.

Lab Example ( Router and Switch Configuration)

Let’s look at how to do this in the lab. For the lab example, we’ve got router R1, and we’ll configure IP address on the physical interface FastEthernet0/0. That’s going to be the default gateway address for our switch, which is SW1. SW1 will be connected to the router through the physical interface FastEthernet0/1, which will be in VLAN 1 by default.

For the management IP address, we will configure that on the VLAN 1 Switched Virtual Interface. We’ll give that IP address Once we’ve done that, the switch should have connectivity to because it’s on the same subnet.

However, we want it to have connectivity to other subnets out through the router. So we’ll also configure the switch with an IP default gateway address of

I better configure the router first because it also has a new configuration. So I’ll go ’enable’, ’configure terminal’, ’interface FastEthernet0/0’. I will give that IP address, ’ip address’. I have to remember to do a ‘no shutdown’ on here. Okay, so that’s the router configured.

Cisco Basic Router and Switch Configuration - Lab Example

Router and Switch Configuration

Then I go to the switch and enter ‘enable’ and ‘configure terminal’. This was on the VLAN interface, so ‘interface vlan 1’ and ‘ip address’. It is not shut down by default anyway, but it doesn’t do any harm by doing a ‘no shutdown’ on the interface. Now the switch should be able to communicate with the router. Let’s check that.

I’ll go back down to the enable prompt and go ‘ping’, and we’ve got connectivity. That’s all good, and I’ve got connectivity on my subnet. But I want to be able to get out to other subnets as well, so I need to configure the default gateway. The command for that is ‘ip default-gateway’. That is the initial IP connectivity configured there.

Hostname ( Router and Switch Configuration)

The next thing we want to do for the basic configuration is to configure a hostname. A descriptive hostname makes it easier to identify the device. For example, I could maybe call it New York-F1-Switch1. So typically, you will specify where the Switch is and perhaps some other descriptive description there. In the lab, I’m just going to call it ‘hostname SW1’ for Switch 1.

The default hostname on a switch is just Switch. That’s what is showing up on the command prompt. When I enter ‘hostname SW1’ and hit enter, the command prompt immediately changes to show the hostname.

Cisco Basic Router and Switch Configuration - Hostname

Router and Switch Configuration

This is useful because a common mistake is configuring the wrong device by accident. Having the hostname showing up here makes it a little bit less likely that you’re going to do that. So it gives you a nice description, and you can see what device you’re on.

Also, if you’re troubleshooting from neighboring devices, it will show up as its hostname as well, so it just makes it easy to see what’s going on.

Interface Descriptions

Next, we’ll want to configure our interfaces’ descriptions. Interface FastEthernet 0/1 was connected to the router, so let’s put a description there. Back to the command line, I go to interface FastEthernet 0/1, and I’ll say ‘description Link to R1’.

Again, this is going to be useful for troubleshooting later. If I’m troubleshooting and looking at the configuration here, I can immediately see that FastEthernet 0/1 is the interface connected to router R1.

Cisco Basic Router and Switch Configuration - Interface Descriptions

Additional Resources

Router and Switch Configuration:

Cisco Networking Academy’s Introduction to Basic Switching Concepts and Configuration:

Cisco IOS Router Basic Configuration:

Configure an IP Address on a Switch:

Want to practice Cisco CCNA technologies on your laptop? Download my complete 350-page Cisco CCNA Lab Guide for free.

Click Here to get my Cisco CCNA Gold Bootcamp, the highest rated CCNA course online with a 4.8 star rating from over 20,000 public reviews.

Learn More…

Storage Design and Implementation in vSphere 6

Practical Splunk for Beginners LiveLessons (Video Training)

Modern Web Development with IBM WebSphere

The Pearson Complete Course for CISM Certification

What is the difference between leadership and management?

How to be Data Visualisation expert 

AWS Console: Deep Dive Into AWS Management Interface

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.