{"id":361,"date":"2011-04-05T14:58:02","date_gmt":"2011-04-05T20:58:02","guid":{"rendered":"https:\/\/www.ppsstudios.com\/blog\/?p=361"},"modified":"2018-08-07T11:17:06","modified_gmt":"2018-08-07T17:17:06","slug":"preventing-constant-reboots-on-network","status":"publish","type":"post","link":"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/","title":{"rendered":"Preventing Constant Reboots on a Network"},"content":{"rendered":"<p>For some weird reason, I found that my router (Netgear WNR3500L) (or my connection) was giving me problems&#8230;every so often it my LAN connection would completely reset and require me to reboot the computer, just to get the webserver back online (it would become completely unreachable via No-IP DNS -and- the external IP address..some 5xx connection reset error or something).<\/p>\n<p><!--more--><\/p>\n<p>Recently I found that the problem was my router. The DHCP server built into it has a set lease time of what my connection says is 24 hours, although it only lasts about 12. I found a workable solution, yet it was rather annoying. I set up my Telnet server to automatically shut down every 12 hours, as well as the client that was accessing it. On top of that, I used Windows Scheduler to run reboot.cmd a minute after the server was shut down, and then used TweakUI to automatically log me back in, plus another command-line script that would autolock the computer after logging in. This way all the applications would be preloaded, but the computer would still be secured.<\/p>\n<p>Got all that?<\/p>\n<ol>\n<li>Telnet shutdown<\/li>\n<li>Telnet client shutdown<\/li>\n<li>Computer shutdown and reboot<\/li>\n<li>Autologin (starting all the servers up again)<\/li>\n<li>Autolock<\/li>\n<li>DHCP is renewed, the connection is reset, and 100% accessible over the web.<\/li>\n<\/ol>\n<p>The Telnet server is called PennMUSH, which is a Multi-User RPG engine which uses the common MUSHCode language to program.<\/p>\n<p>For archival purposes, here&#8217;s the detailed setup:<\/p>\n<h3>PennMUSH:<\/h3>\n<pre class=\"wrap:true lang:default highlight:0 decode:true\">@@\r\n\r\n@listen Shutdown Machine = ^-*: @switch [or([strmatch(%0,00)],[strmatch(%0,12)])] = 1,{@wizwall Shutting down.;@dump;@wait 30=@shutdown};@@ * is passed from the clock hourly as timefmt($H) &lt;= The 24-hour hour code.<\/pre>\n<h3>MUSHClient:<\/h3>\n<pre class=\"lang:xhtml decode:true\">\r\n\r\nDoCommand Save(\"\")\r\nDoCommand Exit(\"\")\r\n\r\n\r\n\r\nDoCommand Save(\"\")\r\nDoCommand Exit(\"\")\r\n\r\n\r\n\r\n<\/pre>\n<h3>reboot.cmd:<\/h3>\n<pre class=\"lang:batch decode:true \">@echo off\r\necho Shutting down\r\nshutdown.exe -f -r -t 30<\/pre>\n<h3>autolock.cmd:<\/h3>\n<pre class=\"lang:batch decode:true \">@echo off\r\necho Locking computer\r\nrundll32.exe user32.dll, LockWorkStation<\/pre>\n<h3>Scheduled Tasks:<\/h3>\n<p>Add one task to run reboot.cmd. Copy the event within the single task and schedule them to run at 12:02 am and 12:02 pm.<\/p>\n<p>Complicated enough? I figured out a MUCH easier solution<\/p>\n<pre class=\"wrap:true lang:default highlight:0 decode:true\">Ctrl Panel &gt; Network Connections &gt; Local Area Connection &gt; Internet Protocol (TCP\/IP) &gt; IP Address: 192.168.0.2, Subnet: 255.255.255.0, Gateway: 192.168.0.1, DNS: 192.168.0.1<\/pre>\n<p>In essence, setting a static IP behind the router turned of the DHCP lease time for this connection. I had to do a bit of tweaking in the router config, like releasing the reserved IP for both the laptop (which was using 161.0.0.2) and the server computer (which was using 161.0.0.3) and reserve the first to the server computer based on its MAC. This way the router won&#8217;t try to assign my manually-entered IP address to another computer and cause an IP conflict error (which can happen).<\/p>\n<p>I&#8217;ve now had the server on for a day and a half (turning off all of this automatic shutdown-reboot stuff) and everything has continued to run with success!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For some weird reason, I found that my router (Netgear WNR3500L) (or my connection) was giving me problems&#8230;every so often it my LAN connection would completely reset and require me to reboot the computer, just to get the webserver back online (it would become completely unreachable via No-IP DNS -and- the external IP address..some 5xx [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,121],"tags":[339,344,221,97,335,345,346,80,347,214],"class_list":["post-361","post","type-post","status-publish","format-standard","hentry","category-programming","category-web","tag-dsl","tag-mush","tag-pennmush","tag-programming","tag-router","tag-shutdown","tag-telnet","tag-tutorial","tag-webserver","tag-windows"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Preventing Constant Reboots on a Network - PPSStudios<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Preventing Constant Reboots on a Network - PPSStudios\" \/>\n<meta property=\"og:description\" content=\"For some weird reason, I found that my router (Netgear WNR3500L) (or my connection) was giving me problems&#8230;every so often it my LAN connection would completely reset and require me to reboot the computer, just to get the webserver back online (it would become completely unreachable via No-IP DNS -and- the external IP address..some 5xx [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/\" \/>\n<meta property=\"og:site_name\" content=\"PPSStudios\" \/>\n<meta property=\"article:published_time\" content=\"2011-04-05T20:58:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-08-07T17:17:06+00:00\" \/>\n<meta name=\"author\" content=\"Daniel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/\"},\"author\":{\"name\":\"Daniel\",\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888\"},\"headline\":\"Preventing Constant Reboots on a Network\",\"datePublished\":\"2011-04-05T20:58:02+00:00\",\"dateModified\":\"2018-08-07T17:17:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/\"},\"wordCount\":404,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888\"},\"keywords\":[\"dsl\",\"mush\",\"pennmush\",\"programming\",\"router\",\"shutdown\",\"telnet\",\"Tutorial\",\"webserver\",\"windows\"],\"articleSection\":[\"Programming\",\"Web\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/\",\"url\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/\",\"name\":\"Preventing Constant Reboots on a Network - PPSStudios\",\"isPartOf\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#website\"},\"datePublished\":\"2011-04-05T20:58:02+00:00\",\"dateModified\":\"2018-08-07T17:17:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.ppsstudios.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Preventing Constant Reboots on a Network\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#website\",\"url\":\"https:\/\/www.ppsstudios.com\/blog\/\",\"name\":\"PPSStudios\",\"description\":\"Formerly \u10d3\u10d0\u10dc\u10d8\u10d4\u10da\u10d8 \u10de\u10d0\u10d5\u10da\u10d8\u10d0\u10e8\u10d5\u10d8\u10da\u10d8\",\"publisher\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ppsstudios.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888\",\"name\":\"Daniel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3a47193e75f82b6ce5dc02478226e41676f8c8cfbb40d962f0ddff8d18e9e3e1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3a47193e75f82b6ce5dc02478226e41676f8c8cfbb40d962f0ddff8d18e9e3e1?s=96&d=mm&r=g\",\"caption\":\"Daniel\"},\"logo\":{\"@id\":\"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/www.ppsstudios.com\"],\"url\":\"https:\/\/www.ppsstudios.com\/blog\/author\/danipavliashvili\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Preventing Constant Reboots on a Network - PPSStudios","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/","og_locale":"en_US","og_type":"article","og_title":"Preventing Constant Reboots on a Network - PPSStudios","og_description":"For some weird reason, I found that my router (Netgear WNR3500L) (or my connection) was giving me problems&#8230;every so often it my LAN connection would completely reset and require me to reboot the computer, just to get the webserver back online (it would become completely unreachable via No-IP DNS -and- the external IP address..some 5xx [&hellip;]","og_url":"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/","og_site_name":"PPSStudios","article_published_time":"2011-04-05T20:58:02+00:00","article_modified_time":"2018-08-07T17:17:06+00:00","author":"Daniel","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Daniel","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/#article","isPartOf":{"@id":"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/"},"author":{"name":"Daniel","@id":"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888"},"headline":"Preventing Constant Reboots on a Network","datePublished":"2011-04-05T20:58:02+00:00","dateModified":"2018-08-07T17:17:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/"},"wordCount":404,"commentCount":0,"publisher":{"@id":"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888"},"keywords":["dsl","mush","pennmush","programming","router","shutdown","telnet","Tutorial","webserver","windows"],"articleSection":["Programming","Web"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/","url":"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/","name":"Preventing Constant Reboots on a Network - PPSStudios","isPartOf":{"@id":"https:\/\/www.ppsstudios.com\/blog\/#website"},"datePublished":"2011-04-05T20:58:02+00:00","dateModified":"2018-08-07T17:17:06+00:00","breadcrumb":{"@id":"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.ppsstudios.com\/blog\/2011\/04\/preventing-constant-reboots-on-network\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.ppsstudios.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Preventing Constant Reboots on a Network"}]},{"@type":"WebSite","@id":"https:\/\/www.ppsstudios.com\/blog\/#website","url":"https:\/\/www.ppsstudios.com\/blog\/","name":"PPSStudios","description":"Formerly \u10d3\u10d0\u10dc\u10d8\u10d4\u10da\u10d8 \u10de\u10d0\u10d5\u10da\u10d8\u10d0\u10e8\u10d5\u10d8\u10da\u10d8","publisher":{"@id":"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ppsstudios.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/cb11d96049a08f0853830238a95f2888","name":"Daniel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3a47193e75f82b6ce5dc02478226e41676f8c8cfbb40d962f0ddff8d18e9e3e1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3a47193e75f82b6ce5dc02478226e41676f8c8cfbb40d962f0ddff8d18e9e3e1?s=96&d=mm&r=g","caption":"Daniel"},"logo":{"@id":"https:\/\/www.ppsstudios.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/www.ppsstudios.com"],"url":"https:\/\/www.ppsstudios.com\/blog\/author\/danipavliashvili\/"}]}},"_links":{"self":[{"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/posts\/361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/comments?post=361"}],"version-history":[{"count":12,"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/posts\/361\/revisions"}],"predecessor-version":[{"id":581,"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/posts\/361\/revisions\/581"}],"wp:attachment":[{"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/media?parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/categories?post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ppsstudios.com\/blog\/wp-json\/wp\/v2\/tags?post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}