{"id":382,"date":"2025-04-09T01:36:26","date_gmt":"2025-04-08T17:36:26","guid":{"rendered":"https:\/\/00af.com\/?p=382"},"modified":"2025-11-04T00:27:15","modified_gmt":"2025-11-03T16:27:15","slug":"openwrt%e6%89%8b%e5%8a%a8%e6%b7%bb%e5%8a%a0%e5%90%af%e5%8a%a8%e6%9c%8d%e5%8a%a1%e5%bc%80%e6%9c%ba%e8%87%aa%e5%90%af%e5%8a%a8-etc-init-d%e7%9b%ae%e5%bd%95","status":"publish","type":"post","link":"https:\/\/00af.com\/?p=382","title":{"rendered":"OpenWRT\u76f8\u5173\u547d\u4ee4\u8bbe\u7f6eIP\u4e3aDHCP\u5f00\u673a\u542f\u52a8\u670d\u52a132\u4f4d\u4e0e64\u4f4d\u5b89\u88c5"},"content":{"rendered":"\n<p>\u591a\u6570OpenWRT\u90fd\u662f\u652f\u6301init.d\u7cfb\u7edf\u670d\u52a1<\/p>\n\n\n\n<p><a href=\"https:\/\/www.wangsu.com\/document\/700\/1789\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.wangsu.com\/document\/700\/1789<\/a>  #\u53c2\u8003<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/sh \/etc\/rc.common\nSTART=99\nstart(){\n  cd \/root\/singbox\n   \/root\/singbox\/go run\n}\nstop(){\n        kill -9 `ps | grep '\/root\/singbox\/go' | grep -v 'grep' | awk '{print $1}'`\n}\nrestart(){\n        kill -9 `ps | grep '\/root\/singbox\/go' | grep -v 'grep' | awk '{print $1}'`\n   cd \/root\/singbox\n   \/root\/singbox\/go run\n} \n\n\u542f\u52a8\/\u505c\u6b62\/\u91cd\u542f#\u5fc5\u987b\u5148\u8fdb\u5165\u7a0b\u5e8f\u6240\u5728\u76ee\u5f55\u518d\u53e6\u884c\u4e00\u884c\u8f93\u5165\u8fd0\u884c\u7a0b\u5e8f\u7684\u7edd\u8def\u5f84\uff0c\u5e76\u63d0\u524d\u8bbe\u7f6e\u597d\u8fd0\u884c\u6743\u9650\uff01\u6709\u4e9b\u7a0b\u5e8f\u662f\u9700\u8981\u52a0\u8fd0\u884c\u53c2\u6570\u7684\uff0c\u8bf7\u53c2\u8003\u5177\u4f53\u7a0b\u5e8f\u7684\u53c2\u6570\u4f7f\u7528\u65b9\u6cd5\uff01\u540c\u4e00\u4e2a\u4ee3\u7406\u7a0b\u5e8f\u53ea\u80fd\u8fd0\u884c\u4e00\u6b21init.d\u624b\u52a8\u53ef\u8fd0\u884c\u4e8c\u4e2a\u76f8\u540c\u7a0b\u5e8f\n\/etc\/init.d\/pawns enable #\u5f00\u673a\u81ea\u542f\nstart #\u542f\u52a8\nstop #\u505c\u6b62\nrestart #\u91cd\u542f\nreload #\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\nenable #\u542f\u7528\u5f00\u673a\u81ea\u542f\u52a8\ndisable #\u7981\u7528\u5f00\u673a\u81ea\u542f\u52a8\nenabled #\u68c0\u67e5\u542f\u52a8\u65f6\u662f\u5426\u542f\u52a8\u4e86\u670d\u52a1<\/code><\/pre>\n\n\n\n<p><a href=\"https:\/\/www.cnblogs.com\/uuuuuuuuuuuuuuuu\/p\/17431156.html\">https:\/\/www.cnblogs.com\/uuuuuuuuuuuuuuuu\/p\/17431156.html<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-text-align-left\">\u672c\u5730\u542f\u52a8\u811a\u672c<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u4e0b\u8f7dsingbox-ip1\u914d\u7f6e\u6587\u4ef6\u66ff\u6362\ncd \/root\/v\/s1\ncurl -L -o \/root\/v\/s1\/config.json https:\/\/www.gitlabip.xyz\/Alvin9999\/PAC\/master\/backup\/img\/1\/2\/ipp\/singbox\/1\/config.json\n#\u91cd\u542fsingbox\u670d\u52a1ip1\ncd \/etc\/init.d\n\/etc\/init.d\/singbox restart\n\n#\u4e0b\u8f7dsingbox-ip2\u914d\u7f6e\u6587\u4ef6\u66ff\u6362\ncd \/root\/v\/s2\ncurl -L -o \/root\/v\/s2\/config.json https:\/\/www.gitlabip.xyz\/Alvin9999\/PAC\/master\/backup\/img\/1\/2\/ip\/singbox\/2\/config.json\n#\u4fee\u6539hsk5\u7aef\u53e3\u4e3a1079\ncd \/root\/v\/s2\nsed -i 's\/1080\/1079\/g' \/root\/v\/s2\/config.json\n#\u542f\u52a8singbox\u670d\u52a1ip2\ncd \/root\/v\/s2\n\/root\/v\/s2\/ip2 run\n\n#\u542f\u52a8pawns\ncd \/root\n\/root\/pawns -email=wangxunquan@gmail.com -password=00af.com -device-name=OCPZ121314437 -device-id=OCPZ121314437 -accept-tos\n\nexit 0\n\n\u6ce8\uff1a\u786e\u8ba4\u547d\u4ee4\u65e0\u8bef\u540e\uff0c\u5148\u8fdb\u5165\u7a0b\u5e8f\u6240\u5728\u76ee\u5f55\u540e\u8fd0\u884c<\/code><\/pre>\n\n\n\n<p>\u5b9a\u65f6\u8fd0\u884c\u8ba1\u5212\u4efb\u52a1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u6bcf\u5929\u51cc\u66682\u70b91\u5206\u4e0b\u8f7d\u914d\u7f6e\u6587\u4ef6init.d-ip1\n1 2 * * * curl -L -o \/root\/v\/s1\/config.json https:\/\/www.gitlabip.xyz\/Alvin9999\/PAC\/master\/backup\/img\/1\/2\/ipp\/singbox\/1\/config.json\n\n#\u6bcf\u5929\u51cc\u66682\u70b92\u5206singox-s1-ip1\n1 2 * * * \/etc\/init.d\/singbox restart\n\n#\u6bcf\u5929\u51cc\u66682\u70b93\u5206\u4e0b\u8f7d\u914d\u7f6e\u6587\u4ef6root-ip2\n3 2 * * * curl -L -o \/root\/v\/s2\/config.json https:\/\/www.gitlabip.xyz\/Alvin9999\/PAC\/master\/backup\/img\/1\/2\/ip\/singbox\/2\/config.json\n\n#\u6bcf\u5929\u51cc\u66682\u70b94\u5206\u4fee\u6539\u914d\u7f6eip2\u7aef\u53e3\n4 2 * * * sed -i 's\/1080\/1079\/g' \/root\/v\/s2\/config.json\n\n#\u6bcf\u5929\u51cc\u66682\u70b95\u5206\u5173\u95edsingbox-ip2\n5 2 * * * kill -9 `ps | grep '\/root\/v\/s2\/ip2' | grep -v 'grep' | awk '{print $1}'`\n\n#\u6bcf\u5929\u51cc\u66682\u70b96\u5206\u91cd\u542fsingbox-ip2\n6 2 * * * \/root\/v\/s2\/ip2 run\n\n#\u5173\u95edpawns\u6bcf\u5929\u51cc\u66683\u70b91\u5206\n1 3 * * * kill -9 `ps | grep '\/root\/pawns' | grep -v 'grep' | awk '{print $1}'`\n\n#\u91cd\u542fpawns\u6bcf\u5929\u51cc\u66683\u70b92\u5206\n2 3 * * * \/root\/pawns -email=wangxunquan@gmail.com -password=00af.com -device-name=OCPZ121314437 -device-id=OCPZ121314437 -accept-tos<\/code><\/pre>\n\n\n\n<p>\u8fdb\u4ef7\u8bbe\u7f6e\u91cc\u7684nginx\u914d\u7f6eKwrt\u7cfb\u7edf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>config main 'global'\n\toption uci_enable 'true'\n\nconfig server '_lan'\n\tlist listen '28504 ssl default_server'\n\tlist listen '&#91;::]:28504 ssl default_server'\n\toption server_name '_lan'\n\tlist include 'restrict_locally'\n\tlist include 'conf.d\/*.locations'\n\toption uci_manage_ssl 'self-signed'\n\toption ssl_certificate '\/etc\/nginx\/conf.d\/_lan.crt'\n\toption ssl_certificate_key '\/etc\/nginx\/conf.d\/_lan.key'\n\toption ssl_session_cache 'shared:SSL:32k'\n\toption ssl_session_timeout '64m'\n\toption access_log 'off; # logd openwrt'\n\nconfig server '_redirect2ssl'\n\tlist listen '28500'\n\tlist listen '&#91;::]:28500'\n\toption server_name '_redirect2ssl'\n\toption return '302 https:\/\/$host$request_uri'\n\nconfig server 'default_server'\n\toption server_name 'kwrt'\n\tlist listen '28500 default_server'\n\tlist listen '&#91;::]:28500 default_server'\n\tlist include 'conf.d\/*.locations'\n\toption access_log 'off; # logd openwrt'<\/code><\/pre>\n\n\n\n<p>\u8bbe\u7f6eIP\u76f8\u5173\u547d\u4ee4\u64cd\u4f5c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>udhcpc -i br-lan #\u4e34\u65f6\u8bbe\u7f6eLank\u53e3\u4e3adhcp\nip addr flush dev br-lan # \u6e05\u9664\u73b0\u6709\u914d\u7f6e\n\nuci set network.lan.ipaddr=192.168.1.100\nuci set network.lan.netmask=255.255.255.0\nuci set network.lan.gateway=192.168.1.1\nuci commit network\n\/etc\/init.d\/network restart\n\n\u624b\u52a8\u914d\u7f6eIP\u4fee\u6539\u7f51\u7edcIP\u6587\u4ef6\nvi \/etc\/config\/network\nnano \/etc\/config\/network\nconfig interface 'lnanoan'\n        option ifname 'eth0'\n        option proto 'static'\n        option ipaddr '192.168.1.100'\n        option netmask '255.255.255.0'\n        option gateway '192.168.1.1'\n        # \u53ef\u4ee5\u6dfb\u52a0DNS\u670d\u52a1\u5668\u8bbe\u7f6e\u5982\u4e0b\uff1a\n        option dns '192.168.1.1'\n\/etc\/init.d\/network restart<\/code><\/pre>\n\n\n\n<p>OpenWRT\u7248\u672c\u517c\u5bb9\u95ee\u9898<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u5982\u679c\u5904\u7406\u5668\u662f64\u4f4d\u7684\uff0c\u4e0d\u53ef\u4ee5\u5b89\u88c532\u4f4d\uff0c\u7269\u7406\u673a64\u4f4d\u865a\u62df\u673a\u5b89\u88c532\u4f4dWRT\u7cfb\u7edf\uff0cPassWall\u548cOpenClash\u7b49\u5185\u6838\u8d77\u52a8\u5931\u8d25\uff01<br>23.05.07\u7cfb\u7edf\u4e0bOpenClash\u5185\u6838\u603b\u662f\u542f\u52a8\u5931\u8d25\uff0c\u624b\u52a8\u4e0b\u8f7d\u4e0a\u4f20\u4e5f\u4e00\u6837\u3002\u539f\u56e0\u672a\u77e5\u3002<br>ext4\u683c\u5f0f\u65e0\u6cd5\u6269\u5bb9\u8f6f\u4ef6\u5bb9\u91cf\u65e0\u6062\u590d\u51fa\u5382\u529f\u80fd\uff0csquashfs\u683c\u5f0f\u6709\u6062\u590d\u51fa\u5382\u8bbe\u7f6e\u53ef\u6269\u5bb9\u8f6f\u4ef6\u5bb9\u91cf<br>\u7231\u5feb\u7cfb\u7edf\u52a0WRT\u81f3\u5c11\u63a8\u83504G\u5185\u5b58\u5426\u5219\u5f88\u5361\uff0c4G\u4ee5\u4e0b\u5b89\u88c5\u6210\u7269\u7406\u673aWRT\u7cfb\u7edf<br>\u7231\u5febDocker\/3X-UI\u4f7f\u7528128MB\u5185\u5b58\u4e0d\u6253\u5f00Web\u9762\u677f\u52c9\u5f3a\u53ef\u7528\uff0c\u6253\u5f00web\u7ba1\u7406\u9875\u9762\u5185\u5b58\u4e0d\u591f\u7528<br>3X-UI\u5f00\u542f\u56fd\u5185\u76f4\u8fde\u4e2d\u8f6c\u5916\u7f51\u6d88\u8017\u7684\u5185\u5b58\u8d44\u6e90\u66f4\u591a\uff0c\u5c11\u4e8e256mb\u5185\u5b58\u76843X-UI\u5bb9\u5668\u4e0d\u5f00\u542f\u4e2d\u8f6c\u548c\u8fc7\u6ee4\u53bb\u5e7f\u544a<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u591a\u6570OpenWRT\u90fd\u662f\u652f\u6301init.d\u7cfb\u7edf\u670d\u52a1 https:\/\/www.wangsu.com\/document [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-382","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/00af.com\/index.php?rest_route=\/wp\/v2\/posts\/382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/00af.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/00af.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/00af.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/00af.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=382"}],"version-history":[{"count":0,"href":"https:\/\/00af.com\/index.php?rest_route=\/wp\/v2\/posts\/382\/revisions"}],"wp:attachment":[{"href":"https:\/\/00af.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/00af.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/00af.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}