Default Gateway on vlan interface
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2018 03:03 AM - edited 03-08-2019 02:38 PM
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
- Labels:
-
Other Switching
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2018 03:36 AM - edited 04-13-2018 03:38 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2018 03:38 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2018 03:40 AM - edited 04-13-2018 03:43 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2018 06:36 AM
Thanks for your reply.
I am using Cisco 3750X.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2018 06:44 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2018 03:41 AM
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
Deepak Kumar,
Don't forget to vote and accept the solution if this comment will help you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2018 04:47 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2018 06:44 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2018 06:54 AM
Hi,
It will under the VLAN 100.
Regards,
Deepak Kumar
Deepak Kumar,
Don't forget to vote and accept the solution if this comment will help you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2018 07:23 AM
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.
