Sign in with
Sign up | Sign in
Your question
Solved

Static Routes using Netsh or Switch?

Last response: in Networking
Share
April 29, 2011 7:40:40 PM

Hello,

So I have a setup on my Layer 3 switch as follows (SG300-52) SRW2048-K9-NA:

Router IP = 192.168.1.1
||
||
LAYER 3 SWITCH contains following VLANS:

VLAN1 IP = 192.168.1.4
Computer#1 IP = 192.168.1.8

VLAN2 IP = 192.168.2.1
Computer #2 IP = 192.168.2.2


I have read you can have the VLANs communicate with each other by adding static routes. If I want VLAN1 and VLAN2 communicate:

Should I add a static route via:
Netsh command in Command Prompt
Switch: Routing Table
Router: Routing Table

Are all the mentioned above do essentially the same thing, and is it just based on preferences?

Best solution

May 3, 2011 8:53:50 PM
Share

I'm not familiar with that particular switch... but in general, you need to enable routing on the switch first off. Then you'll need to assign an IP address to each VLAN (which you probably have done already). You won't need to add static routes for the VLANs since they're directly connected. Lastly, if you have anything on the other side of your router, y ou'll need to make a layer 3 port pointing to that interface. At that point you can assign a default route to send traffic to the router interface if it isn't destined for VLAN1 or 2.

Hope this helps!

Also, you could trunk the switch to the router and have the router do the routing but that kind of defeats the purpose of having a layer 3 switch. Adding routes to a workstations routing table won't help route packets once they reach the switch. The default gateway of each machine tells the packets where to go, then the switch or router takes it from there.
May 4, 2011 2:18:13 AM

Thanks mitchflossin,

Your answer helped clear up my confusion regarding static routes.

One last thing I had on my mind, so the port that is assigned an IP can be blank (no ethernet from switch to router needed)? It is essentially used as a Trunk port do inter-vlan communication? This can be implemented to allow each VLAN to have internet access correct without using all the port on the router?
Related resources
May 4, 2011 5:20:55 AM

I edited my original post as I misread what you were trying to do (just removed a step). Where is the internet coming in from? Is it on the other side of that router?

You only need one cable going from your router to your switch. Your switch is acting like a router by forwarding ports amongst VLANs including your gateway port (the port you have connecting your router and switch). By default (at least with Cisco) any VLANs you have created on a L3 switch will be able to communicate by default. You would need to explicitly tell them not to if that's not the behavior you wanted.
May 4, 2011 5:07:33 PM

Yes, the internet is supplied directly into the router, just like a home network is set up. It's good to know that I only need one ethernet cable from router to switch to supply all VLANS with internet access, assuming I set everything up correctly.

Thanks again for all your help, very much appreciate it.
May 4, 2011 5:07:50 PM

Best answer selected by invulnarable27.
May 4, 2011 6:51:19 PM

I'm very glad I could help you! Best of luck!
!