Wired Intelligent Edge

last person joined: 21 hours ago 

Bring performance and reliability to your network with the HPE Aruba Networking Core, Aggregation, and Access layer switches. Discuss the latest features and functionality of your switching devices, and find ways to improve security across your network to bring together a mobile-first solution
Expand all | Collapse all

2930M default gateway or ip route 0.0.0.0?

This thread has been viewed 16 times
  • 1.  2930M default gateway or ip route 0.0.0.0?

    Posted Jul 18, 2020 07:28 AM

    when configuring default gateway for 2930M (the same for 2930F and 3810M), I have two options:

     

    1- ip default gateway xxxxx

    2- ip route 0.0.0.0 0.0.0.0 xxxxx

     

    is there any difference between the two commands? can I use any of them in all cases (if switch is L2 or L3)? any recommendations?

     

    Thank you,



  • 2.  RE: 2930M default gateway or ip route 0.0.0.0?
    Best Answer

    MVP GURU
    Posted Jul 18, 2020 08:28 AM

    the ip default gateway is when the switch is using on L2 mode (with no ip routing)

     

    ip route 0.0.0.0 is when the switch is using on L3 Mode (with ip routing)



  • 3.  RE: 2930M default gateway or ip route 0.0.0.0?

    Posted Jul 18, 2020 08:52 AM

    but it seems that the command "ip route 0.0.0.0" can do the job in both cases (L2 and L3 switches). I have it configured in many switches with ip routing disabled and still I can access them from any where in the network.

     

    wonder if I should use "ip route 0.0.0" in all scenarios instead of "ip default gateway".

     

    Is there any advantage of using "ip default gateways" for L2 switches?



  • 4.  RE: 2930M default gateway or ip route 0.0.0.0?
    Best Answer

    EMPLOYEE
    Posted Jul 20, 2020 04:17 AM

    I see the same in a 'no ip routing' switch with a difference in the metric of the route:

    sw01-12p(config)# ip default-gateway 192.168.3.1
    sw01-12p(config)# show ip route
      Destination        Gateway         VLAN Type      Sub-Type   Metric     Dist.
      ------------------ --------------- ---- --------- ---------- ---------- -----
      0.0.0.0/0          192.168.3.1     3    static               250        1
    sw01-12p(config)# ip route 0.0.0.0 0.0.0.0 192.168.3.1
    sw01-12p(config)# show ip route
      Destination        Gateway         VLAN Type      Sub-Type   Metric     Dist.
      ------------------ --------------- ---- --------- ---------- ---------- -----
      0.0.0.0/0          192.168.3.1     3    static               1          1
    

    As mentioned before, how I learned it is that in no-routing mode you will use ip default-gateway, and the switch will not do L3 routing for traffic. In ip routing mode you will use ip route. It seems to be that in routing mode the ip default-gateway will not be honored for routed traffic, just for the device traffic.