{"id":213,"date":"2023-03-25T09:52:53","date_gmt":"2023-03-25T09:52:53","guid":{"rendered":"https:\/\/faq.powervps.ru\/?p=213"},"modified":"2023-04-05T08:36:12","modified_gmt":"2023-04-05T08:36:12","slug":"routing-for-servers-on-the-same-subnet","status":"publish","type":"post","link":"https:\/\/faq.powervps.ru\/?p=213","title":{"rendered":"Routing for servers on the same subnet"},"content":{"rendered":"<p>Routing for servers on the same subnet<\/p>\n<p>Both servers are connected to the same switch. If you need a connection between the<br \/>\nservers, you have to set a static route on each server (if using DHCP) or change their netmask to \/32 (if using static IP configuration).<br \/>\nThis is necessary as we use the &#8220;protected ports&#8221; security feature on our switches.<\/p>\n<p>Here is an example of how you can do that on linux:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;%&lt;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nip route add &lt;OTHER-IP&gt;\/32 via &lt;GATEWAY&gt; dev &lt;NETWORK-DEVICE&gt;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;%&lt;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Replace <code>&lt;OTHER-IP&gt;<\/code> with the IP address of the other server, <code>&lt;GATEWAY&gt;<\/code> with the gateway IP address of your network switch, and <code>&lt;NETWORK-DEVICE&gt;<\/code> with the name of the NIC that connects to the switch.<\/p>\n<p>On Windows:<\/p>\n<ol>\n<li>Identify the subnet IP address of the other server on the same subnet.<\/li>\n<li>Identify the netmask of your subnet.<\/li>\n<li>Identify the gateway IP address of your network switch.<\/li>\n<li>Run the following command to add a static route:<\/li>\n<\/ol>\n<p>route (-p to make it permanent) add [Subnet-IP] mask [netmask] [Gateway]<\/p>\n<p>Replace <code>[Subnet-IP]<\/code> with the subnet IP address of the other server, <code>[netmask]<\/code> with the netmask of your subnet, and <code>[Gateway]<\/code> with the gateway IP address of your network switch. Use the <code>-p<\/code> option to make the route permanent, so it persists after a reboot.<\/p>\n<p>Remember that setting static routes may impact the routing of network traffic, so make sure you fully understand the consequences before implementing them.<\/p>\n<p>&nbsp;<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;%&lt;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Routing for servers on the same subnet Both servers are connected to the same switch. If you need a connection between the servers, you have to set a static route on each server (if using DHCP) or change their netmask to \/32 (if using static IP configuration). This is necessary as we use the &#8220;protected [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[21],"class_list":["post-213","post","type-post","status-publish","format-standard","hentry","category-1","tag-routing-for-servers-on-the-same-subnet"],"_links":{"self":[{"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/posts\/213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=213"}],"version-history":[{"count":3,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":224,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=\/wp\/v2\/posts\/213\/revisions\/224"}],"wp:attachment":[{"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/faq.powervps.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}