4

My network topology is as follows

enter image description here

From R1, I was not able to ping R3.

Packet capture on R3 shows that echo request received, but no reply from R3.

enter image description here

It turns out that default gateway did not appear in show ip route even though I already put the config and then followed by wr mem

What's wrong with this?

How to fix it?

R1

R1#sh run | i ga
ip default-gateway 192.168.10.2
R1#
R1#show ip route
Default gateway is 192.168.10.2

Host               Gateway           Last Use    Total Uses  Interface
ICMP redirect cache is empty
R1#

R3

R3#sh run | i ga
ip default-gateway 10.10.10.2
R3#
R3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, FastEthernet0/0
R3#

show running-config R1

R1#sh run
Building configuration...

Current configuration : 1003 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
no ip icmp rate-limit unreachable
no ip cef
!
no ip domain lookup
!
multilink bundle-name authenticated
!
archive
 log config
  hidekeys
!
ip tcp synwait-time 5
!
interface FastEthernet0/0
 ip address 192.168.10.1 255.255.255.0
 no ip route-cache
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 no ip route-cache
 shutdown
 duplex auto
 speed auto
!
ip default-gateway 192.168.10.2
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
control-plane
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
end

R1#

show running-config R2

R2#show running-config
Building configuration...

Current configuration : 1130 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
no ip domain lookup
!
multilink bundle-name authenticated
!
archive
 log config
  hidekeys
!
ip tcp synwait-time 5
!
interface FastEthernet0/0
 ip address 10.10.10.2 255.255.255.0
 ip nat outside
 ip virtual-reassembly
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.10.2 255.255.255.0
 ip nat inside
 ip virtual-reassembly
 duplex auto
 speed auto
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
ip nat inside source list NAT interface FastEthernet0/0 overload
!
ip access-list standard NAT
 permit 192.168.0.0 0.0.0.255
!
no cdp log mismatch duplex
!
control-plane
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
end

R2#

show running-config R3

R3#sh run
Building configuration...

Current configuration : 944 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
no ip domain lookup
!
multilink bundle-name authenticated
!
archive
 log config
  hidekeys
!
ip tcp synwait-time 5
!
interface FastEthernet0/0
 ip address 10.10.10.3 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
ip default-gateway 10.10.10.2
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
control-plane
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
end

R3#

If you need further information, please let me know.

  • What is the routing table looking like on R2? – Ravi Jan 1 '18 at 10:53
  • Is there a reason NOT to use static routes or some routing protocols instead of ip default-gateway? – Ravi Jan 1 '18 at 10:53
  • 1
    IP default gateway should only be used when IP routing is disabled on the Cisco router. For instance, if the router is a host in the IP world, you can use this command to define a default gateway for it. You might also use this command when your low end Cisco router is in boot mode in order to TFTP a Cisco IOS Software image to the router. In boot mode, the router does not have IP routing enabled. – user36472 Jan 1 '18 at 10:58
  • 1
    You should either use a static 0.0.0.0 0.0.0.0 route or use the command ip default-network – user36472 Jan 1 '18 at 11:01
  • Thanks @Cown. You're right. I'm able to ping R3 from R1 now. It's working when I use combination of ip default-gateway x.x.x.x and no ip routing – Sabrina Jan 1 '18 at 11:34
5

IP default gateway should only be used when IP routing is disabled on the Cisco router. For instance, if the router is a host in the IP world, you can use this command to define a default gateway for it. You might also use this command when your low end Cisco router is in boot mode in order to TFTP a Cisco IOS Software image to the router. In boot mode, the router does not have IP routing enabled.

IP routing is normally needed and there are other methods of achieving the goal:

IP default-network

Unlike the ip default-gateway command, you can use ip default-network when ip routing is enabled on the Cisco router. When you configure ip default-network the router considers routes to that network for installation as the gateway of last resort on the router.

For every network configured with ip default-network, if a router has a route to that network, that route is flagged as a candidate default route.

IP route 0.0.0.0 0.0.0.0

Creating a static route to network 0.0.0.0 0.0.0.0 is another way to set the gateway of last resort on a router. As with the ip default-network command, using the static route to 0.0.0.0 is not dependent on any routing protocols. However, ip routing must be enabled on the router.

Summary

Use the ip default-gateway command when ip routing is disabled on a Cisco router. Use the ip default-network and ip route 0.0.0.0 0.0.0.0 commands to set the gateway of last resort on Cisco routers that have ip routing enabled. The way in which routing protocols propagate the default route information varies for each protocol.

Cisco Configuring a Gateway of Last Resort Using IP Commands:

https://www.cisco.com/c/en/us/support/docs/ip/routing-information-protocol-rip/16448-default.html

0

You should not use the ip default-gateway commands on a router that is acting as a router(ip routing is enabled), and the ip default-network command is really for IGRP, which doesn't understand the default route; you can use a static default route.

Cisco has a document that explains the differences: Configuring a Gateway of Last Resort Using IP Commands:

Summary

Use the ip default-gateway command when ip routing is disabled on a Cisco router. Use the ip default-network and ip route 0.0.0.0 0.0.0.0 commands to set the gateway of last resort on Cisco routers that have ip routing enabled. The way in which routing protocols propagate the default route information varies for each protocol.

  • Added summary, my hangover prevented me for reading all of it. – user36472 Jan 2 '18 at 6:38
  • Sorry, I didn't even see your answer because I had answered it from the reviews page. I did vote for your answer. – Ron Maupin Jan 2 '18 at 6:40
  • No problem, the summary is actually pretty vital in my opinion, so i guess it still applies. – user36472 Jan 2 '18 at 6:41
  • I almost closed it as a dulpicate to: networkengineering.stackexchange.com/q/45105/8499 – Ron Maupin Jan 2 '18 at 6:43
  • You should have, it answers it very well. :-) – user36472 Jan 2 '18 at 6:47
0

I think you will need to configure an IGP (RIP, OSPF, IS-IS etc.) coz these routers are in different subnet. No default gateway is needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.