cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1445
Views
0
Helpful
5
Replies

Ip default Gateway / Default route

samir khoury
Level 1
Level 1

Hello,

I had a strange configuration that puzzled me.

we have a new WS-C2960XR-24PS-I with c2960x-universalk9-mz.150-2a.EX5.bin. runing as a layer 3 switch

I configured IP router on the device but the device would not be pingable

then I configured ip default gateway and the device is pingable.

now I have both config in the switch.

on another site I had only the IP route configured and the device is working fine.

what confusing me this a layer 3 switch why didn't the IP router work. and shoudl I be removing  the IP route statment from the config. Mind you this is device is now online and I can't test with it.

ip default-gateway XX.XX.105.194
!
ip route 0.0.0.0 0.0.0.0 XX.XX.105.194

!

interface VlanXX

ip address XX.XX.105.193 255.255.255.192

!

interface GigabitEthernet1/0/24
 description connection to WAN Connection
 switchport access vlan 11
 switchport mode access

thanks

5 Replies 5

Peter Paluch
Cisco Employee
Cisco Employee

Samir,

Is it possible that the switch did not have IP routing activated? The ip default-gateway command is only effective if the IP routing is disabled on a device. If the IP routing is activated using the ip routing global configuration command then the ip default-gateway should be ignored entirely, and instead, the ip route commands should become effective.

What is the current state of this switch with respect to the activation of IP routing?

Best regards,
Peter

the device has IP routing enabled, sorry I forgot to mention that. and you are right with IP routing enabled IP default gateway is not effective.

I also failed to mention the below config on the WAN / VLAN interface. not sure if it has any effect

interface Vlan11

no ip redirects
no ip unreachables

Samir,

I am somewhat confused by the current state of things - I am not entirely clear on what exactly does not work and under what circumstances.

Can you perhaps post the sanitized configuration of the switch, along with your example of what is the address of the host you are using to ping the switch, and what IP address of the switch are you trying to ping?

Best regards,
peter

See below, I tried to only copy what I think is relevant. of course I changed the real IPs with (10.). hopefuly this help.

BOOT path-list      : flash:/c2960x-universalk9-mz.150-2a.EX5/c2960x-universalk9-mz.150-2a.EX5.bin

switch 1 provision ws-c2960xr-24ps-i

ip routing
!
ip domain-name XXXX
ip name-server 10.10.26.21
ip name-server 10.10.28.21
vtp mode transparent
!
vlan 11,505-506
!
ip ssh time-out 5
ip ssh version 2
!
interface range GigabitEthernet1/0/1 - 24
 switchport access vlan 505
 switchport mode access
 no logging event link-status
 speed 100
 duplex full
 spanning-tree portfast

interface GigabitEthernet1/0/24
 description connection to WAN
 switchport access vlan 11
 switchport mode access
 no logging event link-status
 speed 100
 duplex full

interface Vlan11
 description Uplink to WAN
 ip address 10.92.105.193 255.255.255.192
 no ip redirects
 no ip unreachables
!
interface Vlan505
 description User Access VLAN
 ip address 10.92.105.1 255.255.255.128
 ip helper-address 10.10.26.21
 ip helper-address 10.10.28.21
!
interface Vlan506
 description Wirless VLAN
 ip address 10.92.105.129 255.255.255.192
 ip helper-address 10.10.26.21
 ip helper-address 10.10.28.21
!
ip default-gateway 10.92.105.194
no ip http server
no ip http secure-server
!
ip route 0.0.0.0 0.0.0.0 10.92.105.194
ip tacacs source-interface Vlan505

I did have IP routing and IP route statement, which I thought that all that is needed, but for whatever reason the router was not pingable or able to connect to the internet. once I add IP default gateway it worked. which what I understand it shouldn't.

Gateway of last resort is 10.92.105.194 to network 0.0.0.0

S*    0.0.0.0/0 [1/0] via 10.92.105.194
      10.0.0.0/8 is variably subnetted, 6 subnets, 3 masks
C        10.92.105.0/25 is directly connected, Vlan505
L        10.92.105.1/32 is directly connected, Vlan505
C        10.92.105.128/26 is directly connected, Vlan506
L        10.92.105.129/32 is directly connected, Vlan506
C        10.92.105.192/26 is directly connected, Vlan11
L        10.92.105.193/32 is directly connected, Vlan11