cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
459
Views
0
Helpful
3
Replies

2 VLANS connected to router via single connection

sajidkp009
Level 1
Level 1

Hello !!

I have tried to connect vlans to a router using trunk, but I cannot ping between the vlans. Please help with it. I have given the topology and configuraions used below:

 ROUTER

|

|

-------- Switch---------

|                               |

   PC1                           PC2

Ports connecting to PC1 and PC2 are VLAN10 and VLAN20 respectively. Connections are:

PC1 ---- fa1/1  Switch          PC2 ------------fa1/2 Switch          Switch fa1/0---- fa1/0 Router

PC1 

IP: 10.1.1.1 255.255.255.0  Gateway: 10.1.1.100

PC2

IP: 10.1.1.2 255.255.255.0  Gateway: 10.1.1.100

Configurations in Switch:

interface FastEthernet1/1

switchport mode access

switchport access vlan 10

interface FastEthernet1/2

switchport mode access

switchport access vlan 20

interface FastEthernet1/0

switchport trunk encapsulation dot1q
switchport mode trunk
switchport trunk allowed vlan all

Configuration in router

interface FastEthernet1/0

ip address 10.1.1.100 255.255.255.0 

Please provide your suggestions. Thank You

2 Accepted Solutions

Accepted Solutions

Joseph W. Doherty
Hall of Fame
Hall of Fame

You've split your 10.1.1.0/24 across two VLANs - that's not going to work.  Either place all ports of 10.1.1.0/24 in one VLAN or create a second network, e.g. 10.1.2.0/24, which you place into the second VLAN.  If you do the latter, you'll need to trunk between the switch and the router and use subinterfaces on the router's interface to the switch.

View solution in original post

ya for sub-interfaces you  need router or layer 3 switch for routing between 2 diffrent vlans. and your ip is the gateway ip in sub-interfaces

View solution in original post

3 Replies 3

Joseph W. Doherty
Hall of Fame
Hall of Fame

You've split your 10.1.1.0/24 across two VLANs - that's not going to work.  Either place all ports of 10.1.1.0/24 in one VLAN or create a second network, e.g. 10.1.2.0/24, which you place into the second VLAN.  If you do the latter, you'll need to trunk between the switch and the router and use subinterfaces on the router's interface to the switch.

Thank you Joseph ! One more small doubt, if I trunk and use subinterfaces, the IPs I use there willl be the gateway IPs right ?

ya for sub-interfaces you  need router or layer 3 switch for routing between 2 diffrent vlans. and your ip is the gateway ip in sub-interfaces

Review Cisco Networking for a $25 gift card