{"id":354295,"date":"2024-05-20T22:45:36","date_gmt":"2024-05-20T22:45:36","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=354295"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=354295","title":{"rendered":"<span>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442 Outline \u043d\u0430 OpenWRT \u0437\u0430 5 \u043c\u0438\u043d\u0443\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e tun2socks<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043a \u0434\u0435\u043b\u0443, \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f <strong>\u043b\u044e\u0431\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f OpenWRT<\/strong> (\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u043e\u0441\u044c \u043d\u0430 19.07, 21.02, 22.03 \u0438 23.05-rc1) \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b kmod-tun \u0438 ip-full, \u0430 \u0442\u0430\u043a \u0436\u0435 <strong>\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440<\/strong> Outline (shadowsocks).<\/p>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0440\u043e\u0443\u0442\u0435\u0440 <strong>\u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u0441 128 \u041c\u0431<\/strong> \u041e\u0417\u0423, \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432 \u041f\u0417\u0423 \u0438 \u041e\u0417\u0423.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0430\u043a\u0435\u0442\u00a0<a href=\"https:\/\/github.com\/xjasonlyu\/tun2socks\" rel=\"noopener noreferrer nofollow\">xjasonlyu\/tun2socks<\/a>.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h2>\n<p><strong>\u0421\u043a\u0430\u0447\u0430\u0435\u043c <\/strong><a href=\"https:\/\/github.com\/1andrevich\/outline-install-wrt\" rel=\"noopener noreferrer nofollow\"><strong>\u0441\u043a\u0440\u0438\u043f\u0442 <\/strong><\/a><strong>\u0432 \u041e\u0417\u0423 \u0438 \u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a<\/strong>:<\/p>\n<pre><code class=\"bash\">cd \/tmp wget https:\/\/raw.githubusercontent.com\/1andrevich\/outline-install-wrt\/main\/install_outline.sh -O install_outline.sh chmod +x install_outline.sh <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b <strong>kmod-tun<\/strong> and <strong>ip-full<\/strong>, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435:<\/p>\n<pre><code class=\"bash\">opkg update opkg install kmod-tun ip-full<\/code><\/pre>\n<p><strong>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442: <\/strong>(\u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u043a\u043e\u043b\u043e 9 \u041c\u0431 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u043e\u0443\u0442\u0435\u0440\u0430)<\/p>\n<pre><code class=\"bash\">.\/install_outline.sh<\/code><\/pre>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442:<\/p>\n<ul>\n<li>\n<p>IP \u0430\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0433\u043e \u0421\u0435\u0440\u0432\u0435\u0440\u0430 Outline (shadowsocks) <\/p>\n<\/li>\n<li>\n<p>Outline (Shadowsocks) \u043a\u043e\u043d\u0444\u0438\u0433 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 &#171;ss:\/\/base64coded@IP:\u041f\u041e\u0420\u0422&#187; (\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/articles\/748408\/\" rel=\"noopener noreferrer nofollow\">Outline Manager<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0425\u043e\u0442\u0438\u0442\u0435 \u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Outline (shadowsocks) \u043a\u0430\u043a <strong>\u0448\u043b\u044e\u0437 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/strong> (y\/n)<\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 kmod-tun, ip-full<\/p>\n<\/li>\n<li>\n<p>C\u043a\u0430\u0447\u0430\u0435\u0442 tun2socks \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430 (\u0435\u0441\u043b\u0438 \u043f\u0430\u043a\u0435\u0442 \u0435\u0441\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438)<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u0442 \u0444\u0430\u0439\u043b \u0432 \u041f\u0417\u0423<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \/etc\/config\/network \u0438 \/etc\/config\/firewall<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0441\u0435\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0441\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 <strong>\/etc\/init.d\/tun2socks <\/strong>\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0435\u0433\u043e \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a<\/p>\n<\/li>\n<\/ol>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432 \u041e\u0417\u0423<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 <strong>\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 9 \u041c\u0431 \u0432 \u041f\u0417\u0423<\/strong>, \u043d\u043e \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442 (\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e <strong>\u043c\u0438\u043d\u0438\u043c\u0443\u043c 35\u041c\u0431<\/strong> <strong>\u041e\u0417\u0423<\/strong>), \u0442\u043e\u0433\u0434\u0430:<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043f\u0430\u043a\u0435\u0442\u044b <strong>kmod-tun<\/strong> \u0438 <strong>ip-full<\/strong><\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"bash\">cd \/tmp wget https:\/\/raw.githubusercontent.com\/1andrevich\/outline-install-wrt\/main\/install_outline_ram.sh -O install_outline_ram.sh chmod +x install_outline_ram.sh .\/install_outline_ram.sh<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 kmod-tun, ip-full<\/p>\n<\/li>\n<li>\n<p>C\u043a\u0430\u0447\u0430\u0435\u0442 tun2socks \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430 (\u0435\u0441\u043b\u0438 \u043f\u0430\u043a\u0435\u0442 \u0435\u0441\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438)<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \/etc\/config\/network \u0438 \/etc\/config\/firewall<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0441\u0435\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0441\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 <strong>\/etc\/init.d\/tun2socks <\/strong>\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0435\u0433\u043e \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a (\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 tun2socks \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430)<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0414\u043b\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0442\u0443\u043d\u043d\u0435\u043b\u044f \u0434\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/strong>:<\/p>\n<p><strong>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 &#8212; \u0410\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a<\/strong> \u0438 <strong>\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c<\/strong> \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432 <strong>tun2socks<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b33\/089\/aed\/b33089aedf4214c5c75fe750981e649e.png\" width=\"875\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b33\/089\/aed\/b33089aedf4214c5c75fe750981e649e.png\"\/><\/figure>\n<p>\u0438\u043b\u0438:<\/p>\n<pre><code class=\"bash\">\/etc\/init.d\/tun2socks stop<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0431\u044b \u0438\u0437 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a\u0430:<\/p>\n<p><strong>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 &#8212; \u0410\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a<\/strong> \u0438 <strong>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u043e<\/strong> \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432 <strong>tun2socks<\/strong>, \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u0412\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u043d\u0430 <strong>\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e<\/strong><\/p>\n<p>\u0438\u043b\u0438:<\/p>\n<pre><code class=\"bash\">rm \/etc\/rc.d\/S99tun2socks<\/code><\/pre>\n<p><strong>\u041d\u0430 \u044d\u0442\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430<\/strong>.<\/p>\n<p> \u0414\u0430\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u044c \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0440\u0430\u0437\u0431\u043e\u0440\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u043c\u0443 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<h2>\u0420\u0430\u0437\u0431\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h2>\n<p>\u0414\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c<\/p>\n<p><a href=\"https:\/\/github.com\/1andrevich\/outline-install-wrt\" rel=\"noopener noreferrer nofollow\"><strong>install_outline.sh<\/strong><\/a> \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c:<\/p>\n<pre><code class=\"bash\"># Step 1: \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 kmod-tun, \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d opkg list-installed | grep kmod-tun > \/dev\/null if [ $? -ne 0 ]; then     echo \"kmod-tun is not installed. Exiting.\"     exit 1     echo 'kmod-tun installed' fi<\/code><\/pre>\n<p>\u0422\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 Step 2, \u0434\u043b\u044f ip-full<\/p>\n<pre><code class=\"bash\"># Step 2: Check for ip-full opkg list-installed | grep ip-full > \/dev\/null if [ $? -ne 0 ]; then     echo \"ip-full is not installed. Exiting.\"     exit 1     echo 'ip-full installed' fi<\/code><\/pre>\n<pre><code class=\"bash\"># Step 3: \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 tun2socks \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u043a\u0430\u0447\u0430\u0435\u0442 tun2socks \u0441 GitHub if [ ! -f \"\/tmp\/tun2socks*\" ]; then ARCH=$(grep \"OPENWRT_ARCH\" \/etc\/os-release | awk -F '\"' '{print $2}') #\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 wget https:\/\/github.com\/1andrevich\/outline-install-wrt\/releases\/download\/v2.5.1\/tun2socks-linux-$ARCH -O \/tmp\/tun2socks #\u041a\u0430\u0447\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u0444\u0430\u0439\u043b  # Check wget's exit status     if [ $? -ne 0 ]; then          echo \"Download failed. No file for your Router's architecture\" #\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0435 \u0443\u0434\u0430\u043b\u0430\u0441\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u043e         exit 1    fi fi<\/code><\/pre>\n<pre><code class=\"bash\"># Step 4: \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f tun2socks \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0435\u0433\u043e \u0432 \/usr\/bin if [ ! -f \"\/usr\/bin\/tun2socks\" ]; then mv \/tmp\/tun2socks \/usr\/bin\/ echo 'moving tun2socks to \/usr\/bin' chmod +x \/usr\/bin\/tun2socks fi<\/code><\/pre>\n<pre><code class=\"bash\"># Step 5: \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \/etc\/config\/network \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e\u0433\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c if ! grep -q \"config interface 'tunnel'\" \/etc\/config\/network; then echo \" config interface 'tunnel'     option device 'tun1'     option proto 'static'     option ipaddr '172.16.10.1' #\u0410\u0434\u0440\u0435\u0441 \u0440\u043e\u0443\u0442\u0435\u0440\u0430     option netmask '255.255.255.252' #\u041f\u043e\u0434\u0441\u0435\u0442\u044c \u0438\u0437 4 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \" >> \/etc\/config\/network     echo 'added entry into \/etc\/config\/network' fi echo 'found entry into \/etc\/config\/network'<\/code><\/pre>\n<pre><code class=\"bash\"># Step 6:\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \/etc\/config\/firewall \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e\u0433\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c if ! grep -q \"option name 'proxy'\" \/etc\/config\/firewall; then  echo \" config zone     option name 'proxy'     list network 'tunnel'     option forward 'REJECT'     option output 'ACCEPT'     option input 'REJECT'     option masq '1'     option mtu_fix '1'     option device 'tun1'     option family 'ipv4'  config forwarding     option name 'lan-proxy'     option dest 'proxy'     option src 'lan'     option family 'ipv4' \" >> \/etc\/config\/firewall     echo 'added entry into \/etc\/config\/firewall' fi<\/code><\/pre>\n<p>Step 7 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0442\u0438<\/p>\n<pre><code class=\"bash\"># Step 7: Restart network \/etc\/init.d\/network restart echo 'Restarting Network....'<\/code><\/pre>\n<pre><code class=\"bash\"># Step 8: Read user variable for OUTLINE HOST IP read -p \"Enter Outline Server IP: \" OUTLINEIP #C\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 IP \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e # Read user variable for Outline config read -p \"Enter Outline (Shadowsocks) Config (format ss:\/\/base64coded@HOST:PORT\/?outline=1): \" OUTLINECONF #\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e<\/code><\/pre>\n<p>Step 9, 10 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/p>\n<pre><code class=\"bash\">#Step 9. Check for default gateway and save it into DEFGW DEFGW=$(ip route | grep default | awk '{print $3}') echo 'checked default gateway'  #Step 10. Check for default interface and save it into DEFIF DEFIF=$(ip route | grep default | awk '{print $5}') echo 'checked default interface'<\/code><\/pre>\n<pre><code class=\"bash\"># Step 11: \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \/etc\/init.d\/tun2socks if [ ! -f \"\/etc\/init.d\/tun2socks\" ]; then #\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0444\u0430\u0439\u043b\u0430 cat &lt;&lt;EOL > \/etc\/init.d\/tun2socks #!\/bin\/sh \/etc\/rc.common USE_PROCD=1  # starts after network starts START=99 # stops before networking stops STOP=89  #PROG=\/usr\/bin\/tun2socks #IF=\"tun1\" #\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 tun1 \u0434\u043b\u044f \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0441 OpenVPN #OUTLINE_CONFIG=\"$OUTLINECONF\" #LOGLEVEL=\"warning\" #\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 #BUFFER=\"64kb\" #\u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430 \u0432\u044b\u0431\u0440\u0430\u043d \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0432\u0438\u043a\u0438 tun2socks  start_service() {     procd_open_instance     procd_set_param user root     procd_set_param command \/usr\/bin\/tun2socks -device tun1 -tcp-rcvbuf 64kb -tcp-sndbuf 64kb  -proxy \"$OUTLINECONF\" -loglevel \"warning\"     procd_set_param stdout 1     procd_set_param stderr 1     procd_set_param respawn \"${respawn_threshold:-3600}\" \"${respawn_timeout:-5}\" \"${respawn_retry:-5}\"     procd_close_instance     ip route add \"$OUTLINEIP\" via \"$DEFGW\" #\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0434\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Outline echo 'route to Outline Server added'     ip route save default > \/tmp\/defroute.save  #\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e     echo \"tun2socks is working!\" }  boot() {     # This gets run at boot-time.     start }  shutdown() {     # This gets run at shutdown\/reboot.     stop }  stop_service() {     service_stop \/usr\/bin\/tun2socks     ip route restore default &lt; \/tmp\/defroute.save #\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e     ip route del \"$OUTLINEIP\" via \"$DEFGW\" #\u0423\u0434\u0430\u043b\u044f\u0435\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0434\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Outline     echo \"tun2socks has stopped!\" }  reload_service() {     stop     sleep 3s     echo \"tun2socks restarted!\"     start } EOL DEFAULT_GATEWAY=\"\" #\u0421\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 Outline \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e while [ \"$DEFAULT_GATEWAY\" != \"y\" ] &amp;&amp; [ \"$DEFAULT_GATEWAY\" != \"n\" ]; do     echo \"Use Outline as default gateway? [y\/n]: \"     read DEFAULT_GATEWAY done  if [ \"$DEFAULT_GATEWAY\" = \"y\" ]; then cat &lt;&lt;EOL >> \/etc\/init.d\/tun2socks #\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430 Outline service_started() {     # This function checks if the default gateway is Outline, if no changes it      echo 'Replacing default gateway for Outline...'      sleep 2s      if ip link show tun1 | grep -q \"UP\" ; then          ip route del default #\u0423\u0434\u0430\u043b\u044f\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e          ip route add default via 172.16.10.2 dev tun1 #\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043a\u0441\u0438      fi } start() {     start_service     service_started } EOL #\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 rc.local \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 rc.local \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 if ! grep -q \"sleep 20\" \/etc\/rc.local; then sed '\/exit 0\/i\\ sleep 20\\ #\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 Outline \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043b\u0438 \u043d\u0435\u0442\\ if ! ip route | grep -q '\\''^default via 172.16.10.2 dev tun1'\\''; then\\     \/etc\/init.d\/tun2socks start\\ fi\\ ' \/etc\/rc.local > \/tmp\/rc.local.tmp &amp;&amp; mv \/tmp\/rc.local.tmp \/etc\/rc.local echo \"All traffic would be routed through Outline\" fi else #\u041f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043d\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 cat &lt;&lt;EOL >> \/etc\/init.d\/tun2socks start() {     start_service } EOL echo \"No changes to default gateway\" #\u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e fi  echo 'script \/etc\/init.d\/tun2socks created'  chmod +x \/etc\/init.d\/tun2socks fi<\/code><\/pre>\n<pre><code class=\"bash\"># Step 12: \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a\u0430 if [ ! -f \"\/etc\/rc.d\/S99tun2socks\" ]; then ln -s \/etc\/init.d\/tun2socks \/etc\/rc.d\/S99tun2socks echo '\/etc\/init.d\/tun2socks \/etc\/rc.d\/S99tun2socks \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0441\u0438\u043c\u043b\u0438\u043d\u043a \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438' fi  # Step 13: Start service \/etc\/init.d\/tun2socks start  echo 'Script finished' # \u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 <strong>install_outline_ram.sh<\/strong> \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <strong>\/etc\/init.d\/tun2socks<\/strong> \u0435\u0441\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"bash\">before_start() { #\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c if [ ! -f \"\/tmp\/tun2socks*\" ]; then #\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0444\u0430\u0439\u043b\u0430 tun2socks \u0432 \u041e\u0417\u0423   ARCH=$(grep \"OPENWRT_ARCH\" \/etc\/os-release | awk -F '\"' '{print $2}')   wget https:\/\/github.com\/1andrevich\/outline-install-wrt\/releases\/download\/v2.5.1\/tun2socks-linux-$ARCH -O \/tmp\/tun2socks #\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430  # Check wget's exit status     if [ $? -ne 0 ]; then         echo \"Download failed. No file for your Router's architecture\"         exit 1    fi fi  . . .   start_service() {     before_start #\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <\/code><\/pre>\n<p>\u0417\u0430 \u0438\u0434\u0435\u044e \u0438 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0445\u043e\u0447\u0443 \u043f\u043e\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <a class=\"mention\" href=\"\/users\/itdog\">@itdog<\/a> \u0437\u0430 \u0435\u0433\u043e \u043f\u043e\u0441\u0442 <a href=\"https:\/\/t.me\/itdoginfo\/10\" rel=\"noopener noreferrer nofollow\">https:\/\/t.me\/itdoginfo\/10<\/a> \u0442\u0430\u043a \u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/743572\/\" rel=\"noopener noreferrer nofollow\">\u0422\u043e\u0447\u0435\u0447\u043d\u044b\u0439 \u043e\u0431\u0445\u043e\u0434 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u043d\u0430 \u0440\u043e\u0443\u0442\u0435\u0440\u0435 OpenWrt c \u043f\u043e\u043c\u043e\u0449\u044c\u044e BGP \/ \u0425\u0430\u0431\u0440 (habr.com)<\/a>\u00a0\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e BGP (bird2).<\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/440030\/\" rel=\"noopener noreferrer nofollow\">\u0422\u043e\u0447\u0435\u0447\u043d\u044b\u0439 \u043e\u0431\u0445\u043e\u0434 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a PKH \u043d\u0430 \u0440\u043e\u0443\u0442\u0435\u0440\u0435 \u0441 OpenWrt \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e WireGuard \u0438 DNSCrypt \/ \u0425\u0430\u0431\u0440 (habr.com)<\/a>\u00a0(\u043f\u0443\u0442\u0451\u043c \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u0432 iptables, nftables).<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/759638\/\"> https:\/\/habr.com\/ru\/articles\/759638\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043a \u0434\u0435\u043b\u0443, \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f <strong>\u043b\u044e\u0431\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f OpenWRT<\/strong> (\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u043e\u0441\u044c \u043d\u0430 19.07, 21.02, 22.03 \u0438 23.05-rc1) \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b kmod-tun \u0438 ip-full, \u0430 \u0442\u0430\u043a \u0436\u0435 <strong>\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440<\/strong> Outline (shadowsocks).<\/p>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0440\u043e\u0443\u0442\u0435\u0440 <strong>\u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u0441 128 \u041c\u0431<\/strong> \u041e\u0417\u0423, \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432 \u041f\u0417\u0423 \u0438 \u041e\u0417\u0423.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0430\u043a\u0435\u0442\u00a0<a href=\"https:\/\/github.com\/xjasonlyu\/tun2socks\" rel=\"noopener noreferrer nofollow\">xjasonlyu\/tun2socks<\/a>.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h2>\n<p><strong>\u0421\u043a\u0430\u0447\u0430\u0435\u043c <\/strong><a href=\"https:\/\/github.com\/1andrevich\/outline-install-wrt\" rel=\"noopener noreferrer nofollow\"><strong>\u0441\u043a\u0440\u0438\u043f\u0442 <\/strong><\/a><strong>\u0432 \u041e\u0417\u0423 \u0438 \u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a<\/strong>:<\/p>\n<pre><code class=\"bash\">cd \/tmp wget https:\/\/raw.githubusercontent.com\/1andrevich\/outline-install-wrt\/main\/install_outline.sh -O install_outline.sh chmod +x install_outline.sh <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b <strong>kmod-tun<\/strong> and <strong>ip-full<\/strong>, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435:<\/p>\n<pre><code class=\"bash\">opkg update opkg install kmod-tun ip-full<\/code><\/pre>\n<p><strong>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442: <\/strong>(\u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u043a\u043e\u043b\u043e 9 \u041c\u0431 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u043e\u0443\u0442\u0435\u0440\u0430)<\/p>\n<pre><code class=\"bash\">.\/install_outline.sh<\/code><\/pre>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442:<\/p>\n<ul>\n<li>\n<p>IP \u0430\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0433\u043e \u0421\u0435\u0440\u0432\u0435\u0440\u0430 Outline (shadowsocks) <\/p>\n<\/li>\n<li>\n<p>Outline (Shadowsocks) \u043a\u043e\u043d\u0444\u0438\u0433 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 &#171;ss:\/\/base64coded@IP:\u041f\u041e\u0420\u0422&#187; (\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/articles\/748408\/\" rel=\"noopener noreferrer nofollow\">Outline Manager<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u0425\u043e\u0442\u0438\u0442\u0435 \u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Outline (shadowsocks) \u043a\u0430\u043a <strong>\u0448\u043b\u044e\u0437 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/strong> (y\/n)<\/p>\n<\/li>\n<\/ul>\n<p>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 kmod-tun, ip-full<\/p>\n<\/li>\n<li>\n<p>C\u043a\u0430\u0447\u0430\u0435\u0442 tun2socks \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430 (\u0435\u0441\u043b\u0438 \u043f\u0430\u043a\u0435\u0442 \u0435\u0441\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438)<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u0442 \u0444\u0430\u0439\u043b \u0432 \u041f\u0417\u0423<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \/etc\/config\/network \u0438 \/etc\/config\/firewall<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0441\u0435\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0441\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 <strong>\/etc\/init.d\/tun2socks <\/strong>\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0435\u0433\u043e \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a<\/p>\n<\/li>\n<\/ol>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432 \u041e\u0417\u0423<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 <strong>\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 9 \u041c\u0431 \u0432 \u041f\u0417\u0423<\/strong>, \u043d\u043e \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442 (\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e <strong>\u043c\u0438\u043d\u0438\u043c\u0443\u043c 35\u041c\u0431<\/strong> <strong>\u041e\u0417\u0423<\/strong>), \u0442\u043e\u0433\u0434\u0430:<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043f\u0430\u043a\u0435\u0442\u044b <strong>kmod-tun<\/strong> \u0438 <strong>ip-full<\/strong><\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"bash\">cd \/tmp wget https:\/\/raw.githubusercontent.com\/1andrevich\/outline-install-wrt\/main\/install_outline_ram.sh -O install_outline_ram.sh chmod +x install_outline_ram.sh .\/install_outline_ram.sh<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 kmod-tun, ip-full<\/p>\n<\/li>\n<li>\n<p>C\u043a\u0430\u0447\u0430\u0435\u0442 tun2socks \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430 (\u0435\u0441\u043b\u0438 \u043f\u0430\u043a\u0435\u0442 \u0435\u0441\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438)<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \/etc\/config\/network \u0438 \/etc\/config\/firewall<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0441\u0435\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0441\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 <strong>\/etc\/init.d\/tun2socks <\/strong>\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0435\u0433\u043e \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a (\u0438 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 tun2socks \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430)<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0414\u043b\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0442\u0443\u043d\u043d\u0435\u043b\u044f \u0434\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/strong>:<\/p>\n<p><strong>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 &#8212; \u0410\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a<\/strong> \u0438 <strong>\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c<\/strong> \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432 <strong>tun2socks<\/strong><\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0438\u043b\u0438:<\/p>\n<pre><code class=\"bash\">\/etc\/init.d\/tun2socks stop<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0431\u044b \u0438\u0437 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a\u0430:<\/p>\n<p><strong>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 &#8212; \u0410\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a<\/strong> \u0438 <strong>\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u043e<\/strong> \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432 <strong>tun2socks<\/strong>, \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u0412\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u043d\u0430 <strong>\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e<\/strong><\/p>\n<p>\u0438\u043b\u0438:<\/p>\n<pre><code class=\"bash\">rm \/etc\/rc.d\/S99tun2socks<\/code><\/pre>\n<p><strong>\u041d\u0430 \u044d\u0442\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430<\/strong>.<\/p>\n<p> \u0414\u0430\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u044c \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0440\u0430\u0437\u0431\u043e\u0440\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u043c\u0443 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<h2>\u0420\u0430\u0437\u0431\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h2>\n<p>\u0414\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c<\/p>\n<p><a href=\"https:\/\/github.com\/1andrevich\/outline-install-wrt\" rel=\"noopener noreferrer nofollow\"><strong>install_outline.sh<\/strong><\/a> \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c:<\/p>\n<pre><code class=\"bash\"># Step 1: \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 kmod-tun, \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d opkg list-installed | grep kmod-tun > \/dev\/null if [ $? -ne 0 ]; then     echo \"kmod-tun is not installed. Exiting.\"     exit 1     echo 'kmod-tun installed' fi<\/code><\/pre>\n<p>\u0422\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 Step 2, \u0434\u043b\u044f ip-full<\/p>\n<pre><code class=\"bash\"># Step 2: Check for ip-full opkg list-installed | grep ip-full > \/dev\/null if [ $? -ne 0 ]; then     echo \"ip-full is not installed. Exiting.\"     exit 1     echo 'ip-full installed' fi<\/code><\/pre>\n<pre><code class=\"bash\"># Step 3: \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 tun2socks \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u043a\u0430\u0447\u0430\u0435\u0442 tun2socks \u0441 GitHub if [ ! -f \"\/tmp\/tun2socks*\" ]; then ARCH=$(grep \"OPENWRT_ARCH\" \/etc\/os-release | awk -F '\"' '{print $2}') #\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 wget https:\/\/github.com\/1andrevich\/outline-install-wrt\/releases\/download\/v2.5.1\/tun2socks-linux-$ARCH -O \/tmp\/tun2socks #\u041a\u0430\u0447\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u0444\u0430\u0439\u043b  # Check wget's exit status     if [ $? -ne 0 ]; then          echo \"Download failed. No file for your Router's architecture\" #\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0435 \u0443\u0434\u0430\u043b\u0430\u0441\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u043e         exit 1    fi fi<\/code><\/pre>\n<pre><code class=\"bash\"># Step 4: \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f tun2socks \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0435\u0433\u043e \u0432 \/usr\/bin if [ ! -f \"\/usr\/bin\/tun2socks\" ]; then mv \/tmp\/tun2socks \/usr\/bin\/ echo 'moving tun2socks to \/usr\/bin' chmod +x \/usr\/bin\/tun2socks fi<\/code><\/pre>\n<pre><code class=\"bash\"># Step 5: \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \/etc\/config\/network \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e\u0433\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c if ! grep -q \"config interface 'tunnel'\" \/etc\/config\/network; then echo \" config interface 'tunnel'     option device 'tun1'     option proto 'static'     option ipaddr '172.16.10.1' #\u0410\u0434\u0440\u0435\u0441 \u0440\u043e\u0443\u0442\u0435\u0440\u0430     option netmask '255.255.255.252' #\u041f\u043e\u0434\u0441\u0435\u0442\u044c \u0438\u0437 4 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \" >> \/etc\/config\/network     echo 'added entry into \/etc\/config\/network' fi echo 'found entry into \/etc\/config\/network'<\/code><\/pre>\n<pre><code class=\"bash\"># Step 6:\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \/etc\/config\/firewall \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e\u0433\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c if ! grep -q \"option name 'proxy'\" \/etc\/config\/firewall; then  echo \" config zone     option name 'proxy'     list network 'tunnel'     option forward 'REJECT'     option output 'ACCEPT'     option input 'REJECT'     option masq '1'     option mtu_fix '1'     option device 'tun1'     option family 'ipv4'  config forwarding     option name 'lan-proxy'     option dest 'proxy'     option src 'lan'     option family 'ipv4' \" >> \/etc\/config\/firewall     echo 'added entry into \/etc\/config\/firewall' fi<\/code><\/pre>\n<p>Step 7 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0442\u0438<\/p>\n<pre><code class=\"bash\"># Step 7: Restart network \/etc\/init.d\/network restart echo 'Restarting Network....'<\/code><\/pre>\n<pre><code class=\"bash\"># Step 8: Read user variable for OUTLINE HOST IP read -p \"Enter Outline Server IP: \" OUTLINEIP #C\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 IP \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e # Read user variable for Outline config read -p \"Enter Outline (Shadowsocks) Config (format ss:\/\/base64coded@HOST:PORT\/?outline=1): \" OUTLINECONF #\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e<\/code><\/pre>\n<p>Step 9, 10 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/p>\n<pre><code class=\"bash\">#Step 9. Check for default gateway and save it into DEFGW DEFGW=$(ip route | grep default | awk '{print $3}') echo 'checked default gateway'  #Step 10. Check for default interface and save it into DEFIF DEFIF=$(ip route | grep default | awk '{print $5}') echo 'checked default interface'<\/code><\/pre>\n<pre><code class=\"bash\"># Step 11: \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \/etc\/init.d\/tun2socks if [ ! -f \"\/etc\/init.d\/tun2socks\" ]; then #\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0444\u0430\u0439\u043b\u0430 cat &lt;&lt;EOL > \/etc\/init.d\/tun2socks #!\/bin\/sh \/etc\/rc.common USE_PROCD=1  # starts after network starts START=99 # stops before networking stops STOP=89  #PROG=\/usr\/bin\/tun2socks #IF=\"tun1\" #\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 tun1 \u0434\u043b\u044f \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0441 OpenVPN #OUTLINE_CONFIG=\"$OUTLINECONF\" #LOGLEVEL=\"warning\" #\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 #BUFFER=\"64kb\" #\u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u0443\u0444\u0435\u0440\u0430 \u0432\u044b\u0431\u0440\u0430\u043d \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0432\u0438\u043a\u0438 tun2socks  start_service() {     procd_open_instance     procd_set_param user root     procd_set_param command \/usr\/bin\/tun2socks -device tun1 -tcp-rcvbuf 64kb -tcp-sndbuf 64kb  -proxy \"$OUTLINECONF\" -loglevel \"warning\"     procd_set_param stdout 1     procd_set_param stderr 1     procd_set_param respawn \"${respawn_threshold:-3600}\" \"${respawn_timeout:-5}\" \"${respawn_retry:-5}\"     procd_close_instance     ip route add \"$OUTLINEIP\" via \"$DEFGW\" #\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0434\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Outline echo 'route to Outline Server added'     ip route save default > \/tmp\/defroute.save  #\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e     echo \"tun2socks is working!\" }  boot() {     # This gets run at boot-time.     start }  shutdown() {     # This gets run at shutdown\/reboot.     stop }  stop_service() {     service_stop \/usr\/bin\/tun2socks     ip route restore default &lt; \/tmp\/defroute.save #\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e     ip route del \"$OUTLINEIP\" via \"$DEFGW\" #\u0423\u0434\u0430\u043b\u044f\u0435\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0434\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Outline     echo \"tun2socks has stopped!\" }  reload_service() {     stop     sleep 3s     echo \"tun2socks restarted!\"     start } EOL DEFAULT_GATEWAY=\"\" #\u0421\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 Outline \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e while [ \"$DEFAULT_GATEWAY\" != \"y\" ] &amp;&amp; [ \"$DEFAULT_GATEWAY\" != \"n\" ]; do     echo \"Use Outline as default gateway? [y\/n]: \"     read DEFAULT_GATEWAY done  if [ \"$DEFAULT_GATEWAY\" = \"y\" ]; then cat &lt;&lt;EOL >> \/etc\/init.d\/tun2socks #\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430 Outline service_started() {     # This function checks if the default gateway is Outline, if no changes it      echo 'Replacing default gateway for Outline...'      sleep 2s      if ip link show tun1 | grep -q \"UP\" ; then          ip route del default #\u0423\u0434\u0430\u043b\u044f\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e          ip route add default via 172.16.10.2 dev tun1 #\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043a\u0441\u0438      fi } start() {     start_service     service_started } EOL #\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 rc.local \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 rc.local \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 if ! grep -q \"sleep 20\" \/etc\/rc.local; then sed '\/exit 0\/i\\ sleep 20\\ #\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 Outline \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u043b\u0438 \u043d\u0435\u0442\\ if ! ip route | grep -q '\\''^default via 172.16.10.2 dev tun1'\\''; then\\     \/etc\/init.d\/tun2socks start\\ fi\\ ' \/etc\/rc.local > \/tmp\/rc.local.tmp &amp;&amp; mv \/tmp\/rc.local.tmp \/etc\/rc.local echo \"All traffic would be routed through Outline\" fi else #\u041f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043d\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 cat &lt;&lt;EOL >> \/etc\/init.d\/tun2socks start() {     start_service } EOL echo \"No changes to default gateway\" #\u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e fi  echo 'script \/etc\/init.d\/tun2socks created'  chmod +x \/etc\/init.d\/tun2socks fi<\/code><\/pre>\n<pre><code class=\"bash\"># Step 12: \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a\u0430 if [ ! -f \"\/etc\/rc.d\/S99tun2socks\" ]; then ln -s \/etc\/init.d\/tun2socks \/etc\/rc.d\/S99tun2socks echo '\/etc\/init.d\/tun2socks \/etc\/rc.d\/S99tun2socks \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0441\u0438\u043c\u043b\u0438\u043d\u043a \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043d\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438' fi  # Step 13: Start service \/etc\/init.d\/tun2socks start  echo 'Script finished' # \u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 <strong>install_outline_ram.sh<\/strong> \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <strong>\/etc\/init.d\/tun2socks<\/strong> \u0435\u0441\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"bash\">before_start() { #\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c if [ ! -f \"\/tmp\/tun2socks*\" ]; then #\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0444\u0430\u0439\u043b\u0430 tun2socks \u0432 \u041e\u0417\u0423   ARCH=$(grep \"OPENWRT_ARCH\" \/etc\/os-release | awk -F '\"' '{print $2}')   wget https:\/\/github.com\/1andrevich\/outline-install-wrt\/releases\/download\/v2.5.1\/tun2socks-linux-$ARCH -O \/tmp\/tun2socks #\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430  # Check wget's exit status     if [ $? -ne 0 ]; then         echo \"Download failed. No file for your Router's architecture\"         exit 1    fi fi <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-354295","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/354295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=354295"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/354295\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=354295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=354295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=354295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}