Friday, April 5, 2019

Basic Routing - vlan - connected

This is an extension to my previous vlan posts.

Basic Routing on Multilayer Switch - Connected Network - No VLAN
Basic Routing on Multilayer Switch 2 - Connected Network - No VLAN

We keep 3 networks and do intervlan routing with Multilayer switch as below:

Topology
Keep the following picture as a reference while reading the info for better understanding.

Reference Topology

Task Breakup
  1. Configure IP Addresses of Laptops
  2. Create VLANs on Switch
  3. Assign VLANs to Interfaces on Switch
  4. Configure IP Addresses to VLAN on Switch
  5. View VLAN Information
  6. Enabling Routing
  7. Validation
  8. Alternate Topology

1. Configure IP Addresses of Laptops

PC NameIP AddressSubnet MaskDefault Gateway
Inside1-1172.16.0.11255.255.0.0172.16.0.1
Inside1-2172.16.0.12255.255.0.0172.16.0.1
Inside2-110.0.0.11255.0.0.010.0.0.1
Inside2-210.0.0.12255.0.0.010.0.0.1
Outside5.0.0.11255.0.0.05.0.0.1

Click Laptop -> Desktop -> IP Configuration

IP Address Configuration - Outside Laptop

2. Create VLANs on Switch

As a good convention, we create VLANs and assign names to them

routing(config)#vlan 172
routing(config-vlan)#name vlan-172
routing(config-vlan)#exit
routing(config)#vlan 10
routing(config-vlan)#name vlan-10
routing(config-vlan)#exit
routing(config)#vlan 5
routing(config-vlan)#name vlan-5
routing(config-vlan)#exit

3. Assign VLANs to Interfaces on Switch

PC NameIP AddressSubnet MaskDefault GatewaySwitchport interfaceVLAN ID
Inside1-1172.16.0.11255.255.0.0172.16.0.1gig 1/0/1VLAN 172
Inside1-2172.16.0.12255.255.0.0172.16.0.1gig 1/0/2VLAN 172
Inside2-110.0.0.11255.0.0.010.0.0.1gig 1/0/11VLAN 10
Inside2-210.0.0.12255.0.0.010.0.0.1gig 1/0/12VLAN 10
Outside5.0.0.11255.0.0.05.0.0.1gig 1/0/5VLAN 5


routing(config)#int gig 1/0/1
routing(config-if)#switchport mode access
routing(config-if)#switchport access vlan 172
routing(config-if)#exit
routing(config)#int gig 1/0/2
routing(config-if)#switchport mode access
routing(config-if)#switchport access vlan 172

routing(config)#int gig 1/0/11
routing(config-if)#switchport mode access
routing(config-if)#switchport access vlan 10
routing(config-if)#exit
routing(config)#int gig 1/0/12
routing(config-if)#switchport mode access
routing(config-if)#switchport access vlan 10
routing(config-if)#exit

routing(config)#int gig 1/0/5
routing(config-if)#switchport mode access
routing(config-if)#switchport access vlan 5
routing(config-if)#exit

4. Configure IP Addresses to VLAN on Switch

VLAN IDVLAN NameVLAN IP Address
172vlan-172172.16.0.1
10vlan-1010.0.0.1
5vlan-55.0.0.1

routing(config)#int vlan 172
routing(config-if)#ip address 172.16.0.1 255.255.0.0
routing(config-if)#no shut
routing(config-if)#exit
routing(config)#int vlan 10
routing(config-if)#ip address 10.0.0.1 255.0.0.0
routing(config-if)#no shut
routing(config-if)#exit
routing(config)#int vlan 5
routing(config-if)#ip address 5.0.0.1 255.0.0.0
routing(config-if)#no shut
routing(config-if)#exit

5. View VLAN Information

The following show commands gives an overview of what VLANs are assigned to which interfaces and the IP Address of VLANs

routing#show vlan br

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Gig1/0/3, Gig1/0/4, Gig1/0/6, Gig1/0/7
                                                Gig1/0/8, Gig1/0/9, Gig1/0/10, Gig1/0/13
                                                Gig1/0/14, Gig1/0/15, Gig1/0/16, Gig1/0/17
                                                Gig1/0/18, Gig1/0/19, Gig1/0/20, Gig1/0/21
                                                Gig1/0/22, Gig1/0/23, Gig1/0/24, Gig1/1/1
                                                Gig1/1/2, Gig1/1/3, Gig1/1/4
5    vlan-5                           active    Gig1/0/5
10   vlan-10                          active    Gig1/0/11, Gig1/0/12
172  vlan-172                         active    Gig1/0/1, Gig1/0/2
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active 


routing#show ip int br
Interface              IP-Address      OK? Method Status                Protocol 
GigabitEthernet1/0/1   unassigned      YES NVRAM  up                    up 
GigabitEthernet1/0/2   unassigned      YES NVRAM  up                    up 
............
...........
GigabitEthernet1/1/3   unassigned      YES NVRAM  down                  down 
GigabitEthernet1/1/4   unassigned      YES NVRAM  down                  down 
Vlan1                  unassigned      YES NVRAM  administratively down down 
Vlan5                  5.0.0.1         YES manual up                    up 
Vlan10                 10.0.0.1        YES manual up                    up 
Vlan172                172.16.0.1      YES manual up                    up

6. Enabling Routing

Routing might be already enabled. It doesn't hurt to enable one more time.

routing#conf t
routing(config)#ip routing
routing(config)#exit

In the show command, if Connected Network information is shown, it means routing is enabled.

routing#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    5.0.0.0/8 is directly connected, Vlan5
C    10.0.0.0/8 is directly connected, Vlan10
C    172.16.0.0/16 is directly connected, Vlan172

7. Validation

Issue ping from any Laptop to any Laptop, it will be success.

Successful ping from Inside2-1 to Outside


Successful ping from Outside to Inside1-1

8. Alternate Topology


If there is no multilayer switch and we use Router, our topology has to be like this.  We will not be using VLANs.  All the laptops that are earlier connected to same VLAN, will be connected to a hub here.



Wednesday, April 3, 2019

Basic Routing on Multilayer Switch 2 - Connected Network - No VLAN

Today, we are enhancing a little bit our previous post

https://activehub2.blogspot.com/2019/03/basic-routing-on-multilayer-switch.html

Earlier we had a single inside laptop.  Now we are placing one more laptop on the inside.  Both laptops are connected to Hub, that in turn connected to the port of the switch.

All the configurations will be same.

Topology
Task Breakup


  1. Configuring IP Address on Laptops
  2. Configuring IP Address on Switch
  3. Analysis before Routing
  4. Enable Routing
  5. Analysis after Routing
  6. Validation


1. Configuring IP address on Laptops

Click on Laptop -> Desktop -> IP Configuration


Inside1 - IP Address - Configuration

Inside2 - IP Address - Configuration

Outside - IP Address - Configuration
2. Configure IP addresses on Switch

As it is a multilayer switch, by default it will act as a switchport.  We have to convert to routing interface, by the command 'no switchport'.  Setting the IP address as mentioned in the Topology

routing(config)#int gig 1/0/1
routing(config-if)#no switchport
routing(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up

routing(config-if)#ip address 172.16.0.1 255.255.0.0
routing(config-if)#no shut
routing(config-if)#exit
routing(config)#int gig1/0/10
routing(config-if)#no switchport
routing(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/10, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/10, changed state to up

routing(config-if)#ip address 5.0.0.1 255.0.0.0
routing(config-if)#no shut
routing(config-if)#exit

3. Analysis before Routing

Enable Packet Debugging

routing#debug ip packet
Packet debugging is on

Observe the IP Routing table is empty

routing#show ip route 
Default gateway is not set

Host               Gateway           Last Use    Total Uses  Interface
ICMP redirect cache is empty

routing#

4. Enable Routing

I am not sure if Routing is enabled by default.  Even it is enabled, it doesn't hurt to enable with the command 'ip routing'.

routing#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
routing(config)#ip routing 
routing(config)#exit

5. Analysis after Routing

Observe that IP Routing table will show connected networks.  It means, packets can be passed between those networks.

routing#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    5.0.0.0/8 is directly connected, GigabitEthernet1/0/10
C    172.16.0.0/16 is directly connected, GigabitEthernet1/0/1

6. Validation

Issue a ping from inside2 to outside.  It will be successful.

Successful ping from inside to outside

As packet debug is enabled in step 3, we will observe some routing information that the switch has processed to route packets between inside and outside network.


IP: tableid=0, s=172.16.0.11 (GigabitEthernet1/0/1), d=5.0.0.2 (GigabitEthernet1/0/10), routed via RIB

IP: s=172.16.0.11 (GigabitEthernet1/0/1), d=5.0.0.2 (GigabitEthernet1/0/10), g=5.0.0.2, len 128, forward

IP: tableid=0, s=5.0.0.2 (GigabitEthernet1/0/10), d=172.16.0.11 (GigabitEthernet1/0/1), routed via RIB

IP: s=5.0.0.2 (GigabitEthernet1/0/10), d=172.16.0.11 (GigabitEthernet1/0/1), g=172.16.0.11, len 128, forward

Issue a ping from outside to inside1 laptop.  It will be successful.  Observe the packet debug info.

Successful ping - Outside - Inside1


IP: tableid=0, s=5.0.0.2 (GigabitEthernet1/0/10), d=172.16.0.10 (GigabitEthernet1/0/1), routed via RIB

IP: s=5.0.0.2 (GigabitEthernet1/0/10), d=172.16.0.10 (GigabitEthernet1/0/1), g=172.16.0.10, len 128, forward

IP: tableid=0, s=172.16.0.10 (GigabitEthernet1/0/1), d=5.0.0.2 (GigabitEthernet1/0/10), routed via RIB

IP: s=172.16.0.10 (GigabitEthernet1/0/1), d=5.0.0.2 (GigabitEthernet1/0/10), g=5.0.0.2, len 128, forward