cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
35574
Views
0
Helpful
8
Replies

Configuring 2 switches and a router

Hi,

I am working on packet tracer. I have a topology below topology.

I have connected 2901 router to 2 switches (2960). 

Vlan 10 is configured in switch 1 and Vlan 20 is configured in switch 2.

Ip address of host in switch 1 is 192.168.1.10 and ip address of host in switch 2 is 192.168.2.10.

I need to communicate between the 2 hosts. But Its not communicating. Please check my configurations below and help me to solve the issue.

I have done the below configurations

Router:

#inter giga0/0

#Ip address 192.168.1.1 255.255.255.0

#exit

#inter giga0/1

#ip address 192.168.2.1 255.255.255.0

#exit

In Switch 1:

#inter fa0/1

#switchport mode Trunk

#exit

#inter fa0/2

#switchport mode access

#switchport access vlan 10

#exit

In Switch 2:

#inter fa0/1

#switchport mode trunk

#exit

#inter fa0/2

#switchport mode access

#switchport access vlan 20

#exit

1 Accepted Solution

Accepted Solutions

bbb bbb
Level 1
Level 1

change your configuration on your switch interface facing the router

In Switch 1:

#inter fa0/1

#no switchport mode Trunk

#switchport mode access

#switchport access vlan 10

#exit

In Switch 2:

#inter fa0/1

#no switchport mode Trunk

#switchport mode access

#switchport access vlan 20

#exit

try to test ping from host to gateway (router).. or gateway (router) to host), if it works then

try to test ping from host to host

if not check the ip configured at each hosts or check the ip configured at the router (subnet mask, default gateway, interface not administratively shutdown)

regards,

View solution in original post

8 Replies 8

Mark Malone
VIP Alumni
VIP Alumni

Hi

can you ping between your ip interfaces ? -------------ping  192.168.2.1 source 192.168.1.1

if your going to do a trunk instead of an access as its only 1 vlan you may need to tell the router the vlan encapsulation on router side like router and stick setup , you have switch side as trunk but router as routed interface , how does it know the vlan ?

Try this same on both sides obviously with the vlan and ip changed for far side

inter giga0/1
no ip address
interface g0/1.1
encapsulation dot1q 1 10
ip address 192.168.2.1 255.255.255.0

Hi Mark,

But there are 2 vlans. Vlan 10 and Vlan 20

if you want only changes on router then try belows config for your router

inter giga0/0
no ip address
interface g0/0.1
encapsulation dot1q 10
ip address 192.168.1.1 255.255.255.0

no shutdwon

inter giga0/1
no ip address
interface g0/1.2
encapsulation dot1q 20
ip address 192.168.2.1 255.255.255.0

no shutdown

that should do it.

regards

Thanks mark.

Iulian Vaideanu
Level 4
Level 4

I assume the trunk (fa0/1) switch interfaces are connected to the router - if that's the case, you've got an "access vs. trunk" mismatch between the switches and the router: either change fa0/1s to access mode, or define sub-interfaces gi0/0.10 and gi0/1.20 on the router and move its .1 IPs there.

Thansk Lulian 

bbb bbb
Level 1
Level 1

change your configuration on your switch interface facing the router

In Switch 1:

#inter fa0/1

#no switchport mode Trunk

#switchport mode access

#switchport access vlan 10

#exit

In Switch 2:

#inter fa0/1

#no switchport mode Trunk

#switchport mode access

#switchport access vlan 20

#exit

try to test ping from host to gateway (router).. or gateway (router) to host), if it works then

try to test ping from host to host

if not check the ip configured at each hosts or check the ip configured at the router (subnet mask, default gateway, interface not administratively shutdown)

regards,

I tried the above config. Its working now. I am able to ping between host and gateway and also between the 2 hosts. Thanks.

I actually set fa0/1 as access before changing to truck.But i forgot to give vlan access. Tats d issue. 

Thanks.

Review Cisco Networking for a $25 gift card