Routing between Vlans

on the topology below, Host1 and Host2 are in 2 different subnets, connected to L2 Switch which in turn connected to L3 Switch.
I would like to have Host1 and Host2 be able to communicate to each other.
How can this be accomplished ?

Thank you.
switch
jskfanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Don JohnstonInstructorCommented:
On the switch:
Create VLAN 10 and make e0 a member.
Create VLAN 20 and make e1 a member.
Make E2 a trunk.

Create sub-interfaces on router F0/0

Int f0/0.10
 Encap dot1q 10
 Ip address 192.168.10.10 255.255.255.0
 No shut

Int f0/0.20
 Encap dot1q 20
 Ip address 192.168.20.10 255.255.255.0
 No shut

On the two hosts, use a default gateway of 10.10 and 20.10 respectively.
1
Lee W, MVPTechnology and Business Process AdvisorCommented:
Wouldn't this depend on the switch used?
0
JustInCaseCommented:
Since L3 switch is mentioned as routing device (although in topology drawing  there is a router), typically subinterfaces would not be used on L3 switch. Interface between L2 and L3 switch would be configured as trunk and on L3 switch SVIs for each VLAN would be created (and used as default gateway for devices in each VLAN).
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

jskfanAuthor Commented:
OK ..in addition to the configuration above , I have added IP Routing command on SW3
Now I can ping from host1 to 192.168.10.254 and from Host2 to 192.168.20.254. I also can ping from SW3 to both Host1 and Host ip addresses.

However I cannot ping from Host1 to 192.168.20.254 , I also cannot ping from Host2 to 192.168.10.254
I thought IP routing will take care of that but it has not done it so far.
0
Don JohnstonInstructorCommented:
Where is SW3???  There was no mention of this device.

And where are 192.168.10.254 and 192.168.20.254?

Check that you have the default gateway set correctly on the two hosts.
0
jskfanAuthor Commented:
OOps , it  is R3

192.168.10.254 and 192.168.20.254 are the ip addresses of the sub-interfaces on R3. fa0/0.10 and fa0/0.20
from Host1 I can ping 192.168.10.254 and from Host2 I can ping 192.168.20.254
but from Host 1 I cannot ping 192.168.20.254
from Host2 I cannot ping 192.168.10.254
From R3 I can ping both Host1 and Host2 ip addresses
0
jskfanAuthor Commented:
Check that you have the default gateway set correctly on the two hosts.
I did , this is why I can ping successfully between each host to its own default gateway.
0
Don JohnstonInstructorCommented:
Yeah.  Make sure that you have the default gateway of the hosts set to the .254 address.  

Also, ip routing could be disabled on R3.  So issue the "ip routing" command on R3.
0
Don JohnstonInstructorCommented:
I did , this is why I can ping successfully between each host to its own default gateway.

No. The default gateway does NOT need to be correctly set to communicate with a device on your own network.
0
jskfanAuthor Commented:
in my LAB R3 is SW3

Host1#sh run
Building configuration...

Current configuration : 1439 bytes
!
version 15.0
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
!
ip cef
!
no ipv6 cef
!
!
!         
!
!
!
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
 no fair-queue
 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 default-gateway 192.168.10.254
!
ip forward-protocol nd
no ip http server
!
!
!
!
!
control-plane
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
 login    
 transport input all
!
end

Host1#  

Open in new window


Host2#sh run
Building configuration...

Current configuration : 1439 bytes
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Host2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone CET 1
!
ip cef
!
no ipv6 cef
!
!
!        
!
!
!
interface Ethernet0/0
 ip address 192.168.20.2 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
 no fair-queue
 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 default-gateway 192.168.20.254
!
ip forward-protocol nd
no ip http server
!
!
!
!
!
control-plane
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
 login    
 transport input all
!
end

Host2#
SW1#sh run 
Building configuration...

Current configuration : 1585 bytes
!
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname SW1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone CET 1 0
no ipv6 cef
ipv6 multicast rpf use-bgp
!
ip cef
!
!         
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
vlan internal allocation policy ascending
!
! 
!
!
!
!
!
!
!
!
interface Ethernet0/0
 switchport access vlan 10
 switchport mode access
 duplex auto
!
interface Ethernet0/1
 switchport access vlan 20
 switchport mode access
 duplex auto
!
interface Ethernet0/2
 switchport trunk encapsulation dot1q
 switchport mode trunk
 duplex auto
!
interface Ethernet0/3
 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
 shutdown
 no fair-queue
 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
!
!
no ip http server
!
!
!
!
!
control-plane
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
 login
!
end

SW1# 

Open in new window


SW3#sh run 
Building configuration...

Current configuration : 1640 bytes
!
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname SW3
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone CET 1 0
no ipv6 cef
ipv6 multicast rpf use-bgp
!
ip cef
!
!         
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
vlan internal allocation policy ascending
!
! 
!
!
!
!
!
!
!
!
interface Ethernet0/0
 no switchport
 no ip address
!         
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 switchport
 no ip address
!
interface Ethernet0/2
 duplex auto
!
interface Ethernet0/3
 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
 shutdown
 no fair-queue
 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
!
!
no ip http server
!
!
!
!
!
control-plane
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
 login
!
end

SW3#

Open in new window

0
jskfanAuthor Commented:
this is the diagram in the Lab:
dia
0
Don JohnstonInstructorCommented:
Things are screwy here.  On R3 (or SW3) there is some conflicting info.  It looks like a switch because of the spanning tree commands but it has serial ports.  So I'm not sure what this thing is.  Could you provide the output of a "show version"?

If this is a sim like GNS or packet tracer, then all bets are off.

You might try using a default route instead of a default-gateway on the hosts. "Ip route 0.0.0.0 0.0.0.0 192.168.x0.254"
0
jskfanAuthor Commented:
with this :
Ip route 0.0.0.0 0.0.0.0 192.168.x0.254
it worked just fine. not sure why it did not work with ip dafault-gateway
0
JustInCaseCommented:
On your hosts currently routing is not disabled.
There is no command "no ip routing" present in configurations of host 1 and host 2.
If  command is not issued configured default gateway is ignored, since device is working in L3 mode.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jskfanAuthor Commented:
Predrag Jovic

Wow.... You got it right
by:Predrag Jovic
0
JustInCaseCommented:
But, still, Don Johnston provided solution.
0
jskfanAuthor Commented:
I will try the suggestion on ID: 42465080

I will use Vlan interfaces instead of sub-interfaces.
0
jskfanAuthor Commented:
Thank you Guys
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Routers

From novice to tech pro — start learning today.