cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
60062
Views
0
Helpful
10
Replies

Default Gateway on vlan interface

ejdrijin1
Level 1
Level 1

Hi,

 

I want to set a default gateway on a layer 3 switch for VLAN 100.

 

If I give an IP for interface VLAN 100 does it work or do I need to set it on an actual interface (port - example: int g1/0/1)?

 

Thanks

10 Replies 10

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

Creating a Layer3 interface (int vlan100) would create an SVI for that VLAN. Applying an IP address to that SVI would provide a default gateway for the VLAN/ subnet. You would make this SVI available by using switchports in access or trunk mode.

 

Applying an IP address to a interface would create a routed interface.

 

cheers,

Seb.

Hi Seb,

 

Thanks for your reply. So if I want to do routing to this subnet/vlan I need to do it on the interface, right?

 

Thanks.

Depends on the device.

Routers typically only support routed interfaces, whereas Layer3 switches support both routed interfaces and also SVIs.

 

What hardware are you using?

 

cheers,

Seb.

Thanks for your reply.

 

I am using Cisco 3750X.

A layer3 switch. In which case, follow the configuration which @Deepak Kumar mentioned in his post below.

Likewise as @Joseph W. Doherty noted, you will also need a way to route traffic to other subnets/ the internet.

 

cheers,

Seb.

Deepak Kumar
VIP Alumni
VIP Alumni

Hi, 

You didn't write the error message and switch model number. 

I hope your configuration as below

 

Vlan 100

exit

!

interface vlan 100

ip add 192.168.1.1 255.255.255.0  !----> Example only, you can use available subnet.

no shut

!

!

interface gig1/0/1

switchport mode access

switchport access vlan 100

spanningtree portfast 

no shut

!

!

Now configure the IP address in the system which is connected to Gi1/0/1 

IP address: 192.168.1.100 / 255.255.255.0

default Gateway: 192.168.1.1

 

Now ping to the default gateway and share the output. 

 

Regards,

Deepak Kumar

 

 

 

 

Regards,
Deepak Kumar,
Don't forget to vote and accept the solution if this comment will help you!

Joseph W. Doherty
Hall of Fame
Hall of Fame
"I want to set a default gateway on a layer 3 switch for VLAN 100."

Unclear what you want to accomplish. Do you want a L3 switch to host a gateway for VLAN 100, and also insure it's the default gateway for hosts on VLAN 100 or are you trying to have VLAN 100, on the switch, have a default gateway?

I want to create a new subnet 192.168.1.0/24 and set 192.168.1.1 as the default gateway of the VLAN.

 

My question is does the 192.168.1.1 need to be set on the int VLAN 100 or the g1/0/1?

 

Thanks.

Hi,

It will under the VLAN 100.

 

Regards,

Deepak Kumar

Regards,
Deepak Kumar,
Don't forget to vote and accept the solution if this comment will help you!

It might be done either way - which depends on what your topology is.

Assuming VLAN 100 is also defined on your 3750X, you would define a SVI for VLAN 100 and define the IP there. However, if what was attached to g1/0/1 was another switch, and VLAN 100 was only hosted on it, you could define the IP on g1/0/1, after making the port a non-switchport.

BTW, doing either, alone, isn't what defines a default gateway; it's generally up to your clients to decide what IP they will use for gateway.
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