cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1987
Views
3
Helpful
11
Replies

Router on the stick

diallodjeri
Level 1
Level 1

Hi folks,

I have configured vlan 2 and vlan 3 on my switch and  trunk them to my router and I do have connectivity between those two  vlans..When configured  the router sub-interface f0/0.1,f0/0.2 and f0/0.3 I have used the  fallowing ip address 10.37.37.1, 10.37.36.1and10.37.35.1  respectively for vlan 1,2 and 3. Host 1 on vlan1 ip address is 10.37.37.5 with default-gateway 10.37.37.1 and host 2 ip address 10.37.36.10 with default-gateway 10.37.36.1. I don't have connectivity between  vlan 1 and any of the vlan I can't even ping the default-gateway that I  have set for vlan 1 on router sub-interface from a host connect to vlan. In the router configuration under sub-int I did hard  coded vlan 1 as native but it still don't work .What I'm missing here ?

11 Replies 11

Somasundaram Jayaraman
Cisco Employee
Cisco Employee

Hi

The configurations should be

Router example, for fa0/0.1

interface FastEthernet0/0.1
encapsulation dot1q 1
ip address 10.37.37.1 255.255.255.0

interface FastEthernet0/0.2
encapsulation dot1q 2
ip address 10.37.36.1 255.255.255.0

interface FastEthernet0/0.3
encapsulation dot1q 3
ip address 10.37.35.1 255.255.255.0

Let us consider the port connected to the router from switch is fa 0/1:

The configuration would be
switch(config)#int FastEthernet 0/1
switch(config-if)#switchport trunk encapsulation dot1q
switch(config-if)#switchport mode trunk

Hope this helps

Cheers
Somu

Rate helpful posts

Also can you check this command on switch.

show interface switchport and see whether the vlans are mapped right??

Here interface no is the interface where the host is connected to the switch.

Cheers

somu

This is exactely I have configured and that is why I do have connectivity between vlan 2 and 3.

You can see these output from the router and switch:

R1#sh vlan

Virtual LAN ID:  1 (IEEE 802.1Q Encapsulation)

   vLAN Trunk Interface:   Ethernet0/0.1

This is configured as native Vlan for the following interface(s) :

Ethernet0/0

   Protocols Configured:   Address:              Received:        Transmitted:

           IP              10.37.37.1                   0                   0

Virtual LAN ID:  2 (IEEE 802.1Q Encapsulation)

   vLAN Trunk Interface:   Ethernet0/0.2

   Protocols Configured:   Address:              Received:        Transmitted:

           IP              10.37.36.1                 531                  12

Virtual LAN ID:  3 (IEEE 802.1Q Encapsulation)

   vLAN Trunk Interface:   Ethernet0/0.3

   Protocols Configured:   Address:              Received:        Transmitted:

           IP              10.37.35.1                   0                   0

R1#

--------------------------

R1#sh vlan

Virtual LAN ID:  1 (IEEE 802.1Q Encapsulation)

   vLAN Trunk Interface:   Ethernet0/0.1

This is configured as native Vlan for the following interface(s) :

Ethernet0/0

   Protocols Configured:   Address:              Received:        Transmitted:

           IP              10.37.37.1                   0                   0

Virtual LAN ID:  2 (IEEE 802.1Q Encapsulation)

   vLAN Trunk Interface:   Ethernet0/0.2

   Protocols Configured:   Address:              Received:        Transmitted:

           IP              10.37.36.1                 531                  12

Virtual LAN ID:  3 (IEEE 802.1Q Encapsulation)

   vLAN Trunk Interface:   Ethernet0/0.3

   Protocols Configured:   Address:              Received:        Transmitted:

           IP              10.37.35.1                   0                   0

R1#

SW2#sh vlan

VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

1    default                          active    Fa0/1, 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

2    Sale                             active    Fa0/2

3    Managment                        active    Fa0/3

4    Marketing                        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

2    enet  100002     1500  -      -      -        -    -        0      0

3    enet  100003     1500  -      -      -        -    -        0      0

4    enet  100004     1500  -      -      -        -    -        0      0

1002 fddi  101002     1500  -      -      -        -    -        0      0

1003 tr    101003     1500  -      -      -        -    srb      0      0

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

1004 fdnet 101004     1500  -      -      -        ieee -        0      0

1005 trnet 101005     1500  -      -      -        ibm  -        0      0

Remote SPAN VLANs

------------------------------------------------------------------------------

Primary Secondary Type              Ports

------- --------- ----------------- ------------------------------------------

SW2#sh int trunk

Port        Mode         Encapsulation  Status        Native vlan

Fa0/24      on           802.1q         trunking      1

Port      Vlans allowed on trunk

Fa0/24      1-4094

Port        Vlans allowed and active in management domain

Fa0/24      1-4

Port        Vlans in spanning tree forwarding state and not pruned

Fa0/24      1-4

SW2#

ajaju
Level 1
Level 1

Maybe you have not allowed vlan 1 on the trunk link between the two devices.

Look at the output of "show int trunk" on the switch and ensure that all 3 vlans are allowed to go over that link.

Also ensure that you have the same native vlan set on both devices.

For example, if you have vlan 1 as the native on the switch, ensure that you put in

encapsulation dot1q 1 native

under the fa0/0.1 interface of the router.

smogra
Cisco Employee
Cisco Employee

Hi,

Apart from what Somu and Aniruddha has given, you can refer to the below link as well for more understanding:

http://www.cisco.com/en/US/tech/tk389/tk815/technologies_configuration_example09186a00800949fd.shtml#conf

This is a really good document and will really explain you stuffs very clearly.

Hope that helps.

Sweta

Please rate helpful posts.

Thanks but I have red that document more than once.

Can you try

int fa0/1

ip address 10.37.37.1 255.255.255.0

int fa0/0.2

encapsulation dot1q 2

ip address 10.37.36.1 25.255.255.0

int fa0/0.3

encapsulation dot1q 3

ip address 10.37.35.1 255.255.255.0

Jon

In the router on the stick configuration the main interface of the router should not get any ip address instead the sub-interface are configured.

Please give me some credit

You can do it either way ie. -

you can specify subinterfaces for all vlans

or

you can configure the native vlan on the main interface and then just use subinterfaces for the other vlans.

If your router supports the "native" keyword then you have done it the recommended way. However as it does not seem to be working i though it may be worth trying it the other way just to see if it works.

Jon

You may be right but every documentation I have red they don't assign ip address to a main interface,the just put no shutdown.That is why I have said that

No problem, but if you ask for help then perhaps you ought to have a bit more trust in what people say. 

I suspect this not the issue but it was worth trying. However as you seem to know more about this than me i'll drop out of this thread

Jon

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card