Ping between hosts in different VLANs

SW
In the topology above. I need to ping from Host1 to Host2 but I cannot. Though I can ping from Host1 to subinterface ip address e0/0.10 on R1, I am also able to ping from Host2 to subinterface e0/0.20 on R1, but not between Host1 and Host2


Switch#sh run 
Building configuration...

Current configuration : 1800 bytes
!
! Last configuration change at 02:32:49 CET Fri Feb 9 2018
!
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname Switch
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone CET 1 0
no ipv6 cef
ipv6 multicast rpf use-bgp
no ip routing
!         
no ip cef
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
vlan internal allocation policy ascending
!
! 
!
!
!
!
!
!
!
!
interface Ethernet0/0
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 10,20
 switchport mode trunk
 duplex auto
!
interface Ethernet0/1
 duplex auto
!
interface Ethernet0/2
 switchport access vlan 10
 duplex auto
!
interface Ethernet0/3
 switchport access vlan 20
 duplex auto
!
interface Ethernet1/0
 duplex auto
!
interface Ethernet1/1
 duplex auto
!
interface Ethernet1/2
 duplex auto
!
interface Ethernet1/3
 duplex auto
!
interface Serial2/0
 no ip address
 no ip route-cache
 shutdown
 no fair-queue
 serial restart-delay 0
!
interface Serial2/1
 no ip address
 no ip route-cache
 shutdown
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 no ip route-cache
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 no ip route-cache
 shutdown
 serial restart-delay 0
!
interface Serial3/0
 no ip address
 no ip route-cache
 shutdown
 serial restart-delay 0
!
interface Serial3/1
 no ip address
 no ip route-cache
 shutdown
 serial restart-delay 0
!
interface Serial3/2
 no ip address
 no ip route-cache
 shutdown 
 serial restart-delay 0
!
interface Serial3/3
 no ip address
 no ip route-cache
 shutdown
 serial restart-delay 0
!
!
no ip http server
!
!
!
!
!
control-plane
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
!         
end

Switch#

Open in new window


Host1#sh run 
Building configuration...

Current configuration : 1675 bytes
!
! Last configuration change at 02:38:02 CET Fri Feb 9 2018
!
version 15.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Host1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone CET 1 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!         
!
!
!
!
!


!
!
!
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!         
!
redundancy
!
!
! 
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 192.168.10.1 255.255.255.0
!
interface Ethernet0/1
 no ip address
 shutdown 
!
interface Ethernet0/2
 no ip address
 shutdown
!
interface Ethernet0/3
 no ip address
 shutdown
!
interface Ethernet1/0
 no ip address
 shutdown
!
interface Ethernet1/1
 no ip address
 shutdown
!
interface Ethernet1/2
 no ip address
 shutdown
!
interface Ethernet1/3
 no ip address
 shutdown
!
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/3
 no ip address
 shutdown
 serial restart-delay 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
 login
 transport input none
!
!
end       

Host1#

Open in new window



Host2#sh run
Building configuration...

Current configuration : 1682 bytes
!
! Last configuration change at 02:39:46 CET Fri Feb 9 2018
!
version 15.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Host2
!
boot-start-marker
boot-end-marker
!
aqm-register-fnf
!
!
no aaa new-model
clock timezone CET 1 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!
!
!
!
!
!


!
!
!
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!         
!
!
redundancy
!
!
! 
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 192.168.20.1 255.255.255.0
!
interface Ethernet0/1
 no ip address
 shutdown
!
interface Ethernet0/2
 no ip address
 shutdown
!
interface Ethernet0/3
 no ip address
!
interface Ethernet1/0
 no ip address
 shutdown
!
interface Ethernet1/1
 no ip address
 shutdown
!
interface Ethernet1/2
 no ip address
 shutdown
!
interface Ethernet1/3
 no ip address
 shutdown
!
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/3
 no ip address
 shutdown
 serial restart-delay 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
 login
 transport input none
!
!
end       

Host2#
Host2#sh run
Building configuration...

Current configuration : 1682 bytes
!
! Last configuration change at 02:39:46 CET Fri Feb 9 2018
!
version 15.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Host2
!
boot-start-marker
boot-end-marker
!
aqm-register-fnf
!
!
no aaa new-model
clock timezone CET 1 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!
!
!
!
!
!


!
!
!
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!         
!
!
redundancy
!
!
! 
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 192.168.20.1 255.255.255.0
!
interface Ethernet0/1
 no ip address
 shutdown
!
interface Ethernet0/2
 no ip address
 shutdown
!
interface Ethernet0/3
 no ip address
!
interface Ethernet1/0
 no ip address
 shutdown
!
interface Ethernet1/1
 no ip address
 shutdown
!
interface Ethernet1/2
 no ip address
 shutdown
!
interface Ethernet1/3
 no ip address
 shutdown
!
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/3
 no ip address
 shutdown
 serial restart-delay 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
 login
 transport input none
!
!
end       

Host2#

Open in new window



R1#sh run
Building configuration...

Current configuration : 2202 bytes
!
! Last configuration change at 02:41:31 CET Fri Feb 9 2018
!
version 15.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
aqm-register-fnf
!
!
no aaa new-model
clock timezone CET 1 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!
!
!
!
!
!


!
!
!
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!         
!
!
redundancy
!
!
! 
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 172.16.0.2 255.255.255.0
!
interface Loopback1
 ip address 172.16.1.2 255.255.255.0
!
interface Loopback2
 ip address 172.16.2.2 255.255.255.0
!
interface Loopback3
 ip address 10.10.10.2 255.255.255.0
!
interface Ethernet0/0
 ip address 192.168.12.2 255.255.255.0
!
interface Ethernet0/0.10
 encapsulation dot1Q 10
 ip address 192.168.10.254 255.255.255.0
!
interface Ethernet0/0.20
 encapsulation dot1Q 20
 ip address 192.168.20.254 255.255.255.0
!
interface Ethernet0/1
 no ip address
 shutdown
!
interface Ethernet0/2
 no ip address
 shutdown
!
interface Ethernet0/3
 no ip address
 shutdown
!
interface Ethernet1/0
 no ip address
 shutdown
!
interface Ethernet1/1
 no ip address
 shutdown
!
interface Ethernet1/2
 no ip address
 shutdown
!
interface Ethernet1/3
 no ip address
 shutdown
!         
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/0
 no ip address
 shutdown 
 serial restart-delay 0
!
interface Serial3/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/3
 no ip address
 shutdown
 serial restart-delay 0
!
router ospf 1
 network 192.168.12.0 0.0.0.255 area 0
 default-information originate always
!
ip forward-protocol nd
!         
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
 login
 transport input none
!         
!
end

R1# 

Open in new window

jskfanAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Predrag JovicConnect With a Mentor Network EngineerCommented:
Additional routes are not needed since subinterfaces are directly connected routes.
Host need default gateway  to be configured so they "know" where to forward traffic in the case that destination address is not in the same subnet. On packet level - destination MAC address  of frame is host's default gateway IP address when destination IP address is not part of the same subnet as host that is forwarding traffic.

On both hosts issue:
no ip routing

if ip routing is disabled with no ip routing command then default-gateway should be configured:
Host1
ip default-gateway 192.168.10.254
Host2
ip default-gateway 192.168.20.254

If routing is not disabled on host then default route should be configured:
Host1
ip route 0.0.0.0 0.0.0.0 192.168.10.254
Host2
ip route 0.0.0.0 0.0.0.0 192.168.20.254
0
 
Fred MarshallConnect With a Mentor PrincipalCommented:
I'm not sure I can help in view of how the question is posed.  But, I'll try to hit the concepts:

Presumably, the VLANs are populated by devices on different subnets.  Usually that's the case. Is that right?

Being on different subnets, there has to be routing between the subnets for the pings to work - in both directions.  Has any effort been made to allow / implement this?

If the switch SW1 is working at Level 2 and simply supporting the VLANS and the upstream connection is trunked then the Router is doing the heavy lifting.  You need a route there between the two subnets.  For example:

Subnet 1: 192.168.10.0/24 on VLAN1
Subnet 2: 192.168.20.0/24 on VLAN 2

Route: From VLAN 1 destined for 192.168.20.0/24 send to VLAN 2 or 192.168.20.xxx
Route: From VLAN 2 destined for 192.168.10.0/24 send to VLAN 1 or 192.168.10.xxx
0
 
jskfanAuthor Commented:
I used this config below and It worked. Perfect!

no ip routing

if ip routing is disabled with no ip routing command then default-gateway should be configured:

Host1
ip default-gateway 192.168.10.254
Host2
ip default-gateway 192.168.20.254
0
 
jskfanAuthor Commented:
Excellent! Thank you
0
All Courses

From novice to tech pro — start learning today.