{"id":6197,"date":"2026-09-11T22:19:08","date_gmt":"2026-09-11T13:19:08","guid":{"rendered":"https:\/\/eternalsphere.net\/echoes\/?p=6197"},"modified":"2026-09-12T17:18:01","modified_gmt":"2026-09-12T08:18:01","slug":"gm5wfx60i148xy7","status":"publish","type":"post","link":"https:\/\/blog.eternalsphere.net\/index.php\/2026\/09\/11\/gm5wfx60i148xy7\/","title":{"rendered":"Change Your Public IP on OpenWrt Without Rebooting the Router"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When OpenWrt is used as a home router, there are situations where changing the public IP address can be useful:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a website suddenly becomes inaccessible;<\/li>\n\n\n\n<li>a service temporarily restricts the current public IP;<\/li>\n\n\n\n<li>you want to refresh your public IPv4 address;<\/li>\n\n\n\n<li>you do not want to reboot the router or interrupt the local network and Wi-Fi.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If the WAN uses a dynamic public IP, especially through <strong>PPPoE<\/strong>, there is usually no need to reboot the entire OpenWrt device. Reconnecting only the WAN interface may be enough to obtain a new public IP.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Check the WAN Protocol First<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After connecting to OpenWrt over SSH, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>uci get network.wan.proto\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Common results include:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pppoe\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dhcp\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the result is <code>pppoe<\/code>, the Internet connection is established through PPPoE dialing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the result is <code>dhcp<\/code>, the WAN address is normally assigned by an upstream DHCP server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This article mainly focuses on PPPoE.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Check the Current WAN Status<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifstatus wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A typical result may contain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"up\": true,\n    \"l3_device\": \"pppoe-wan\",\n    \"proto\": \"pppoe\",\n    \"ipv4-address\": &#091;\n        {\n            \"address\": \"&lt;PUBLIC-IP&gt;\",\n            \"mask\": 32\n        }\n    ]\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The important fields are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>up: true<\/code> means the WAN connection is active;<\/li>\n\n\n\n<li><code>proto: pppoe<\/code> means PPPoE is being used;<\/li>\n\n\n\n<li><code>l3_device: pppoe-wan<\/code> is the logical interface created by PPPoE;<\/li>\n\n\n\n<li><code>&lt;PUBLIC-IP&gt;<\/code> is the current public IPv4 address.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">You can also verify the public IP using an external IP-check service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -qO- https:\/\/api.ipify.org\necho\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The result can be used as the baseline before reconnecting the WAN.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Make Sure SSH Is Connected Through the LAN<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before disconnecting the WAN, it is a good idea to confirm that the current SSH session is not using the public Internet connection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"$SSH_CONNECTION\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A LAN-based session may look like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;LAN-CLIENT-IP&gt; &lt;PORT&gt; &lt;ROUTER-LAN-IP&gt; 22\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If both addresses belong to your private local network, the SSH session is using the LAN.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In that case, disconnecting the WAN should not terminate the SSH session.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are remotely connected through the router&#8217;s public IP, do not disconnect the WAN unless you are prepared to lose the SSH connection immediately.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reconnect the WAN Without Rebooting OpenWrt<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For PPPoE, the simplest method is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifdown wan\nsleep 10\nifup wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The commands are straightforward.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifdown wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">disconnects the current WAN session.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sleep 10\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">waits briefly so that the previous PPPoE session has time to close.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifup wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">starts a new WAN connection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This does not reboot OpenWrt and does not restart the entire network stack.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The LAN bridge, Wi-Fi, local DHCP server, and other local services normally continue running.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Check the New Public IP<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After reconnecting the WAN, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -qO- https:\/\/api.ipify.org\necho\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the result has changed, for example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Old address:\n&lt;PUBLIC-IP-A&gt;\n\nNew address:\n&lt;PUBLIC-IP-B&gt;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">then the public IP has successfully changed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also check the WAN status again:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifstatus wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the result shows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"up\": true\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and the WAN uptime is very short, the new PPPoE session has been established successfully.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why This Is Better Than Rebooting the Router<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A common way to obtain a new public IP is simply:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>reboot\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This may work, but it restarts far more than necessary.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A full reboot may temporarily interrupt:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Wi-Fi;<\/li>\n\n\n\n<li>LAN connectivity;<\/li>\n\n\n\n<li>DHCP;<\/li>\n\n\n\n<li>DNS;<\/li>\n\n\n\n<li>firewall services;<\/li>\n\n\n\n<li>local applications;<\/li>\n\n\n\n<li>VPN connections;<\/li>\n\n\n\n<li>containers;<\/li>\n\n\n\n<li>USB devices;<\/li>\n\n\n\n<li>other services running on OpenWrt.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If the only goal is to refresh the public IP address, reconnecting only the WAN is a much cleaner approach:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifdown wan\nsleep 10\nifup wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The general principle is simple:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Restart only the component that actually needs to be restarted.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Why Reconnecting PPPoE May Produce a New IP<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">With PPPoE, the public IP is often associated with the current PPPoE session.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifdown wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">is executed, the active PPPoE session ends.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifup wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">is executed, OpenWrt establishes a new PPPoE session.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The ISP may then:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>assign the same public IP again;<\/li>\n\n\n\n<li>assign another address from its dynamic address pool.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The exact behavior depends entirely on the ISP&#8217;s address allocation policy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For this reason, reconnecting PPPoE does not guarantee that the public IP will always change.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, if testing shows that a new PPPoE session frequently receives a different address, this method can effectively replace a full router reboot.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What If the IP Does Not Change?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the new session receives the same address, it does not necessarily mean that OpenWrt failed to reconnect.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The ISP may simply have assigned the same IP again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can try increasing the disconnected period:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifdown wan\nsleep 30\nifup wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifdown wan\nsleep 60\nifup wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Whether this helps still depends on the ISP&#8217;s allocation system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is generally not worth modifying unrelated network parameters simply to force a different IP address.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Avoid Restarting the Entire Network Service<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Some guides recommend:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service network restart\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/init.d\/network restart\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For the specific purpose of refreshing the public IP, this is usually unnecessary.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Those commands can affect much more than:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifdown wan\nifup wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Depending on the configuration, they may restart:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>LAN;<\/li>\n\n\n\n<li>WAN;<\/li>\n\n\n\n<li>VLANs;<\/li>\n\n\n\n<li>bridges;<\/li>\n\n\n\n<li>VPN interfaces;<\/li>\n\n\n\n<li>other logical network interfaces.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Unless the entire network configuration has changed, restarting only the WAN is preferable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A Practical Public-IP Refresh Command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For an OpenWrt system already confirmed to use PPPoE, and where reconnecting PPPoE is known to produce a new address, the practical command is simply:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifdown wan\nsleep 10\nifup wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then verify the result:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -qO- https:\/\/api.ipify.org\necho\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To display the address before and after reconnection:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"Old IP:\"\nwget -qO- https:\/\/api.ipify.org\necho\n\nifdown wan\nsleep 10\nifup wan\nsleep 10\n\necho \"New IP:\"\nwget -qO- https:\/\/api.ipify.org\necho\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Things to Check After Changing the Public IP<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If services are exposed to the Internet from the home network, a public-IP change may affect them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">DDNS<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If Dynamic DNS is in use, confirm that the DDNS client detected the IP change and updated the DNS record.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This usually happens automatically, but there may be a short delay.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Remote Access<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Any remote service that directly depends on the old public IP will stop working through that address.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Examples include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SSH;<\/li>\n\n\n\n<li>VPN services;<\/li>\n\n\n\n<li>self-hosted applications;<\/li>\n\n\n\n<li>other forwarded services.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For regular remote access, DDNS is generally more convenient than relying on a fixed numeric IP.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Existing Internet Connections<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When the WAN reconnects and the public IP changes, existing NAT and connection-tracking entries are no longer valid for the new connection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Active Internet sessions may therefore disconnect, including:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>downloads;<\/li>\n\n\n\n<li>SSH sessions over the WAN;<\/li>\n\n\n\n<li>games;<\/li>\n\n\n\n<li>video streams;<\/li>\n\n\n\n<li>long-lived TCP connections.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Applications normally recover after reconnecting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using an IP Change to Diagnose Reputation Problems<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Changing the public IP can also be useful as a diagnostic method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Consider this pattern:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Most websites work normally\n\u2193\nOne particular website is inaccessible\n\u2193\nDNS works\n\u2193\nGeneral Internet connectivity is normal\n\u2193\nChanging the public IP immediately fixes the problem\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In such a case, the problem may not be caused by:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the browser;<\/li>\n\n\n\n<li>OpenWrt;<\/li>\n\n\n\n<li>DNS;<\/li>\n\n\n\n<li>NAT;<\/li>\n\n\n\n<li>the firewall.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Instead, the previous public IP may have been affected by:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>website risk-control systems;<\/li>\n\n\n\n<li>anti-abuse systems;<\/li>\n\n\n\n<li>IP reputation databases;<\/li>\n\n\n\n<li>temporary access restrictions.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For this reason, refreshing the public IP can be a useful troubleshooting technique when only specific websites or services are affected.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If OpenWrt uses PPPoE and the ISP provides dynamic public IPv4 addresses, changing the public IP usually does not require rebooting the router.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The minimal operation is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifdown wan\nsleep 10\nifup wan\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then verify the result:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget -qO- https:\/\/api.ipify.org\necho\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Compared with rebooting the entire router, this method is:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>faster;<\/li>\n\n\n\n<li>less disruptive;<\/li>\n\n\n\n<li>less likely to affect the LAN;<\/li>\n\n\n\n<li>less likely to interrupt Wi-Fi;<\/li>\n\n\n\n<li>unnecessary to reboot OpenWrt itself;<\/li>\n\n\n\n<li>useful as a diagnostic tool for public-IP-related access problems.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For networks where PPPoE reconnection has already been verified to produce a new public address, this is one of the cleanest and most efficient ways to refresh the public IP.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When OpenWrt is used as a home router, there are situations where changing the public IP address can be useful: If the WAN uses a dynamic public IP, especially through PPPoE, there is usually no need to reboot the entire OpenWrt device. Reconnecting only the WAN interface may be enough &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[120],"tags":[334],"class_list":["post-6197","post","type-post","status-publish","format-standard","hentry","category-1s3b6h7r2zay02x","tag-routers"],"_links":{"self":[{"href":"https:\/\/blog.eternalsphere.net\/index.php\/wp-json\/wp\/v2\/posts\/6197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.eternalsphere.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.eternalsphere.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.eternalsphere.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.eternalsphere.net\/index.php\/wp-json\/wp\/v2\/comments?post=6197"}],"version-history":[{"count":1,"href":"https:\/\/blog.eternalsphere.net\/index.php\/wp-json\/wp\/v2\/posts\/6197\/revisions"}],"predecessor-version":[{"id":6198,"href":"https:\/\/blog.eternalsphere.net\/index.php\/wp-json\/wp\/v2\/posts\/6197\/revisions\/6198"}],"wp:attachment":[{"href":"https:\/\/blog.eternalsphere.net\/index.php\/wp-json\/wp\/v2\/media?parent=6197"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.eternalsphere.net\/index.php\/wp-json\/wp\/v2\/categories?post=6197"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.eternalsphere.net\/index.php\/wp-json\/wp\/v2\/tags?post=6197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}