10

When would you choose to use the ip default-network command instead of the ip default-gateway command?

Adam Loveless
  • 3,129
  • 7
  • 30
  • 51

3 Answers3

12

ip default-gateway is to be used in L2 devices.

ip default-network would be used in L3 devices, but works slightly different from the usual static default route configured with ip route 0.0.0.0 0.0.0.0 <next_hop>. Let's say you configure ip default-network 172.31.0.0. Then, if the device already knows a route for 172.31.0.0, this route will be flagged as a default route candidate.

You need to take into account that ip default-network command is classful.

Further details and clarifications are available here

Daniel Yuste Aroca
  • 2,884
  • 5
  • 24
  • 43
2

See here

Basically ip default-gateway is for layer-2 devices and ip default-network is for layer-3 devices.

ip default-network is basically a default route

Mike Marotta
  • 2,057
  • 1
  • 14
  • 26
1

When IP routing is enabled, the commands ip default-network and "ip route 0.0.0.0" etc. work the same. These commands would be used on a router or Layer 3 switch.

"ip default-gateway" would be used when ip routing is not enabled - for instance, on a Layer 2 switch that has an SVI for management but cannot route on that SVI.

Mierdin
  • 1,841
  • 14
  • 17