cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4468
Views
20
Helpful
7
Replies

Vlan and switch default gateway

Tysam1234
Level 1
Level 1

Hi,

Can anyone answer my question?
How a switch default gateway use to affect the use of vlan!!

7 Replies 7

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

The default gateway defined on a switch using the ip default-gateway does not influence the use of VLAN in any way. Instead, imagine that the switch itself is a computer - it has a CPU, it has a memory, an operating system, you can connect to it using Telnet or SSH or HTTP, you can use its command line to ping or to connect to other devices. From this viewpoint, it is just a host that can speak IP protocol. And just like all other hosts, if it needs to talk to a device that is on a different IP network than itself, it needs a default gateway defined using the ip default-gateway command.

You must keep in mind that a switch never needs an IP address to perform basic Layer2 switching. That is why I said that the VLANs by themselves are not in any way influenced by this default gateway. Layer2 switching is never influenced by the default gateway defined on a switch. However, if it is a managed switch, the management is done remotely over IP - Telnet, SSH, HTTP, SNMP. So if you need to manage the switch remotely, you need to assign an IP address and gateway to this switch because it is becoming an endpoint of an IP communication, and every IP endpoint needs its IP address, netmask and gateway.

Best regards,

Peter

Peter,

Just one follow-on to your excellent reply.  I don't think it affects your answer, perhaps it is just an additional caveat.

Excluding switches that allow routed interfaces, IP addresses on the switch are typically associated with SVIs.  In this case, would not an additional caveat be that the default gateway be reachable by a port on the same vlan (or trunk with the vlan allowed) associated to the SVI?

Best regards,

Ed

Hello Edwin,

Thank you! And I apologize for responding lately

In this case, would not an additional caveat be that the default gateway  be reachable by a port on the same vlan (or trunk with the vlan  allowed) associated to the SVI?

Absolutely correct. Originally, when I responded, I did not want to be too vendor-specific and go into talking about SVIs or trunks etc. I simply assumed that the switch can be somehow assigned its own IP address and mask, and the gateway must be reachable in order for this switch to be able to communicate with IP hosts in different networks. I did not want to go into explaining how this is to be accomplished. But yes, you are absolutely correct that the switch must be able to reach the default gateway within its own management VLAN.

Best regards,

Peter

Peter - appreciate the response and I think I understand what you're saying.  Having limited experience with other vendor switches is a weakness that I am currently working on. 

Hello Edwin,

Thank you! Good luck in absorbing the other vendors' approaches! You will be surprised how differently can a single thing be understood and implemented.

Best regards,

Peter

hi peter,

i always find your answers very informative and easy to understand.

you should write cisco a book! (or do you already have one?)

cheers to 2013! +5 to you sir!

Hello John,

All the very best in the 2013 for you! Thank you very much for your kind words and the ratings.

Write a book? I am not against the idea. I do not know how to start the entire process, though. To be honest, I did express my willingness to be a technical editor/reviewer and possibly a co-author to Cisco Press but there was no response.

The question also is what should be the topic of the book - you know, there are already dozens of books, and great books, on virtually every topic you can imagine. I am not sure if writing yet another book on a topic that is already covered brings any new value.

I would be interested in knowing your opinion!

Once again, thank you for you support! If there is anything that makes these forums so unique, then it's people who really care and try to help each other.

Best regards,

Peter