cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3203
Views
0
Helpful
11
Replies

ip default-network command

sarahr202
Level 5
Level 5

hi every body

Let say we have routing table as shown below(.I configured " ip default-network 199.199.199.0)


gateway of last resort is not set

C* 199.199.199.0/24  directly connected f0/0


C 200.200.200.0/24 directly connected f0/1

Let say router receives a packet destined to 100.100.100.100  , will router use the "  199.199.199.0"   route to forward it?

thanks.

4 Accepted Solutions

Accepted Solutions

Richard Burts
Hall of Fame
Hall of Fame

Since the router is saying that the gateway of last resort is not set, then the router would not forward a packet with destination 100.100.100.100. The problem here is that the "default" network is locally connected, so the router does not know how to forward to get to 100.100.100.100. If the default network were in the routing table as being remote and being learned via some dynamic routing protocol, then the router would know how to forward to 100.100.100.100. But when the default is locally connected there is no next hop to forward to.

HTH

Rick

HTH

Rick

View solution in original post

I am a bit surprised that when you add the redistribute static on R2 that R2  adds the gateway of last resort in its routing table but does not advertise the default to R1. Perhaps we could understand it better if you would post the output of show ip route and of debug rip on R2.

HTH

Rick

HTH

Rick

View solution in original post

Hi,

Your debug is missing something.

I believe you need to use default-information originate command under the RIPv1 process. Please find the below

===Without the default -information originate command and just using the redistribute static as you did

R2#sh ip rip database
0.0.0.0/0 is possibly down
0.0.0.0/0 is possibly down
10.0.0.0/8    auto-summary
10.0.0.0/8    redistributed
    [1] via 0.0.0.0,
10.10.10.0/24    directly connected, Loopback1
199.199.199.0/24    auto-summary
199.199.199.0/24    directly connected, GigabitEthernet1/0

*Mar  1 09:14:10.555: RIP: sending v1 update to 255.255.255.255 via Loopback1 (10.10.10.10)
*Mar  1 09:14:10.555: RIP: build update entries
*Mar  1 09:14:10.555:   subnet 0.0.0.0 metric 16
*Mar  1 09:14:10.555:   network 199.199.199.0 metric 1
*Mar  1 09:14:10.999: RIP: received v1 update from 199.199.199.1 on GigabitEthernet1/0
*Mar  1 09:14:10.999:     0.0.0.0 in 16 hops (inaccessible)

====With the  default-information originate command


*Mar  1 09:15:17.823: RIP: sending v1 update to 255.255.255.255 via GigabitEthernet1/0 (199.199.199.2)
*Mar  1 09:15:17.823: RIP: build update entries
*Mar  1 09:15:17.823:   subnet 0.0.0.0 metric 1          << Sets this as hop 1
*Mar  1 09:15:17.823:   network 10.0.0.0 metric 1

R2#sh ip rip database
0.0.0.0/0    auto-summary
0.0.0.0/0    redistributed
    [1] via 0.0.0.0,
10.0.0.0/8    auto-summary
10.0.0.0/8    redistributed
    [1] via 0.0.0.0,
10.10.10.0/24    directly connected, Loopback1
199.199.199.0/24    auto-summary
199.199.199.0/24    directly connected, GigabitEthernet1/0
R2#

R1#sh 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 199.199.199.2 to network 0.0.0.0

C    199.199.199.0/24 is directly connected, GigabitEthernet1/0
R    10.0.0.0/8 [120/1] via 199.199.199.2, 00:00:27, GigabitEthernet1/0
R*   0.0.0.0/0 [120/1] via 199.199.199.2, 00:00:27, GigabitEthernet1/0
R1#

HTH

Regards,

Kishore

Please rate if helpful

View solution in original post

Kishore

While I agree with you that the default information originate is a better solution than the default-network command I do not believe that this suggestion really addresses the issue raised in the original post. As I understand it, the original post is asking a question about the default-network command and why it is not working in the environment as expected. Giving a different command does not address that issue (even if the alternative command is better).

To the original poster

I have a couple of comments:

- I have an issue with the static route as presented in the config that you posted. The static route is:

ip route 10.0.0.0 255.0.0.0 10.10.10.0

but the static route points at a subnet and not to a next hop. I think it would be better if the static route were

ip route 10.0.0.0 255.0.0.0 10.10.10.10

- I would be interested to know what the result would be if you changed the static route.

But even if you make that change I am not sure that it will work as you expect. Even with the change in static route the default network is locally connected. The default network is intended to point to some network that is remote.

So I would suggest an alternative way to test the function of default-network. Configure a test with 3 routers.

- on R3 configure some network/subnet (perhaps 172.18.21.1 255.255.255.0 on loopback 0.

- on R3 configure an interface that connects to R2.

- on R2 configure an interface that connects to R3.

- have R2 learn the remote network from R3. It could be learned by static route or by dynamic routing protocol.

- on R2 configure default-network pointing to the network (not the subnet) that is learned from R3.

- on R2 configure an interface that connects to R1.

- on R2 configure a dynamic routing protocol (perhaps RIP or perhaps something else) and make sure that it runs on the interface connecting to R1.

- on R1 configure an interface that connects to R2.

- on R1 configure a dynamic routing protocol that matches the protocol confgured on R2 and that will learn routes from R2.

- on R2 do show ip route and see if it has identified a gateway of last resort.

- on R1 do show ip route and see if it has learned the default gateway from R2.

I also observe that the default-network command is pretty old and has been superceded by newer/better commands. If you are interested in learning about default-network because you are interested in understanding how things in the network work, then this is good and go for it But if you are trying to figure how to configure a working network then other alternatives are better - and Kishore has identified a good alternative.

HTH

Rick

HTH

Rick

View solution in original post

11 Replies 11

Richard Burts
Hall of Fame
Hall of Fame

Since the router is saying that the gateway of last resort is not set, then the router would not forward a packet with destination 100.100.100.100. The problem here is that the "default" network is locally connected, so the router does not know how to forward to get to 100.100.100.100. If the default network were in the routing table as being remote and being learned via some dynamic routing protocol, then the router would know how to forward to 100.100.100.100. But when the default is locally connected there is no next hop to forward to.

HTH

Rick

HTH

Rick

thanks Rick

Thanks  Rick.

if you don't mind , coud you please explain the following.

Ripv1 is used.

R1 (f0)-----------------199.199.199.0----------------(f0)R2

R2 has following

ip default-network 10.0.0.0

C 10.10.10.10 /24 loopback 1

f0  199.199.199.0/24  f0

S 10.0.0.0./8 via 10.10.10.10

R1 has following :

C 199.199.199.0 f0

R 10.0.0.0/8 via 199.199.199.2

R2 has not gateway of last resort set, R1 did not learn any default route from R2 either

Next  , i  used the commands on R2

ip default -network 10.0.0.0

router rip

redistribute static

It sets the default gateway on R2 as:

Gateway of last resort is 10.10.10.10  to 10.0.0.0

But  R2 is not advertising it out of Fo to R1

debug ip rip shows on R2, following are advertised on fo to R1

10.0.0.0 hop count 1

(R2  auto -summarizes the 10.10.10.0 on F0 )

The question how could i make R1 learn default route from R2 in our scenario keeping the constraints in mind--  Ripv1 must be used and default route must be advertised as result of " ip default-network command on R2?

Thanks

I am a bit surprised that when you add the redistribute static on R2 that R2  adds the gateway of last resort in its routing table but does not advertise the default to R1. Perhaps we could understand it better if you would post the output of show ip route and of debug rip on R2.

HTH

Rick

HTH

Rick

thanks Rick,

Below is the attached file containing the configurations, routing tables and debug output,  Thanks for your help

Hi,

Your debug is missing something.

I believe you need to use default-information originate command under the RIPv1 process. Please find the below

===Without the default -information originate command and just using the redistribute static as you did

R2#sh ip rip database
0.0.0.0/0 is possibly down
0.0.0.0/0 is possibly down
10.0.0.0/8    auto-summary
10.0.0.0/8    redistributed
    [1] via 0.0.0.0,
10.10.10.0/24    directly connected, Loopback1
199.199.199.0/24    auto-summary
199.199.199.0/24    directly connected, GigabitEthernet1/0

*Mar  1 09:14:10.555: RIP: sending v1 update to 255.255.255.255 via Loopback1 (10.10.10.10)
*Mar  1 09:14:10.555: RIP: build update entries
*Mar  1 09:14:10.555:   subnet 0.0.0.0 metric 16
*Mar  1 09:14:10.555:   network 199.199.199.0 metric 1
*Mar  1 09:14:10.999: RIP: received v1 update from 199.199.199.1 on GigabitEthernet1/0
*Mar  1 09:14:10.999:     0.0.0.0 in 16 hops (inaccessible)

====With the  default-information originate command


*Mar  1 09:15:17.823: RIP: sending v1 update to 255.255.255.255 via GigabitEthernet1/0 (199.199.199.2)
*Mar  1 09:15:17.823: RIP: build update entries
*Mar  1 09:15:17.823:   subnet 0.0.0.0 metric 1          << Sets this as hop 1
*Mar  1 09:15:17.823:   network 10.0.0.0 metric 1

R2#sh ip rip database
0.0.0.0/0    auto-summary
0.0.0.0/0    redistributed
    [1] via 0.0.0.0,
10.0.0.0/8    auto-summary
10.0.0.0/8    redistributed
    [1] via 0.0.0.0,
10.10.10.0/24    directly connected, Loopback1
199.199.199.0/24    auto-summary
199.199.199.0/24    directly connected, GigabitEthernet1/0
R2#

R1#sh 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 199.199.199.2 to network 0.0.0.0

C    199.199.199.0/24 is directly connected, GigabitEthernet1/0
R    10.0.0.0/8 [120/1] via 199.199.199.2, 00:00:27, GigabitEthernet1/0
R*   0.0.0.0/0 [120/1] via 199.199.199.2, 00:00:27, GigabitEthernet1/0
R1#

HTH

Regards,

Kishore

Please rate if helpful

thanks Kishore

Kishore

While I agree with you that the default information originate is a better solution than the default-network command I do not believe that this suggestion really addresses the issue raised in the original post. As I understand it, the original post is asking a question about the default-network command and why it is not working in the environment as expected. Giving a different command does not address that issue (even if the alternative command is better).

To the original poster

I have a couple of comments:

- I have an issue with the static route as presented in the config that you posted. The static route is:

ip route 10.0.0.0 255.0.0.0 10.10.10.0

but the static route points at a subnet and not to a next hop. I think it would be better if the static route were

ip route 10.0.0.0 255.0.0.0 10.10.10.10

- I would be interested to know what the result would be if you changed the static route.

But even if you make that change I am not sure that it will work as you expect. Even with the change in static route the default network is locally connected. The default network is intended to point to some network that is remote.

So I would suggest an alternative way to test the function of default-network. Configure a test with 3 routers.

- on R3 configure some network/subnet (perhaps 172.18.21.1 255.255.255.0 on loopback 0.

- on R3 configure an interface that connects to R2.

- on R2 configure an interface that connects to R3.

- have R2 learn the remote network from R3. It could be learned by static route or by dynamic routing protocol.

- on R2 configure default-network pointing to the network (not the subnet) that is learned from R3.

- on R2 configure an interface that connects to R1.

- on R2 configure a dynamic routing protocol (perhaps RIP or perhaps something else) and make sure that it runs on the interface connecting to R1.

- on R1 configure an interface that connects to R2.

- on R1 configure a dynamic routing protocol that matches the protocol confgured on R2 and that will learn routes from R2.

- on R2 do show ip route and see if it has identified a gateway of last resort.

- on R1 do show ip route and see if it has learned the default gateway from R2.

I also observe that the default-network command is pretty old and has been superceded by newer/better commands. If you are interested in learning about default-network because you are interested in understanding how things in the network work, then this is good and go for it But if you are trying to figure how to configure a working network then other alternatives are better - and Kishore has identified a good alternative.

HTH

Rick

HTH

Rick

Hi Rick

i implemented   the set up you suggested:

R1f0---------------f0R2 F0/1-------------------------------f0 R3

Brief description;

R3

loopback   172.18.21.1/24

f0 200.200.200.3/24

both are advertised via ripv1 to R2

R2

f0  199.199.199.2/24

f0/1   200.200.200.2/24

ip default-network 172.18.0.0

R2 sets the default gateway as

gateway of last resort is 200.200.200.3 (R3 ) to network 172.18.0.0

But R2 does not advertises the default route to R1

i attached the configurations and show ip route output in  attached file zee2.


======================================

Interestingly,  when i changed the  set up as follows,

R1f0----------------f0R2f1--------------------------R3

everthing remains the same  except  i replaced  the loopack address on R3  10.10.10.10/8

and configured the command " ip default-network 10.0.0.0  (   loopack network,)

R3 starts advertising the default route to R2 , which in turns  starts advertising to R1.

I attached the config and  show output in file zee3.

thanks  and have a nice weekend.

Thanks for testing my suggestion and letting us know your results.

This is very interesting and is contrary to my understanding of how it should work (and contrary to my memory of how I tested it - quite a while ago - so perhaps my memory is called into question).

I think I see what is happening. In your first scenario (zee2) the address configured on the loopback is a subnet of the class B network. In your second scenario (zee3) the address configured on the loopback is the entire class A network (not a subnet). So this leads me to believe that if your went back to the first scenario and changed the subnet mask on the loopback to a /16 that it probably would work to generate the default route which R2 would advertise to R1..

My understanding has been that if R2 has a default network statement identifying 172.18.0.0 as the default network and if R2 sees that class B network as reachable through R3 that R2 should use that network as its default route/gateway of last resort and should advertise it to R1. But what seems to be happening is that R2 does set its gateway of last resort but does not advertise it to R1. I find this quite strange.

I wonder if you went back to the first scenario where the loopback is a subnet of the class B and if you ran debug ip rip on both R3 and R2 if it might give some clues about what is happening. (it might also be helpful to run debug ip routing on R2)

HTH

Rick

HTH

Rick

Hi Rick,

I agree with you as I noticed the output that sarah posted the first time the subnet was a /24 on the loopback but as we know the ip default-network is classful and it needed a  /8.

====From the output posted first time on R2


interface Loopback1
ip address 10.10.10.10 255.255.255.0     <<<  /24

ip default-network 10.0.0.0

===From the outpust posted this time on R3

interface Loopback3
ip address 10.10.10.10 255.0.0.0           <

ip default-network 10.0.0.0

Sarah,

Would it possible in the first scenario to change the loopback to " ip address 10.10.10.10 255.0.0.0" on R2 and see if this works. I mean shutdown the link between R2 and R3. so that we can test if this what was causing the issue to begin with. Only if you can and have the the time.

Regards