cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
460
Views
10
Helpful
8
Replies

Switch default gateway question

Neuromancer
Level 1
Level 1

How does it work when you have multiple vlans configured on a switch, but only one "ip default-gateway " command? Which VLAN does this provide a default-gateway service to? (I think it's mabey the the management vlan)

Is there a way to put a "ip default-gateway " command in each vlan? Is is even necessary?

Any help is appreciated!

Thanks,

Chris

8 Replies 8

ankbhasi
Cisco Employee
Cisco Employee

Hi Chris,

"ip default-gateway" command is basically used when switches are not doing any routing and working as pure layer 2 switch so that when they initiate traffic for some subnet outside their management subnet they can send traffic on default gateway.

You can have only one default-gateway configured on your switch.

When your switch has multiple vlan interfaces which means it is a layer 3 switch and doing routing and when your switch is configured to route with IP, it does not need to have a default gateway set.

HTH

Ankur

*Pls rate all helpfull post

mohammedmahmoud
Level 11
Level 11

Hi,

I think that you are talking about a layer 2 switch, and in this case "ip default-gateway " command is used for managing the switch and it is not used to route VLAN traffic.

HTH, please do rate all helpful replies,

Mohammed Mahmoud.

Yes, it is on a layer 2. So hypothetically, this command is not needed as long as the management vlan/subnet is the same accross your network, right?

Hi Chris,

You got it!!

Regards,

Ankur

Ankur

I think that you were a bit too quick in responding and did not think this through well. Mohammed makes a good point aboutn the use of default-gateway. If a layer 2 switch does not configure ip default-gateway then it will be able to communicate with other devices within the same management VLAN/subnet but will not be able to communicate with anything outside of that subnet.

HTH

Rick

HTH

Rick

Hi Rick,

You are absolutely right and I believe I told the original poster about the use on my first post

" ("ip default-gateway" command is basically used when switches are not doing any routing and working as pure layer 2 switch so that when they initiate traffic for some subnet outside their management subnet they can send traffic on default gateway. ) "

But when the original poster again asked that if everything is in same subnet including the switch management vlan then he do not need the default gateway.

I responded "YES YOU GOT IT" . So I believe from original poster's second reply he understood when he need default gateway and when he don't.

Regards,

Ankur

Hi,

Think of it as if the default gateway configured on a PC. It is used in order for the switch management to be reachable across other routed networks, if you are trying to reach your switch from a PC not on the same LAN.

HTH, please do rate all helpful replies,

Mohammed Mahmoud.

I got it now. Thank you all for your help!

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: