cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
514
Views
0
Helpful
4
Replies

Default Route on a switch - question

dan_track
Level 1
Level 1

Hi

I'm having trouble understanding some basics on a switch. If I have multiple vlan's and each one of those vlan's has a default gateway, then which gateway do I use to put into the switch command "ip default-gateway" for example:

vlan 1: 10.20.20.1

vlan 2: 10.30.30.1

vlan 3: 10.11.4.1

Thanks

Dan

4 Replies 4

Edison Ortiz
Hall of Fame
Hall of Fame

Each VLAN's default gateway should point to the switch. The switch should have a default gateway to another device that will transport the data outside your office.

If you don't have another device and all traffic must remain local, then you don't need the ip default gateway command.

Richard Burts
Hall of Fame
Hall of Fame

Dan

I believe that your question reflects a bit of confusion. Each VLAN has its own default gateway and this is used by the end stations in the VLAN and they need to use the default gateway of the VLAN when they want to access addresses that are outside of the subnet of the VLAN. The default gateway configured on the switch is not to be used by the end stations on any VLAN but is for the switch itself. The management interface on the switch is essentially another IP host and it needs its own default gateway to be able to access addresses in remote subnets. So you would configure a default gateway on the switch that is the layer 3 interface address in the vlan that matches the management interface of the switch.

HTH

Rick

HTH

Rick

Think Ric said it best but I will add that seeing it looks like you have ip routing turned on for that switch you would not even use the default gateway command but would instead use a default static route pointing it to the next hop , the default gateway is for when you turn ip routing off on the box .

I obviously interpreted the question in terms of layer 2 switches and answered the question in that context. I believe that my answer is quite correct for layer 2 switches which need the default gateway. Glen has picked up on something that I did not which is that with multiple VLAN interfaces which have IP addresses that it would be a layer 3 switch. Layer 3 switches implement routing logic and do not really need default-gateway configuration.

Good catch Glen. :)

HTH

Rick

HTH

Rick
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card