{"id":478120,"date":"2022-07-26T23:00:00","date_gmt":"2022-07-26T20:00:00","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-add-a-static-tcp-ip-route-to-the-windows-routing-table\/"},"modified":"2022-07-26T23:00:00","modified_gmt":"2022-07-26T20:00:00","slug":"how-to-add-a-static-tcp-ip-route-to-the-windows-routing-table","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-add-a-static-tcp-ip-route-to-the-windows-routing-table\/","title":{"rendered":"#How to Add a Static TCP\/IP Route to the Windows Routing Table"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a245df090004\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a245df090004\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-add-a-static-tcp-ip-route-to-the-windows-routing-table\/#%E2%80%9CHow_to_Add_a_Static_TCPIP_Route_to_the_Windows_Routing_Table%E2%80%9D\" >&#8220;How to Add a Static TCP\/IP Route to the Windows Routing Table&#8221;<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-add-a-static-tcp-ip-route-to-the-windows-routing-table\/#What_Are_Routing_Tables\" >What Are Routing Tables?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-add-a-static-tcp-ip-route-to-the-windows-routing-table\/#View_the_Windows_Routing_Table\" >View the Windows Routing Table<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-add-a-static-tcp-ip-route-to-the-windows-routing-table\/#Add_a_Static_Route_to_the_Windows_Routing_Table\" >Add a Static Route to the Windows Routing Table<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-add-a-static-tcp-ip-route-to-the-windows-routing-table\/#Remove_a_Static_Route_from_the_Windows_Routing_Table\" >Remove a Static Route from the Windows Routing Table<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E2%80%9CHow_to_Add_a_Static_TCPIP_Route_to_the_Windows_Routing_Table%E2%80%9D\"><\/span>&#8220;How to Add a Static TCP\/IP Route to the Windows Routing Table&#8221;<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<div>\n<!-- UNCACHED CONTENT --><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage alignnone size-full wp-image-819012\" data-pagespeed-no-defer=\"\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2017\/06\/Route-Table-Ugly-Header.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Route Table Header\" width=\"1200\" height=\"675\"\/><\/p>\n<p>In some specific types of environments, you might find it useful to add a static route to the routing table. Here\u2019s how to go about it in Windows 11, 10, 8, and 7.<\/p>\n<p><strong>RELATED:<\/strong> <strong><em>How to Use Traceroute to Identify Network Problems<\/em><\/strong><\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"What_Are_Routing_Tables\"><\/span>What Are Routing Tables?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A routing table dictates where all packets go when they leave a system \u2014 whether that system is a physical router or a PC. Most routers \u2014 including the one built into your Windows PC \u2014 use some form of dynamic routing, where the router is capable of selecting the best place to forward packets based on information it gets from other routers. You can see it at work if you use the traceroute command to watch the connections a packet makes as it reaches it\u2019s final destination.<\/p>\n<p>Most routers also allow you to add a static route (one that doesn\u2019t get dynamically updated) if you want to always forward certain traffic\u00a0to a specific router or gateway. Why? Well,\u00a0most people using Windows in their home or small business probably won\u2019t \u2014 but this can be useful under certain circumstances, such as:<\/p>\n<ul>\n<li>You have two internet connections \u2014 maybe one for regular use and one for connecting to a work network \u2014 and you want all traffic to a certain IP address range to go out over one of those connections.<\/li>\n<li>You have set up multiple subnets on your network and need to direct traffic to a particular subnet. Static routes can be particular useful in testing these types of environments.<\/li>\n<li>You\u2019re actually using a Windows PC as a router for your network and you want finer control over it.<\/li>\n<\/ul>\n<p>If any of those <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>ly to you, read on. You\u2019ll need to dive into the Command Prompt to add a static route to the Windows routing table, but it\u2019s easy and we\u2019ll walk you through the steps.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"View_the_Windows_Routing_Table\"><\/span>View the Windows Routing Table<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before you get started adding routes, it may be helpful to view the routing table first. Fire up Command Prompt by hitting Windows+X and then selecting \u201cCommand Prompt (Admin)\u201d on the Power Users menu.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-285397\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2016\/12\/asr_1-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Run Command Prompt as an Administrator through the Poweruser Menu. \" width=\"256\" height=\"579\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<blockquote class=\"admonishment_note\"><p><strong>Note:<\/strong> If you see PowerShell instead of Command Prompt on the Power Users menu, that\u2019s a switch that came about with the Creators Update for Windows 10. It\u2019s very easy to switch back to showing the Command Prompt on the Power Users menu if you want, or you can give PowerShell a try. You can do pretty much everything in PowerShell that you can do in Command Prompt, plus a lot of other useful things.<\/p><\/blockquote>\n<p><strong>RELATED:<\/strong> <strong><em>How to Put the Command Prompt Back on the Windows+X Power Users Menu<\/em><\/strong><\/p>\n<p>At the Command Prompt, type the following command and hit Enter:<\/p>\n<pre>route print<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-285396\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2016\/12\/asr_1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"&quot;Route print&quot; will display a list of network destinations. \" width=\"648\" height=\"452\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>You\u2019ll see a long list of network destinations and the gateways to which packets are forwarded when they are headed to that destination. Unless you\u2019ve already added static routes to the table, everything you see here will be dynamically generated.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Add_a_Static_Route_to_the_Windows_Routing_Table\"><\/span>Add a Static Route to the Windows Routing Table<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To add a static route to the table, you\u2019ll type a command using the following syntax:<\/p>\n<pre>route ADD <em>destination_network<\/em> MASK <em>subnet_mask<\/em>\u00a0 <em>gateway_ip metric_cost<\/em><\/pre>\n<p>The <code>subnet_mask\u00a0<\/code>and <code>metric_cost<\/code> components are optional to the command. If you don\u2019t specify a subnet mask, 255.255.255.0 will be used automatically. If you don\u2019t specify a metric cost, a cost one greater than the 0.0.0.0 destination entry will be used. The metric cost value is just a cost that is relative to other costs in the table and is used when Windows decides between multiple routes that could reach the same destination.<\/p>\n<p>So, for example, if you wanted to add a route specifying that all traffic bound for the 192.168.35.0 subnet went to a gateway at 192.168.0.2 and you just wanted to use the automatic metric cost, you would use the following command:<\/p>\n<pre>route ADD 192.168.35.0 MASK 255.255.255.0 192.168.0.2<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-285402\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2016\/12\/asr_3.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"&quot;Route add&quot; adds a static route to your Routing Table. \" width=\"648\" height=\"173\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you were to use the <code>route print<\/code> command to look at the table now, you\u2019d see your new static route.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-285403\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2016\/12\/asr_4.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Type &quot;route print&quot; into the Command Prompt again and confirm that your addition is present. \" width=\"610\" height=\"83\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>That\u2019s all easy enough, but there is one extra little catch. When you add a static route, by default it only lasts until the next time you start Windows. The reason for this is that many companies use a coordinated list of static routes that gets updated fairly often. Rather than adding and updating all those routes on every machine, they just distribute a batch script file that adds the newest routes during Windows startup. This keeps the routing table relatively uncluttered.<\/p>\n<p><strong>RELATED:<\/strong> <strong><em>How to Write a Batch Script on Windows<\/em><\/strong><\/p>\n<p>You could certainly use the batch script method yourself. Writing batch scripts isn\u2019t hard. But if you\u2019re just adding one or two static routes that you don\u2019t expect to change often, you can instead just add the <code>-p<\/code> option to the command to make the route persistent. A persistent route stays in place even when Windows starts up. Using the same command we used earlier, you could make that route persistent with the following modification:<\/p>\n<pre>route -p\u00a0ADD 192.168.35.0 MASK 255.255.255.0 192.168.0.2<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-285404\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2016\/12\/asr_5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Adding &quot;-p&quot; to the command will make the addition persistent between restarts. \" width=\"647\" height=\"177\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Remove_a_Static_Route_from_the_Windows_Routing_Table\"><\/span>Remove a Static Route from the Windows Routing Table<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Of course, there will come a time you might want to remove a static route from your table. All you have to do is type a command using the following syntax:<\/p>\n<pre>route delete <em>destination_network<\/em><\/pre>\n<p>So, to delete the route we created earlier with the destination network 192.168.35.0, all we\u2019d have to do is type this command and hit Enter:<\/p>\n<pre>route delete 192.168.35.0<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-285405\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2016\/12\/asr_6.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Type &quot;route delete&quot; to delete a static route you've added. \" width=\"647\" height=\"176\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<hr\/>\n<p>Yes, using static routes is a bit esoteric when it comes to managing most home and small business networks. But if you do need to do it, it\u2019s a pretty easy process. And if you don\u2019t need to do it right now, at least you know it\u2019s an option in the future.<\/p>\n<\/div>\n<p><script>\n setTimeout(function(){\n  !function(f,b,e,v,n,t,s)\n  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n  n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n  n.queue=[];t=b.createElement(e);t.async=!0;\n  t.src=v;s=b.getElementsByTagName(e)[0];\n  s.parentNode.insertBefore(t,s) } (window, document,'script',\n  'https:\/\/connect.facebook.net\/en_US\/fbevents.js');\n   fbq('init', '335401813750447');\n   fbq('track', 'PageView');\n  },3000);\n<\/script><\/p>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.howtogeek.com\/howto\/windows\/adding-a-tcpip-route-to-the-windows-routing-table\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;How to Add a Static TCP\/IP Route to the Windows Routing Table&#8221; In some specific types of environments, you might find it useful to add a static route to the routing table. Here\u2019s how to go about it in Windows 11, 10, 8, and 7. RELATED: How to Use Traceroute to Identify Network Problems What&#8230;<\/p>\n","protected":false},"author":1,"featured_media":478121,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2017\/06\/Route-Table-Ugly-Header.png?height=200p&trim=2,2,2,2","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-478120","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/478120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=478120"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/478120\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/478121"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=478120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=478120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=478120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}