{"id":1370,"date":"2011-09-16T08:42:05","date_gmt":"2011-09-16T00:42:05","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=1370"},"modified":"2023-06-27T07:12:22","modified_gmt":"2023-06-27T07:12:22","slug":"how-to-change-the-default-route-or-gateway-on-solaris","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-change-the-default-route-or-gateway-on-solaris\/","title":{"rendered":"How to Change The Default Route or Gateway on Solaris"},"content":{"rendered":"<p>Changing the default gateway on a Solaris server is a straightforward process that can be accomplished without causing any network interruptions. By editing the \/etc\/defaultrouter file and using the &#8216;route delete default&#8217; and &#8216;route add default&#8217; commands, you can change the default gateway immediately and ensure that the changes persist after a system reboot.<\/p>\n<p>In this guide, we will walk you through the process of changing the default gateway on a Solaris server. This configuration change can be implemented immediately without requiring a system reboot, and it will persist after the next reboot. This approach is highly recommended as it prevents any network interruptions.<\/p>\n<h2>Step-by-Step Guide to Changing the Default Gateway on Solaris<\/h2>\n<h3>Step 1: Edit \/etc\/defaultrouter<\/h3>\n<p>The first step involves editing the \/etc\/defaultrouter file. The changes made to this file will take effect after the next system reboot.<\/p>\n<pre>\r\n[root@SolarisServer ~]# vi \/etc\/defaultrouter\r\n192.168.2.1\r\n<\/pre>\n<p>You will need to replace the existing IP address with the new IP address of your preferred gateway and save the changes.<\/p>\n<h3>Step 2: Update the Default Route<\/h3>\n<p>The next step is to run specific commands that will delete the existing default route and add a new one. This will implement the configuration changes immediately. For instance, if the existing gateway is 192.168.1.1 and you want to change it to 172.19.1.1, you would use the following commands:<\/p>\n<pre>\r\n[root@SolarisServer ~]# route delete default 172.19.1.1\r\n[root@SolarisServer ~]# route add default 172.19.1.1\r\n<\/pre>\n<h2>Commands Mentioned<\/h2>\n<ul>\n<li><span class=\"fw-bold\">vi \/etc\/defaultrouter<\/span> \u2013 This command is used to edit the \/etc\/defaultrouter file where you can set the IP address of your preferred gateway.<\/li>\n<li><span class=\"fw-bold\">route delete default [ip_address]<\/span> \u2013 This command is used to delete the existing default route.<\/li>\n<li><span class=\"fw-bold\">route add default [ip_address]<\/span> \u2013 This command is used to add a new default route.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>In this guide, we will walk you through the process of changing the default gateway on a Solaris server. This configuration change can be implemented immediately without requiring a system reboot, and it will persist after the next reboot. This approach is highly recommended as it prevents any network interruptions.<\/p>\n<h2>Frequently Asked Questions<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What is the purpose of the \/etc\/defaultrouter file in Solaris?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The \/etc\/defaultrouter file in Solaris is used to specify the IP address of the default gateway. This file is read at system startup, and the IP address found in this file is set as the default gateway for the system.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What does the &#8216;route delete default&#8217; command do?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The &#8216;route delete default&#8217; command is used to remove the existing default route from the system. This is typically done when you want to change the default gateway to a new IP address.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">What does the &#8216;route add default&#8217; command do?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">The &#8216;route add default&#8217; command is used to add a new default route to the system. This command is typically used after the &#8216;route delete default&#8217; command to set a new default gateway.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">Do I need to reboot the Solaris server for the changes to take effect?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">No, you do not need to reboot the server. The changes will take effect immediately after running the &#8216;route delete default&#8217; and &#8216;route add default&#8217; commands. However, the changes made to the \/etc\/defaultrouter file will only apply after the next system reboot.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<p class=\"fw-bold\" itemprop=\"name\">Can I use these commands on other Unix-like systems?<\/p>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Yes, the &#8216;route add default&#8217; and &#8216;route delete default&#8217; commands are standard Unix commands and can be used on other Unix-like systems. However, the location and usage of the defaultrouter file may vary depending on the specific Unix-like system.<\/span>\n            <\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Changing the default gateway on a Solaris server is a straightforward process that can be accomplished without causing any network interruptions. By editing the \/etc\/defaultrouter file and using the &#8216;route&#8230;<\/p>\n","protected":false},"author":6,"featured_media":1371,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[1039],"tags":[1790,1868],"class_list":["post-1370","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-route","tag-solaris","tag-unix"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/1370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=1370"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/1370\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/1371"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=1370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=1370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=1370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}