cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2884
Views
5
Helpful
2
Replies

default gateway same as VLAN interface ?

pfrancis3
Level 1
Level 1

Hello, I have a switch with a management VLAN interface created on it i.e. 192.168.1.1. The switch has layer 3 ip routing enabled.

This switch connects to a client PC on one port and also to a router on another port. The interface of the router is 192.168.1.2.

I notice the default gateway for this network has been set to 192.168.1.2.

Is the correct way to do this? I was thinking how come the defaut gateway is not set to the ip address of the VLAN interface. Would this be equally valid ?

Thanks for any help understanding this.

 

1 Accepted Solution

Accepted Solutions

mmoulson1
Level 4
Level 4

I assume that all devices are within this same managment VLAN?

If you used with switch address as the default gateway then the switch would look within its own routing table and forward packets based on this information. As the router and the switch sit within the same VLAN and network the PC may as well just send packets directly to the router, it is one less hop.

If you created a new VLAN with a new network lets say 192.168.2.0 and created a new VLAN interface with 192.168.2.1, you would point PC's in this VLAN to the switch as they can't talk directly to the router. The switch would the route packets between the two networks.

Hope that helps!

View solution in original post

2 Replies 2

mmoulson1
Level 4
Level 4

I assume that all devices are within this same managment VLAN?

If you used with switch address as the default gateway then the switch would look within its own routing table and forward packets based on this information. As the router and the switch sit within the same VLAN and network the PC may as well just send packets directly to the router, it is one less hop.

If you created a new VLAN with a new network lets say 192.168.2.0 and created a new VLAN interface with 192.168.2.1, you would point PC's in this VLAN to the switch as they can't talk directly to the router. The switch would the route packets between the two networks.

Hope that helps!

Hello

Usually the router would provide the routing, and the switch wouldn't have ip routing enabled but would have a trunk interface towards the router with a default-gateway of its management/vlan subnet ( in this case 192.168.1.2)

 

RTR

int fa0/0
no shut

int fa0/0.10
#encapsulation dot1Q 10
ip address 192.168.1.2 /24
 

 

ip route 0.0.0.0 0.0.0.0 x.x.x.x ( wan next hop)

 

Switch
int vlan 10
ip address 192.168.1.1 /24
no shut

no ip routing
ip default-gateway 192.168.1.2
 

vlan 10
exit

int x/x
description Link to RTR
switchport trunk encap dot
switchport mode trunk
no shut

int x/x
description Link to PC
switchport host
switchport access vlan 10
no shut

 

res

Paul

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul
Review Cisco Networking for a $25 gift card