cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4758
Views
14
Helpful
10
Replies

ping from PC to router failure

Hi All

      Why i can ping 10.40.4.34 from pc if the gateway of PC is 10.10.10.24

       and cant ping 10.40.4.34 if the gateway of PC is 10.10.10.10

router 1

ip route 0.0.0.0 0.0.0.0 172.16.250.1

router 2

ip route 10.111.233.0 255.255.255.0 172.16.250.2

10.40.4.34----{Router1}------172.16.250.1/30--------------172.16.250.2/30---------{Router2}-----10.10.10.24-----------------{Switch}(ip default-gateway:10.10.10.24)---------{PC}(ip 10.10.10.2/24 d.g:10.10.10.10)

Kindly find attached the topolgy and details in sample way

10 Replies 10

here is the packet tracer file for this problem

Hi,

this is because your switch is a layer 2 switch and the default gateway must be a L3 device

Regards

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

thanks for your help n time ,

ok if i make the switch work as a layer 3 by ip routing command does this solve the problem?

and in this case it doesnot work however i use ip default-gateway !!? more clarification plz

The 2960 should support limited routing if you have 12.2(58)SE or later. You also need the LANBASE image and you need to enable the lanbase-routing SDM template with the "sdm prefer ...." command. I don't know whether packet tracer supports all this but if it does yes you could turn the 2960 into a L3 switch.

The issue you have at the moment is the 2960 is only L2 as Alain mentioned. The IP address and default-gateway on the switch are only used so you can login to the switch to manage it. That IP cannot be used for end devices such as PCs as their default-gateway. For that you need a L3 switch (or router).

So if you want to change it to L3 there is a fair bit of reconfig to. Firstly you would need a new network between the switch and router because the 10.111.233.0/24 will be used for the PC so it cannot also be used to connect to the router if the switch is acting as L3 switch ie. you cannot route from one subnet to the same subnet, you can only L2 switch. So the full config changes would be -

Note - i'm assuming you are using vlan 1 as the vlan with the IP address 10.113.233.10 and the PC is in vlan 1. If not it doesn't matter it should still work.

new network used to connect switch to router -  10.111.234.0/30

new vlan used for switch to router connection - vlan 2

Router1

======

router(config)# int gi0/0  <-- this connects to the 2960

router(config-if)# ip address 10.111.234.1 255.255.255.252  <--- this should update the IP from it's original 10.111.233.24/24

router(config)# ip route 10.111.233.0 255.255.255.0 10.111.234.2  <-- this is needed because 10.111.233.0/24 is no longer directly connected to Router1 so it needs to know where to send the return packets. 10.111.234.2 is assigned to an SVI on the 2960 - see below.

2960 switch

=========

If you had to change the SDM template to "lanbase-routing" as mentioned above then you need to reload the switch before it takes effect ie.

switch(config)# sdm prefer lanbase-routing

switch(config)# exit

switch# reload  <-- if you haven't already, save your config before reloading the switch

switch(config)# ip routing <--- this enables routing on the switch

switch(config)# no ip default-gateway 10.113.233.24 <-- no need for this when a switch is a L3 switch

switch(config)# ip route 0.0.0.0 0.0.0.0 10.113.234.1  <-- add a route to send all traffic to Router1

switch(config)# vlan 2

switch(config-vlan)# name

switch(config)# int gi0/1 <--- this connects to Router1

switch(config-if)# switchport mode access

switch(config-if)# switchport access vlan 2

the above lines create vlan in the vlan database and then assign the port connected to the router into vlan 2

switch(config)# int vlan 2

switch(config-if)# ip address 10.113.234.2 255.255.255.0

switch(config-if)# no shut

That should do it. The PC has it's default-gateway set to 10.111.233.10 which is the IP address of vlan 1 (or whatever you have used) on the switch.

Jon

Hi John,

Unfortunately this is not possible in Packet Tracer, the 2960 will stay as L2.

Regards

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

yes alain i agreed with what u said

Hi Alain

All that typing for nothing

Jon

not for nothing ,much appreciated

Much appreciated

@Jon

     Thanks alot for ur time n ur added here

     i agree with u and i disabled the ip default-gateway  and activate the l3 feature on the switch and put efault static route and every think is fine now

     but till now i can't figure why it didn't work if the switch is layer 2

     the pc gateway is in the same subnet of PC and Router  interface IP ?? not logic

Hi,

You could make the 2960 a L3 in packet-tracer ?  I tried it and couldn't do it

but till now i can't figure why it didn't work if the switch is layer 2

     the pc gateway is in the same subnet of PC and Router  interface IP ?? not logic

Yes they are in the same subnet but the default-gateway must be a L3 device and in this case the connection from switch to router must be in a separate vlan(subnet) or must be a routed port with a separate subnet.

Regards

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.
Review Cisco Networking products for a $25 gift card