Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you set up VLAN on Router 5

Status
Not open for further replies.

krock22

Technical User
Feb 6, 2010
48
US
Hello

I was wondering if I could configure VLAN on a cisco 1841 router. I tried the same comands that are being used for a switch but it comes up as a bad command.

Bellow I have Vlan1 that is not assigned to any interface and I would like to assign that to the Fa0/0 interface if posible


Router#show ip interface brief
Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 10.215.107.179 YES manual administratively down down

FastEthernet0/1 192.168.2.20 YES manual up up

Vlan1 unassigned YES manual administratively down down

is this dueable?

Thanks
 
The way you do VLANs on those is to put no IP address on your interface and then create subinterfaces which each have their own IP address and VLAN number.
 
You can do it like this.....

interface GigabitEthernet0/0
no ip address
!
interface GigabitEthernet0/0.2
encapsulation dot1Q 2
ip address 192.168.2.1 255.255.255.0
!
interface GigabitEthernet0/0.200
encapsulation dot1Q 200
ip address 192.168.200.1 255.255.255.0

This will create vlan 2 & 200 and tag the packets using dot1Q encapsulation.
 
SO basicly what I need to do is remove my ip address from fa0/0 and create a sub-interface fa0/0.10 and using encapsulation dot1Q 2 and assidn the ip and mask, and that will create VLAN2 and gets assigned to the sub-interface.

So I dont use

Router> en
Router# conf t
Router(config)#vlan2
Router(config)#int fa0/0
Router(config-int)#switchpoer access vlan 2

?
 
Correct , the vlan stuff is there if you happen to install one of the hwic switchcards in which case that is how you would configure those , with layer 3 SVI's etc...
 
krock22.....you're almost there. Make sure your subinterface number is the same as the number after the Dot1Q statement. Like.....

interface GigabitEthernet0/0.2
encapsulation dot1Q 2

That will be your vlan number. In the example above it will be vlan 2.

The subinterface in your previous post was .10 and the encapsulation dot1q was 2 so this wouldn't work. The numbers need to match.

If you then need to make vlan 2 the native vlan you would use:

interface GigabitEthernet0/0.2
encapsulation dot1Q 2 native

Cheers!
 
ABOzIT good catch thank you!!!

Thanks for your help
 
Krock, no that does not matter.

ABOzIT that is an absolute fallacy, the sub-interface id is locally significant and is not involved at all in vlan routing. The only required parameter is the vlan id in the encapsulation command.


So for instance.
This will work

interface FastEthernet0/0.19
encapsulation dot1Q 15
ip address 172.16.21.1 255.255.255.0


It only takes one misinformed person top make a bunch.

CCNP
 
Ok So now the sub-interface number has nothing to do with the vlan that is being set.
 
Correct, the only reason why people do that is just for ease of administration.

CCNP
 
Yes, i agree. But i don't want him (or anyone else) being misinformed.

CCNP
 
Vince---it looks to me the same way ISPKing sees it...

"The subinterface in your previous post was .10 and the encapsulation dot1q was 2 so this wouldn't work. The numbers need to match.

If you then need to make vlan 2 the native vlan you would use:

interface GigabitEthernet0/0.2
encapsulation dot1Q 2 native"

This WOULD work, and the numbers do NOT need to match.

Yet, it IS indeed a good idea...

Bam...where's my star?lol

/

tim@tim-laptop ~ $ sudo apt-get install windows
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package windows...Thank Goodness!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top