07-31-2016 03:15 PM - edited 03-08-2019 06:49 AM
Hi,
I am trying to set up a small lab, where I have 2 PCs, 1 switch and 1 Router.
The 2 PCs are 192.168.10.1/24 (Vlan 10), D.G. 192.168.10.254/24 and, PC2: 192.168.20.1/24 (Vlan 20), D.G. 192.168.10.254/24.
Router has a subinterface fa0/0.20 for vlan 20, which PC2 is able to ping. However, ping from PC1 to it's D.G. 192.168.10.254 fails, which is an IP address on a physical interface fa0/0.
Trunking is enabled between between the switch and the router. Can somebody please advise what's wrong with the config?
Please see the the Router and Switch config below. Thank you.
*****************************************************************************************************************************
Router config:
Router#sh run
Building configuration...
Current configuration : 666 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
no ip cef
no ipv6 cef
spanning-tree mode pvst
!
interface FastEthernet0/0
ip address 192.168.10.254 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
!
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
******************************************************************************************************
Switch config:
Switch#sh run
Building configuration...
Current configuration : 1102 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/2
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/3
switchport mode trunk
!
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 Vlan1
no ip address
shutdown
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
end
*****************************************************
Switch# sh vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active 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
Fa0/24
10 MGMT active Fa0/1
20 HR active Fa0/2
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
07-31-2016 03:28 PM
Hi;
Please create sub-interface for vlan 10 also on router and remove the configuration on F0/0:
interface FastEthernet0/0
no ip address
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
Thanks & Best regards;
07-31-2016 03:57 PM
Thank you sir! But shouldn't the ping between physical interface and subinterface work as well?
07-31-2016 10:40 PM
Hi Amit,
From pc in vlan 10 can ping the 192.168.10.254 and PC in vlan 20 can ping 192.168.20.254?
In your scenario we can not assigned ip add on the physical interface. IP will be assigned on sub-interface f0/0.10 & f0/0.20
Thanks & Best regards
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide