2

enter image description here

ROUTER CONFIG

Router#sh run
Building configuration...

Current configuration : 769 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
 description connecting to switch0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.10
 encapsulation dot1Q 10
 ip address 192.168.10.2 255.255.255.224
!
interface FastEthernet0/0.20
 encapsulation dot1Q 20
 ip address 192.168.10.34 255.255.255.224
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

Switch0 config

Switch#sh run
Building configuration...

Current configuration : 1293 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
 description connecting to router
 switchport mode trunk
!
interface FastEthernet0/2
 description connecting to switch1
 switchport mode trunk
!
interface FastEthernet0/3
 description connecting to a pc which is in vlan10
 switchport access vlan 10
 switchport mode access
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
!
end

switch1 config

Switch#sh run
Building configuration...

Current configuration : 1237 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
 description connecting to a pc which is in vlan 20
 switchport access vlan 20
 switchport mode access
!
interface FastEthernet0/2
 description connecting to switch0
 switchport mode trunk
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
!
end

ROUTER cdp neighbours

Router#sh cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID    Local Intrfce   Holdtme    Capability   Platform    Port ID
Router#

switch0 cdp neighbours

 Switch#sh cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID    Local Intrfce   Holdtme    Capability   Platform    Port ID
Switch       Fas 0/2          141            S       2960        Fas 0/2
Router       Fas 0/1          138            R       C2800       Fas 0/0
Router       Fas 0/1          138            R       C2800       Fas 0/0.10
Router       Fas 0/1          138            R       C2800       Fas 0/0.20

switch1 neighbours

Switch#sh cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID    Local Intrfce   Holdtme    Capability   Platform    Port ID
Switch       Fas 0/2          175            S       2960        Fas 0/2
Switch#

the router doesnt show any neighbours

11
  • You are missing the configuration of one switch. Please edit the question to include that, and use the Preformatted-text feature ({}). – Ron Maupin Feb 3 '19 at 18:11
  • You should also take advantage of the description command on each interface to explain to what other device and interface the link connects., and the output of the show cdp neighbor command is useful. – Ron Maupin Feb 3 '19 at 18:14
  • @RonMaupin added the other switch config and cdp neighbours of router and switches. For the description, routers 0/0.x sub interface's x indicates the vlan it is referring to. Switch's 0/1 are trunked to each other switches and left switch's 0/2 is trunked to the router. Thanks for your time. – Anon Feb 3 '19 at 18:58
  • Why does the right switch say it is connected to the router in CDP? Also, the router does not show any neighbors? You should also name the switches differently so that we can tell the difference. What I meant by the description is the description command. For instance, the first switch could have under its interface FastEthernet0/2 something like description *** to Switch2 F0/2 ***. This is a habit you should get into, then you can use CDP and the description to make sure things are correctly connected. – Ron Maupin Feb 3 '19 at 19:03
  • @RonMaupin completely edited the original post to make it easy for you. Please help – Anon Feb 3 '19 at 19:46
2

I think your problem may be that you are not creating the VLANs on the switches.

The easiest way to do that is as a global command on each switch:

VLan 10
 name <vlan name, no spaces, use underscores>
!
VLan 20
 name <vlan name, no spaces, use underscores>
!
2

For inter -Vlan routing router configuration seems to be correct . Create Vlan 10 & Vlan 20 on both switch and check for status .

Please make sure ip address ,subnet ,gateway are correctly configuration on both PCs connected to both switch on vlan 10 and Vlan 20 .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.