Cisco

All things Cisco

Cisco IOS Switch Basic Setup

Network Topology

image.png

Router0 Configuration Commands

Router0>enable
Router0#configure terminal
Router0(config)# interface fastEthernet 0/1
Router0(config-if)#ip address 172.16.1.1 255.255.255.0
Router0(config-if)#no shutdown
Router0(config-if)#interface fastEthernet 0/0
Router0(config-if)#ip address 192.168.10.1 255.255.255.0
Router0(config-if)#no shutdown
Router0(config-if)#exit
Router0(config)#exit
Router0#show ip interface brief

image.png

Remote Laptop Configuration

image.png

image.png

image.png

Switch0 Configuration Commands using Local Laptop and Console Cable

Connect to Switch0 using Terminal

image.png

Set hostname of the switch to Switch0

Switch>enable
Switch#configure terminal
Switch(config)#hostname Switch0
Switch0(config)#

Configure the message of the day as "Authorized access only. Unauthorized access is forbidden."

Switch0(config)#banner motd #
Enter TEXT message.  End with the character '#'.
Authorized access only. Unauthorized access is forbidden.#
Switch0(config)#end
Switch0#exit

image.png

Configure the password for privileged mode access as "cisco". The password must be md5 encrypted

Switch0>enable
Switch0#configure terminal
Switch0(config)#enable secret cisco
Switch0(config)#service password-encryption

Configure CONSOLE access with the following settings:

Switch0(config)#line con 0
Switch0(config-line)#password ciscoconsole
Switch0(config-line)#logging synchronous
Switch0(config-line)#login
Switch0(config-line)#history size 20
Switch0(config-line)#exec-timeout 5 30
Switch0(config-line)#exit
Switch0(config)#

Configure TELNET access with the following settings:

Switch0(config)#line vty 0 15
Switch0(config-line)#password ciscotelnet
Switch0(config-line)#logging synchronous
Switch0(config-line)#login
Switch0(config-line)#history size 20
Switch0(config-line)#exec-timeout 10 45
Switch0(config-line)#exit
Switch0(config)#

Configure the IP address of Switch0 as 192.168.10.2/24 and its default gateway IP (192.168.10.1).

Switch0(config)#interface vlan1
Switch0(config-if)#ip address 192.168.10.2 255.255.255.0
Switch0(config-if)#ip default-gateway 192.168.10.1
Switch0(config-if)#end
Switch0(config)#exit
Switch0>

Test Telnet Connectivity from the Remote Laptop Using Telnet Client

image.png

Change the Connection Type to Telnet and then put in Switch0's IP address.  Then click Connect.

image.png

Notice the MOTD Banner and the prompt for the telnet password.  Enter ciscotelnet.

image.png

We're in!

image.png

Cisco Packet Tracer File

net8 basic switch setup.pkt

Cisco IOS Router Static Route

Network Topology

image.png

Router0 Configuration Commands

Router0>enable
Router0#configure terminal
Router0(config)# interface fastEthernet 0/0
Router0(config-if)#ip address 172.16.1.1 255.255.255.248
Router0(config-if)#no shutdown
Router0(config-if)#interface fastEthernet 0/1
Router0(config-if)#ip address 192.168.10.1 255.255.255.0
Router0(config-if)#no shutdown
Router0(config-if)#exit
Router0(config)#ip route 192.168.20.0 255.255.255.0 172.16.1.2
Router0(config)#exit
Router0#show ip interface brief

image.png

Router0#show ip route

image.png

Router1 Configuration Commands

Router1>enable
Router1#configure terminal
Router1(config)# interface fastEthernet 0/0
Router1(config-if)#ip address 172.16.1.2 255.255.255.248
Router1(config-if)#no shutdown
Router1(config-if)#interface fastEthernet 0/1
Router1(config-if)#ip address 192.168.20.1 255.255.255.0
Router1(config-if)#no shutdown
Router1(config-if)#exit
Router1(config)#ip route 192.168.10.0 255.255.255.0 172.16.1.1
Router1(config)#exit
Router1#show ip interface brief

image.png

Router1#show ip route

image.png

Switch0 Configuration Commands

Switch0>enable
Switch0#configure terminal
Switch0(config)#int vlan1
Switch0(config-if)#ip address 192.168.10.2 255.255.255.0
Switch0(config-if)#ip default-gateway 192.168.10.1
Switch0(config-if)#no shutdown
Switch0(config-if)# exit
Switch0(config)#show interface vlan 1

image.png

Switch1 Configuration Commands

Switch1>enable
Switch1#configure terminal
Switch1(config)#int vlan1
Switch1(config-if)#ip address 192.168.20.2 255.255.255.0
Switch1(config-if)#ip default-gateway 192.168.20.1
Switch1(config-if)#no shutdown
Switch1(config-if)# exit
Switch1(config)#show interface vlan 1

image.png

PC0 Configuration

image.png

image.png

PC1 Configuration

image.png

image.png

Test Connectivity via Static Route

image.png

image.png

Cisco Packet Tracer File

net9 static routing.pkt

Cisco IOS Router on a Stick

Network Topology

image.png

Router0 Configuration Commands

Router0>enable
Router0#configure terminal
Router0(config)#interface fastEthernet 0/0
Router0(config-if)#no shutdown
Router0(config-if)#interface fastEthernet 0/0.10
Router0(config-subif)#encapsulation dot1q 10
Router0(config-subif)#ip address 192.168.10.1 255.255.255.0
Router0(config-if)#interface fastEthernet 0/0.20
Router0(config-subif)#encapsulation dot1q 20
Router0(config-subif)#ip address 192.168.20.1 255.255.255.0
Router0(config-if)#interface fastEthernet 0/0.30
Router0(config-subif)#encapsulation dot1q 30
Router0(config-subif)#ip address 192.168.30.1 255.255.255.0
Router0(config-subif)#end
Router0#show ip interface brief

image.png

Router0#show interfaces

image.png

Switch0 Configuration Commands

Switch0>enable
Switch0#configure terminal
Switch0(config)#interface fastEthernet 0/1
Switch0(config-if)#switchport mode trunk
Switch0(config-if)#interface fastEthernet 0/2
Switch0(config-if)#switchport access vlan 10
Switch0(config-if)#interface fastEthernet 0/3
Switch0(config-if)#switchport access vlan 20
Switch0(config-if)#interface fastEthernet 0/4
Switch0(config-if)#switchport access vlan 30
Switch0(config-if)#end
Switch0#show vlan brief

image.png

Switch0#show interfaces status

image.png

Configure the Three PCs

PC0

image.png

image.png

PC1

image.png

image.png

PC2

image.png

image.png

Test with Ping and Tracert

image.png

image.png

image.png

Cisco Packet Tracer File

net12 router on a stick.pkt

Cisco IOS Discovery Protocol

Network Topology

image.png

Premise

When you have a detailed topology map like the one above it is easy to know what interfaces and what devices you are working with.  However, a topology map like this is often not readily available.  Instead, you are on one end of the equation in a wiring closet or data center removed from the far side equipment and you are staring at a console screen like this.

image.png

And it is left to you to figure out what is connected to your device on the other end.  What can you use to figure this out? Cisco provides some help by the way of the Cisco Discovery Protocol (CDP). CDP is enabled by default on Cisco devices and works on directly connected interfaces. The CDP messages are configured to broadcast every 60 seconds by default.  This interval can be modified. When a device receives a CDP broadcast the information is stored in a table.  Using the show CDP neighbors will display information about directly connected Cisco devices.

Now suppose instead of a nice all-filled-in topology diagram you have this. You have been told that there are routers connected to the other end of the Router0 interfaces.  One router is a Cisco 1841 but the technician is not sure what the other router is.  The interface connected to the 1841 is in the 192.168.10.0/24 network.  The other interface should be configured within the 192.168.20.0/24 network.

image.png

Solution

Router0 Commands

Router0>enable
Router0#configure terminal
Router0(config)#interface fastEthernet 0/0
Router0(config-if)#no shutdown
Router0(config)#interface fastEthernet 0/1
Router0(config-if)#no shutdown
Router0(config-if)#end
Router0#show ip interface brief

image.png

As can be seen by the show ip interface brief command, the interfaces are up but there are no L3 IP addresses configured.  This is something that will need to be addressed later.  But for now, we can find out more about which devices are connected to which interfaces by using the show CDP commands.  First, we will check that CDP protocol is configured and working on Router0

Router0#show cdp interface

image.png

Yes, CDP is configured and sending packets every 60 seconds as is the default behavior. No let's see if there are any CDP packets coming from Cisco devices on the other in of the ethernet connections.

Router0#show cdp neighbors

image.png

The results of the show cdp neighbors command indicates that there are Cisco attached devices.  On the fast Ethernet 0/1 port the Cisco 1841 router is connected just as the technician had stated.  On the fast Ethernet port 0/0 there is a Cisco 2900 router.  In addition, we can see from the output that on the 1841 the connection is on fast Ethernet 0/0 while on the 2900 we are connected to gigabit Ethernet 0/2.  If we want more details, we can use the command show cdp entry *

Router0#show cdp entry *

image.png

From this we can see the configured IP addresses of the two connected devices.  We can verify that the connected device types are in fact routers. We can even see the Cisco IOS version installed on the routers.  Finally, we can see that the CDP type is version 2 as shown by the 'advertisement version'.

Let's jump back into Router0 and configure some IP addressing now that we know the IP addresses on the far side of the connections.

Router0(config)#interface fastEthernet 0/0
Router0(config-if)#ip address 192.168.20.2 255.255.255.0
Router0(config)#interface fastEthernet 0/1
Router0(config-if)#ip address 192.168.10.2 255.255.255.0
Router0(config-if)#end
Router0#show ip interface brief

image.png

Router0#ping 192.168.10.1

image.png

Router0#ping 192.168.20.1

image.png

Success!

Cisco Packet Tracer File

net10 cdp neighbors.pkt




Cisco IOS RIPv2 Protocol

Network Topology

image.png

Router0 Configuration Commands

Router0>enable
Router0#configure terminal
Router0(config)#interface serial 0/0/0
Router0(config-if)#ip address 172.16.1.1 255.255.255.248
Router0(config-if)#no shutdown
Router0(config-if)#interface gigabitEthernet 0/0
Router0(config-if)#ip address 192.168.10.1 255.255.255.0
Router0(config-if)#no shutdown
Router0(config-if)#exit
Router0(config)#router rip
Router0(config-router)#version 2
Router0(config-router)#network 192.168.10.0
Router0(config-router)#network 172.16.1.0
Router1(config-router)#no auto-summary
Router0(config-router)#end

Router1 Configuration Commands

Router1>enable
Router1#configure terminal
Router1(config)#interface serial 0/0/0
Router1(config-if)#ip address 172.16.1.2 255.255.255.248
Router1(config-if)#no shutdown
Router1(config-if)#interface gigabitEthernet 0/0
Router1(config-if)#ip address 192.168.20.1 255.255.255.0
Router1(config-if)#no shutdown
Router1(config-if)#exit
Router1(config)#router rip
Router1(config-router)#version 2
Router1(config-router)#network 192.168.20.0 
Router1(config-router)#network 172.16.1.0
Router1(config-router)#no auto-summary
Router1(config-router)#end

Verify RIPv2 Configuration

Router0#show ip route