10-29-2014 07:39 AM - edited 03-05-2019 12:04 AM
Hi All
can any1 help me regarding configuring VLAN on router.
currently i am working on 2951 router of Cisco and i need to know how to configure a vlan on router and also change the native vlan.
As by default vlan 1 is native vlan on router.
Thanks
10-29-2014 07:49 AM
You will be configuring sub interfaces on the router or router-on-a-stick. There is plenty of information for this configuration with simple google search. This looks like:
interface GigabitEthernet0/0.10
encapsulation dot1q 10
ip address 10.10.10.10 255.255.255.0
interface GigabitEthernet0/0.20
encapsulation dot1q 20 native
ip address 20.20.20.20 255.255.255.0
10-29-2014 11:16 AM
Well Michael O'Nan,
Thanks for showing your concern.
Well i know abt this already but i guess you ppl didnt get my question actually i was asking about configuring VLAN on the router.
10-30-2014 07:39 AM
Wow...good luck in finding your answer.
10-29-2014 07:58 AM
Create Vlans
Method 1
Switch>enable
Switch#sh vlan brief
#vlan database
(vlan)#vlan 55 name Sales
(vlan)#vlan 80 name HR
(vlan)#Exit
%Check if apply completed or not%
-----------------
Method 2
Switch#conf t
(config)#vlan 425
(config-vlan)#name Accounts
exit
(config)#vlan 600
(config-vlan)#name Manager
exit
--------------------------
Assigning Members
Switch#conf t
(config)#int fa0/5
(config-if)#switchport access vlan 55
exit
(config)#int fa0/22
(config-if)#switchport access vlan 80
exit
Assigning Range of Members
(config)#interface range int fa0/10 - 15 , fa0/17, fa0/24
(config-range)#switchport access vlan 600
------------------------------
To verify
Switch#sh vlan brief
Before Deleting the VLANS make sure to remove Membership First
Deleting all VLANS
Switch#delete flash:vlan.dat
10-29-2014 11:20 AM
Surender Singh thanks alot.
Well you know i guess you didnt get my question actually i was asking about configuring VLAN on the router.
Like when check interfaces on the router its shows vlan1 as well
so i wanted to ask about how to configure vlan on 2951 router.
and how to assign interface to the vlan configured,
10-29-2014 04:58 PM
Perhaps you need to explain more clearly what your environment is and what you are trying to achieve. You seem to be focused on how to configure a vlan on a 2951 router. And the technically correct answer is that you can not configure a vlan on the 2951 router.
If the router has a switch module installed you can configure vlans on the switch module (but that is on the switch module and not on the router itself). If you do not have the switch module then you can configure a router interface to connect to a trunk port on a switch (which is what previous posts were explaining).
So if you explain more clearly what is your environment and what you need to accomplish then perhaps we can provide better responses.
HTH
Rick
10-30-2014 12:28 AM
Well Richard Burts thanks
Currently i have a vlan 99 configured on a switchA which is connect to my routerA and my routerA is connected to an other routerB my routerB is connected to switchB now i want to configure Vlan 99 on my routers to reach switchB.
10-30-2014 06:08 AM
OK you have clarified that router A is connected to switch A and router B is connected to switch B. Can you clarify for us how the routers are connected to each other?
Also can you clarify whether the routers have switch modules installed on the router? Perhaps the output of show version and of show inventory might help with this.
HTH
Rick
10-30-2014 10:50 AM
Well Richard
my two routers are interconnected via an other switch
Yes i do have switch module internally embedded to the router.
2 ports on router 2/0 and 2/1 are connected to switch module and 2 switch ports 0/25 and 0/26 are connected to router.
Only one port on router 2/1 is switchport you can configure it either trunk or access.
But the other port on router 2/0 cannt be configured neither trunk nor access.
10-30-2014 11:51 AM
It is helpful to know that you have switch modules on both of the routers. You should be able to configure vlan 99 on the switch modules of both routers and to configure appropriate ports of the switch module to be in vlan 99. If there is another switch that connects Router A to Router B then you also probably need to configure its ports to be in vlan 99 also.
HTH
Rick
10-30-2014 11:12 AM
R1(config)#interface vlan 10
R1(config-if)#
*Mar 1 00:03:23.371: %LINK-5-CHANGED: Interface Vlan10, changed state to administratively down
R1(config-if)#ip add
*Mar 1 00:03:26.223: %LINK-3-UPDOWN: Interface Vlan10, changed state to up
R1(config-if)#ip add 192.168.2.1 255.255.255.0
R1(config-if)#exit
R1#wr
04-29-2018 04:23 PM
When configuring an interface to operate on a specific VLAN, you can make it the native VLAN by using the keyword.
R1(config-subif)#int g0/0.99
R1(config-subif)#encapsulation dot1q 99 native
R1(config-subif)#ip address 172.31.99.1 255.255.255.0
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide