06-29-2014 11:59 PM - edited 03-07-2019 07:51 PM
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.
Solved! Go to Solution.
06-30-2014 01:21 AM
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!
06-30-2014 01:21 AM
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!
06-30-2014 01:49 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide