Inter vlan Routing (router on a stick ) configuration

Ro

Router on a stick (inter vlan routing)

Inter Vlan Routing Configuration  :

I have showed here how to configure Inter vlan router on a stick with all command for switch and router .
Switch ()
1. Vlans , name
2. Ip address on interface management vlan
3.default gateway setup
4.trunk
5. native vlan
6.switchports + vlans
Router ()
1. Sub interfaces
2. encapsulation dot1q
3.native vlan

For Switch CL1 command line ():

Switch>en
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.

Vlan Assign on Switch : 

Switch(config)#vlan 10
Switch(config-vlan)#name students
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name faculty
Switch(config-vlan)#exit
Switch(config)#vlan 30
Switch(config-vlan)#name administration
Switch(config-vlan)#exit
Switch(config)#vlan 55
Switch(config-vlan)#name native
Switch(config-vlan)#exit
Switch(config)#vlan 77
Switch(config-vlan)#name mgt
Switch(config-vlan)#exit
Switch(config)#

Switch(config)#do show vlan

VLAN Name Status Ports
—- ——————————– ——— ——————————-
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
10 students active
20 faculty active
30 administration active
55 native active
77 mgt active
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
—- —– ———- —– —— —— ——– —- ——– —— ——
1 enet 100001 1500 – – – – – 0 0
–More–
Management Vlan setup and IP  address assign for remote access : 

Switch(config)#int fa0/5
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 77
Switch(config-if)#int vlan 77
Switch(config-if)#ip address 192.168.77.2 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exit

Switch# show run

interface Vlan77
ip address 192.168.77.2 255.255.255.0

Default gateway Setup:

Switch(config)#ip default-gateway 192.168.77.1

Trunk mode command on interface fa0/0: 
Switch(config)#int fa0/1
Switch(config-if)#switchport mode trunk

Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

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

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan77, changed state to up

Switch(config-if)#switchport trunk allowed vlan 1-1005
Switch(config-if)#switchport trunk native vlan 55

Access mode command : 

Switch(config)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#int fa0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#int fa0/4
Switch(config-if)#switchport access vlan 30
Switch(config-if)#
Switch(config-if)#int fa0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan 1,10,20,30,55,77
Switch(config-if)#switchport trunk native vlan 55

For Router command line CL1(): 
Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#no shutdown

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

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

Router(config-if)#

Sub Interfaces IP address Configure Command: 

Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0.10
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.10, changed state to up

Router(config-subif)#encapsulation ?
dot1Q IEEE 802.1Q Virtual LAN
Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#ip address 192.168.10.1 255.255.255.0
Router(config-subif)#

Router(config-subif)#int fa0/0.20
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.20, changed state to up

Router(config-subif)#encapsulation dot1q 20
Router(config-subif)#ip address 192.168.20.1 255.255.255.0
Router(config-subif)#

Router(config)#int fa0/0.30
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.30, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.30, changed state to up

Router(config-subif)#encapsulation dot1q 30
Router(config-subif)#ip address 192.168.30.1 255.255.255.0
Router(config-subif)#exit
Router(config)#int fa0/0.55
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.55, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.55, changed state to up

Router(config-subif)#encapsulation dot1q 55 native
Router(config-subif)#ip address 192.168.55.1 255.255.255.0
Router(config-subif)#

Router(config-subif)#int fa0/0.77
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.77, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.77, changed state to up

Router(config-subif)#encapsulation dot1q 77
Router(config-subif)#ip address 192.168.77.1 255.255.255.0
Router(config-subif)#

Router#show run
Building configuration…

interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
!
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
!
interface FastEthernet0/0.30
encapsulation dot1Q 30
ip address 192.168.30.1 255.255.255.0
!
interface FastEthernet0/0.55
encapsulation dot1Q 55 native
ip address 192.168.55.1 255.255.255.0
!
interface FastEthernet0/0.77
encapsulation dot1Q 77
ip address 192.168.77.1 255.255.255.0
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Vlan1
–More–

Router#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 192.168.10.0/24 is directly connected, FastEthernet0/0.10
C 192.168.20.0/24 is directly connected, FastEthernet0/0.20
C 192.168.30.0/24 is directly connected, FastEthernet0/0.30
C 192.168.55.0/24 is directly connected, FastEthernet0/0.55
C 192.168.77.0/24 is directly connected, FastEthernet0/0.77
Router#

Now go to  PC  command prompt and ping IP address, check connection.

PC> ping 192.168.77.2

 Important to know about configuring a Cisco IOS switch

#1: What’s the default VLAN?

The default VLAN on all switches is VLAN 1. By default, all ports on the switch are VLAN 1. With all ports in VLAN 1, all ports can communicate. As soon as you change the VLAN assignment for a switch port to another VLAN, that switch port won’t be able to communicate with the rest of the devices on other ports.

#2: Why do I need to configure interface “vlan 1”?

If you want to be able to manage your switch remotely over the network, your switch needs an IP address. If your switch has multiple VLANs configured, and you want to be able to manage the switch from each VLAN, the switch requires an IP address on a VLAN interface in each VLAN

#3: Why does my switch need a default gateway?

Actually, your switch doesn’t have to have a default gateway configured. However, if you want to be able to communicate with your switch from another subnet, you need to configure a default gateway on the switch so it knows how to get to its local LAN switch.

#4: How do I get switch ports up fast?

Cisco switches can do a lot of things besides just connect regular PCs to the network. That’s why you should use the switch ports optimally — they need a little extra configuration.

To bring up a switch port for use and tell the switch that there will always be “access devices” (such as PCs) on that switch port.

#5 How important are speed and duplex on switch ports?

Speed and duplex are very important on switch ports. That’s not to say that speed and duplex aren’t important on switch Ethernet ports (which they are).

However, switches are all about connecting a device to the LAN, and there are many devices that need connecting, so you’re much more likely to run into speed and duplex issues on switch ports. There are always old and slow devices somewhere on the network that aren’t quite compatible with your switch, and they don’t quite negotiate the speed and duplex correctly.

Thank you

Momataj momo