[Network] Add/Delete Static Route in Windows Routing Table & TraceRoute an IP
Adding Static Route in Routing Table
Syntax of adding static route to routing table in cmd:route add -p destination_IP MASK subnet_mask gateway_ip metric_cost(optional)
- If you don't have a specific subnet_mask, then use 255.255.255.255.
- metric_cost is a cost relative to other costs in the routing table. Windows decides which route to take based on the metric_cost.
- Remember to trace route the destination_IP (explained later) after adding a static route to confirm the static route is working (that it does indeed go through your gateway_IP to reach your destination_IP).
Removing Static Route in Routing Table
Syntax of removing static route to routing table in cmd:route delete destination_IP
Print Route
To print your routing table, run this in cmd:
route printFor example, before you added any static route, in your 'route print' you will see none under persistent routes:
After you are done adding a static route, it'll look like this:
TraceRoute
Normally, when you enter an IP (or simply entering a URL into the browser), you don't directly get to the destination IP; there are some route, or intermediaries. For example, you will go to your local router, your internet service provider's router, onto larger networks and so on... then reaching your destination ip.TraceRoute helps with visualization of network traffic for your request to reach the destination IP. It also displays the delay at each route. If you are having issues with connecting to a certain IP, tracing the route to get there could help you identify the source of your connectivity problem.
How to use TraceRoute
Syntax of traceroute in cmd:tracert destination_IP
Understanding the Output
The format of each line is as follows:Hop RTT1 RTT2 RTT3 Domain_Name [IP Address]
- Hop:
- Whenever a packet is passed between a router, that is referred as a 'hop'. For example, it might take 14 hops to reach google.com.
- RTT1, RTT2, RTT3:
- round-trip time (in milliseconds) it takes for a package to get to a hop and back to your computer
- Often referred to as "Latency"; same number you get when using ping.
- Traceroute sends 3 packets to each hop, and displays each time; this way, you can see how consistent the latency is.
- If not all 3 packets have latency, then there could be some packet loss.
- Domain Name [IP Address]:
- The location of the router. If this is not available, only the IP will be displayed.
Usage Example:
Goal: When we access 10.20.30.40, we want it to go through 198.99.88.77.- Open cmd
- Enter: tracert 10.20.30.40
- Check response to see if it does go through 198.99.88.77. If it doesn't, it still okay - we just won't have a comparison that it worked/not worked later on.
- Enter: route ADD -p 10.20.30.40 MASK 255.255.255.255 198.99.88.77
- Enter: tracert 10.20.30.40
- Check the response to see if it does go through 198.99.88.77
Source:
https://www.howtogeek.com/howto/windows/adding-a-tcpip-route-to-the-windows-routing-table/https://www.howtogeek.com/134132/how-to-use-traceroute-to-identify-network-problems/
Comments
Post a Comment