cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1348
Views
5
Helpful
2
Replies

Why does this work? ping other subnet with no default-gateway

jpferron31
Level 1
Level 1

Hi,

I have a lab on eve-ng with the following:2022-04-15 16_46_02-EVE _ Topology.png

 Both switches use vlan 1 by default with the ip address on the image. The switch on the right is indeed named R6. Now, I was wondering why I couldn't reach each others subnets, until I hit the no ip routing command. Now, everything pings but I don't understand why it does. Whether I put a default-gateway on each switches, or I don't, it works. I can ping from 192.168.2.2 to 192.168.1.1 and vice versa. Here are the configs of the switch:

 

Switch on the right (R6)

Building configuration...

Current configuration : 936 bytes
!
! Last configuration change at 15:42:15 EST Fri Apr 15 2022
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname R6
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone EST -5 0
!
!
!
!
!
no ip source-route
no ip routing
!
!
!
no ip cef
no ipv6 cef
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
!
interface Ethernet0/1
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Vlan1
ip address 192.168.2.2 255.255.255.0
no ip route-cache
!
no ip classless
ip forward-protocol nd
!
ip http server
!
ip ssh server algorithm encryption aes128-ctr aes192-ctr aes256-ctr
ip ssh client algorithm encryption aes128-ctr aes192-ctr aes256-ctr
!
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
!
end

R6#

 

Switch on the left (SW2)

SW2#show run
Building configuration...

Current configuration : 936 bytes
!
! Last configuration change at 15:38:05 EST Fri Apr 15 2022
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname SW2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone EST -5 0
!
!
!
!
!
no ip source-route
no ip routing
!
!
!
no ip cef
no ipv6 cef
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
!
interface Ethernet0/1
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Vlan1
ip address 192.168.1.1 255.255.255.0
no ip route-cache
!
no ip classless
ip forward-protocol nd
!
ip http server
!
ip ssh server algorithm encryption aes128-ctr aes192-ctr aes256-ctr
ip ssh client algorithm encryption aes128-ctr aes192-ctr aes256-ctr
!
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
!
end

SW2#

 

Why can I ping everything here? In the CCNA volume 1 book, it mentions that you need to add a default-gateway on the switch so it can communicate with other subnets in case you want to telnet or SSH into the switch. In this case, it's working without it. Is this a dumb question to ask? Thanks for your help.

 

If it helps, R6 is a Cisco IOL Layer 2 device. Also, I tried adding the no ip classless command, but I have no idea what it does; so please ignore.

 

 

1 Accepted Solution

Accepted Solutions

Jon Marshall
Hall of Fame
Hall of Fame

 

The router will be using proxy arp and that is why it works. 

 

If the switch has no default gateway it will arp for everything so it arps for 192.168.1.1, the router sees this arp and because it has a directly connected interface in that subnet it answers of behalf of 192.168.1.1 using the mac address of it's fa0/1 interface. 

 

The switch then just sends the packet to the router with the router's mac address and the router forwards it on. 

 

Jon

View solution in original post

2 Replies 2

Jon Marshall
Hall of Fame
Hall of Fame

 

The router will be using proxy arp and that is why it works. 

 

If the switch has no default gateway it will arp for everything so it arps for 192.168.1.1, the router sees this arp and because it has a directly connected interface in that subnet it answers of behalf of 192.168.1.1 using the mac address of it's fa0/1 interface. 

 

The switch then just sends the packet to the router with the router's mac address and the router forwards it on. 

 

Jon

jpferron31
Level 1
Level 1

Thank you!!! I got it to work. I set the command no ip proxy-arp on the interface facing the switch and now it cannot ping unless I set the default-gateway.

 

I appreciate it!

Review Cisco Networking for a $25 gift card