[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 432
  • Last Modified:

Static Route

Hi,

1) I saw a static route like this:

C:\> route -p add 10.10.10.0 mask 255.255.255.0 192.168.1.1

2) I am still confused and need confirmation from experts

3) Per my understanding
- 10.10.10.0 mask 255.255.255.0 is 10.10.10.1/24 subnet

4) So the purpose of the above static route is to let the subnet of 10.10.10.1/24 going through the Gateway (192.168.1.1)

5) My question: Is the understanding correct or wrong? any explanation please

thanks,
tjie
0
tjie
Asked:
tjie
1 Solution
 
ffleismaCommented:
static route is defined as follows:

source --- mask --- destination

so with your example above, you got it in reverse.

destination to 10.10.10/24 subnet is reachable towards gateway 192.168.1.1

this just simply means that when the router receives a packet destined towards the 10.10.10.0/24 subnet, it will forward it to 192.168.1.1

makes sense? let me know how i could help you further...
0
 
Fred MarshallCommented:
I don't see that you have anything in reverse.  It may be a bit hard to tell.

"route -p add 10.10.10.0 mask 255.255.255.0 192.168.1.1"

Is translated as follows:

"Add a persistent route (one that will survive a reboot)
TO the subnet 10.10.10.0 with subnet mask 255.255.255.0 OR /24 (the latter two mean the same thing).
VIA the device with IP address of 192.168.1.1 as the Gateway for this targeted subnet.

I would rephrase your #4 to:
"Send packets destined for the subnet 10.10.10.0/24 through the 192.168.1.1 as the gateway to that subnet."

Note that I changed your 10.10.10.1 to 10.10.10.0 as the network address for the subnet.    Otherwise you may get a route for only the one IP address of 10.10.10.1 instead of the subnet 10.10.10.0/24.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now