Default Gateway on a Switch?

rewindrewind Member Posts: 40 ■■□□□□□□□□
Why would you need to set this. I know you set an ip address for in-band switch management, but the text I'm reading (Cisco Press ICND) states the ip default-gateway command is used, "so that the management interface can be reached from a remote network." this just isn't clicking for me. Can anyone mabey give me an example for this?

Also the text says, "the default gateway is the IP address of a router connected to a switch; the switch sends IP packets to that router to send them to IP hosts that are not onthe LAN created by the switch." What if you have a switched network with switches connected to each other. Would you use no default gateway in this scenario? Surely you wouldn'nt use the ip address of another switch, since the address is only used for management purposes and not packet forwarding.

Thanks
-Chris

Comments

  • lordylordy Member Posts: 632 ■■■■□□□□□□
    There are quite a few reasons to set this.

    First, as the books says to reach/configure the switch from a remote network. Simple example: You have two offices, connected through a WAN-link (e.g. ISDN). The switch in office A handles the 192.168.1.0/24 network, the switch in office B handles the 192.168.2.0/24 network.

    If you are in office A you obviously cannot manage the switch in office B because it has no clue on how to respond to you if it does not know a gateway.

    Other reasons for setting this is reaching servers like NTP (time-sync), AAA (authentication), Syslog, etc.

    HTH,
    Lordy
    Working on CCNP: [X] SWITCH --- [ ] ROUTE --- [ ] TSHOOT
    Goal for 2014: RHCA
    Goal for 2015: CCDP
  • SVSV Member Posts: 166
    I am not sure if this is what you are looking for:

    Let us say you are trying to ping the switch-B which belongs to 20.0.0.0 network from a host-A which is in 10.0.0.0 network.

    Host-A
    S1 Router S0
    switch
    (10.0.0.0) ...............................(20.0.0.0)

    Let us say these two networks are connected using a router. S0 of the router connected to 20.0.0.0 network and S1 to the 10.0.0.0 network. If you have configured the 10.0.0.0 network properly, host-A will be able to send the requests to switches-B but when the switch-B wants to sent the reply to host-A which resides in a different network, it should now the route to take to reach 10.0.0.0. For this in the switch the default gateway should be set with the IP address of the S0 interface of the router
    Life is a journey...
  • rewindrewind Member Posts: 40 ■■□□□□□□□□
    Thanks fellas, makes sense now! :D
Sign In or Register to comment.