EIGRP: ip default-network command

VN:F [1.9.6_1107]
Rating: 5.0/5 (2 votes cast)
By Bryan Bartik on March 29th, 2010

This is usually one of the more confusing routing protocol commands supported by Cisco. Every couple of months, there is a post about it on GroupStudy or I get a question about it. Hopefully these two scenarios answer most of your questions and show you just exactly how it works!

This is our topology:

Topology

Scenario #1: R3 advertises a loopback 3.3.3.3 with a /8 mask

R2 learns 3.0.0.0/8 via EIGRP:

R2#sho ip route | be Gat
Gateway of last resort is not set
C    192.168.12.0/24 is directly connected, Serial1/0
3.0.0.0/8 is subnetted, 1 subnets
D       3.0.0.0 [90/2297856] via 192.168.23.3, 00:07:40, Serial1/1
C    192.168.23.0/24 is directly connected, Serial1/1

R2 uses the ip default-network 3.0.0.0 command to mark this as a default route. This now shows up as a “Gateway of last resort” on R2 and R1:

R2(config)#ip default-network 3.0.0.0
R2(config)#^Z
R2#sho ip route | be Gat
Gateway of last resort is 192.168.23.3 to network 3.0.0.0
C    192.168.12.0/24 is directly connected, Serial1/0
*   3.0.0.0/8 is subnetted, 1 subnets
D*      3.0.0.0 [90/2297856] via 192.168.23.3, 00:08:31, Serial1/1
C    192.168.23.0/24 is directly connected, Serial1/1

R1:

R1#sho ip route | be Gat
Gateway of last resort is 192.168.12.2 to network 3.0.0.0
C    192.168.12.0/24 is directly connected, Serial1/0
D*   3.0.0.0/8 [90/2809856] via 192.168.12.2, 00:00:19, Serial1/0
D    192.168.23.0/24 [90/2681856] via 192.168.12.2, 00:12:07, Serial1/0

When a classful network is used as the default, nothing special needs to happen to advertise the network as a candidate default. Let’s see what happens when the network specified is not classful.

Scenario #2: R3 advertises a loopback 3.3.3.3 with a /32 mask.

R2 is learning 3.3.3.3 as a host route. We try to mark it as a candidate default.

R2#sho ip route | be Gat
Gateway of last resort is not set
C    192.168.12.0/24 is directly connected, Serial1/0
3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/2297856] via 192.168.23.3, 00:00:03, Serial1/1
C    192.168.23.0/24 is directly connected, Serial1/1
R2(config)#ip default-network 3.3.3.3

A static route for 3.0.0.0 has been automatically entered into the routing table towards 3.3.3.3!

R2#sho ip route | be Gat
Gateway of last resort is not set
C    192.168.12.0/24 is directly connected, Serial1/0
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D       3.3.3.3/32 [90/2297856] via 192.168.23.3, 00:03:06, Serial1/1
S       3.0.0.0/8 [1/0] via 3.3.3.3
C    192.168.23.0/24 is directly connected, Serial1/1

Let’s redistribute this into EIGRP.

R2:

R2(config)#router eigrp 10
R2(config-router)#red static

R1:

R1#sho ip route | be Gat
Gateway of last resort is not set
C    192.168.12.0/24 is directly connected, Serial1/0
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D       3.3.3.3/32 [90/2809856] via 192.168.12.2, 00:04:02, Serial1/0
D EX    3.0.0.0/8 [170/2681856] via 192.168.12.2, 00:02:13, Serial1/0
D    192.168.23.0/24 [90/2681856] via 192.168.12.2, 00:17:10, Serial1/0

Notice that none of the routes are marked as candidate default yet. Now we can use ip default-network 3.0.0.0 on R2:

R2(config)#ip default-network 3.0.0.0
R2#sho ip route | be Gat
Gateway of last resort is 3.3.3.3 to network 3.0.0.0
C    192.168.12.0/24 is directly connected, Serial1/0
*   3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D       3.3.3.3/32 [90/2297856] via 192.168.23.3, 00:05:07, Serial1/1
S*      3.0.0.0/8 [1/0] via 3.3.3.3
C    192.168.23.0/24 is directly connected, Serial1/1

R1:

R1#sho ip route | be Gat
Gateway of last resort is 192.168.12.2 to network 3.0.0.0
C    192.168.12.0/24 is directly connected, Serial1/0
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D       3.3.3.3/32 [90/2809856] via 192.168.12.2, 00:05:18, Serial1/0
D*EX    3.0.0.0/8 [170/2681856] via 192.168.12.2, 00:01:01, Serial1/0
D    192.168.23.0/24 [90/2681856] via 192.168.12.2, 00:18:27, Serial1/0

The ip default-network 3.0.0.0 had no impact on the gateway of last resort initially. We first specified 3.3.3.3 as the gateway of last resort. This command entered 3.0.0.0/8 as a static route into the route table, which was then redistributed into EIGRP on R2. We then were able to mark 3.0.0.0 as the default with ip default-network.

Summary:

The ip default-network command will only mark a classful route as a default route. If you need to mark a subnet route (3.3.3.3/32 for example) as a default, the command generates a static route for the classful network. You can then redistribute that static route into EIGRP and mark that as a default with ip default-network command.

Regards,

Bryan Bartik
CCIE #23707 (R&S, SP), CCNP
Sr. Support Engineer – IPexpert, Inc.
URL: http://www.IPexpert.com

EIGRP: ip default-network command, 5.0 out of 5 based on 2 ratings
Share and Enjoy:
  • RSS
  • Twitter
  • Facebook
  • Google Bookmarks
  • Digg
  • Print
  • Technorati
  • Slashdot
  • LinkedIn
  • del.icio.us
  • Reddit
  • Sphinn
  • Mixx
  • Blogplay
  • Netvibes
  • NewsVine
  • Live
  • Ping.fm
  • MySpace
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Tags: , ,

6 Responses to “EIGRP: ip default-network command”

  1. Pablo says:

    What’s the difference between these:

    D 3.0.0.0 and
    D* 3.0.0.0

    OR

    S 3.0.0.0/8 and
    S* 3.0.0.0/8

    VA:F [1.9.6_1107]
    Rating: 0.0/5 (0 votes cast)
  2. Nicolas says:

    Many thanks for this post ! :D

    Didnt know that trick !

    VA:F [1.9.6_1107]
    Rating: 0.0/5 (0 votes cast)
  3. Deepak Arora says:

    But in which real world implementation this would help ?

    Please suggest with little explanation

    VA:F [1.9.6_1107]
    Rating: 0.0/5 (0 votes cast)
  4. Marcos says:

    Hello Bryan,

    I’ve done a simple (classful) default-network advertise, but at the neighbor router are receving D* routes but isn’t setting as Gw of Last Resort.

    Any Idea?

    Gateway of last resort is not set
    
          172.16.0.0/32 is subnetted, 12 subnets
    S        172.16.13.11 [1/0] via 192.168.32.1
    C        172.16.13.12 is directly connected, Loopback1
    S        172.16.13.21 [1/0] via 192.168.32.1
    D*    192.168.170.0/24 [90/25753856] via 192.168.33.25, 00:35:37, Tunnel5
    D*    192.168.171.0/24 [90/25753856] via 192.168.33.25, 00:35:37, Tunnel5

    Thanks in advance,
    Marcos Cotomacio

    VA:F [1.9.6_1107]
    Rating: 0.0/5 (0 votes cast)
  5. upgrade says:

    upgrade…

    [...]EIGRP: ip default-network command[...]…

    VA:F [1.9.6_1107]
    Rating: 0.0/5 (0 votes cast)

Leave a Reply