{"id":131,"date":"2018-11-30T23:48:43","date_gmt":"2018-11-30T15:48:43","guid":{"rendered":"http:\/\/www.zhangyijun.com\/?p=131"},"modified":"2018-11-30T23:48:43","modified_gmt":"2018-11-30T15:48:43","slug":"ocserv%e9%94%90%e9%80%9f%e4%b8%80%e9%94%ae%e8%84%9a%e6%9c%ac-%e7%94%a8%e6%88%b7%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"http:\/\/www.zhangyijun.com\/?p=131","title":{"rendered":"ocserv+\u9510\u901f\u4e00\u952e\u811a\u672c\/\u7528\u6237\u7ba1\u7406"},"content":{"rendered":"<p>\t\t\t\thttps:\/\/moeclub.org\/2017\/06\/22\/268\/<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li><strong>\u4ecb\u7ecd<\/strong>:<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>ocserv+\u9510\u901f\u4e00\u952e\u811a\u672c\u9644\u5e26\u7528\u6237\u7ba1\u7406.<br \/>\n\u4f7f\u7528\u8bf4\u660e\u6ca1\u6709\u5b8c\u6574\u7684\u5199\u5165\u811a\u672c,\u8be6\u60c5\u8bf7\u770b\u4ecb\u7ecd,\u6216\u81ea\u884c\u6478\u7d22.<br \/>\n\u6b64\u811a\u672c\u4ec5\u5728Debian7\u548cDebian8\u4e0a\u8fdb\u884c\u4e86\u6d4b\u8bd5,\u5176\u4ed6\u8bf7\u81ea\u6d4b.<br \/>\n\u6ce8\u610f:\u652f\u6301OpenVZ,\u4f46\u4e0d\u4f1a\u81ea\u52a8\u5b89\u88c5\u9510\u901f.<\/p>\n<hr \/>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li><strong>\u8bf4\u660e<\/strong>:\n<ul>\n<li><strong>\u53c2\u6570\u4f7f\u7528\u4ecb\u7ecd<\/strong>:<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><code>-install<\/code><br \/>\n#\u5728\u6709\u5176\u4ed6\u53c2\u6570\u65f6,\u7b2c\u4e00\u6b65\u8fdb\u884c\u5b89\u88c5.<br \/>\n<code>-add \u3010\u7528\u6237\u540d\u3011\u3010\u5bc6\u7801\u3011<\/code><br \/>\n#\u5bc6\u7801\u767b\u9646\u6a21\u5f0f\u4e0b\u6dfb\u52a0\u4e00\u4e2a\u7528\u6237.<br \/>\n<code>-del \u3010\u7528\u6237\u540d\u3011<\/code><br \/>\n#\u5bc6\u7801\u767b\u5f55\u6a21\u5f0f\u4e0b\u5220\u9664\u4e00\u4e2a\u7528\u6237.<br \/>\n<code>-use \u3010Cert\/Password\u3011<\/code><br \/>\n#\u5207\u6362\u767b\u9646\u65b9\u5f0f,\u5bc6\u7801\u6216\u8bc1\u4e66.<br \/>\n<code>-route\/-noroute<\/code><br \/>\n#\u6dfb\u52a0\u8def\u7531\u8868,\u4e24\u4e2a\u53c2\u6570\u4e0d\u80fd\u540c\u65f6\u4f7f\u7528.<br \/>\n#<strong>-route<\/strong>\u53c2\u6570\u4e00\u822c\u7528\u4e8eandroid\u673a\u5668(\u7531\u4e8eandroid\u5e73\u53f0\u9650\u5236).<br \/>\n#<strong>-noroute<\/strong>\u53c2\u6570\u63a8\u8350\u4f7f\u7528,\u9664android\u673a\u5668\u5916\u90fd\u4f7f\u7528\u6b64\u53c2\u6570.<\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>\u53c2\u6570\u53ef\u4ee5\u5728\u89c4\u5219\u5185\u4efb\u610f\u642d\u914d\u4f7f\u7528.<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<ul>\n<li><strong>\u793a\u4f8b<\/strong>:\n<ul>\n<li>\u5b89\u88c5\u5e76\u6dfb\u52a0<strong>no-route<\/strong>\u8def\u7531\u8868.<\/li>\n<\/ul>\n<\/li>\n<li>\n<pre class=\"pure-highlightjs\"><code class=\"\" null=\"\">bash ocserv.sh -install -noroute<\/code><\/pre>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>\u5b89\u88c5\u5e76\u6dfb\u52a0<strong>route<\/strong>\u8def\u7531\u8868.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div id=\"crayon-5c0156a9cabf6957612789\" class=\"crayon-syntax crayon-theme-amity crayon-font-monaco crayon-os-pc print-yes notranslate crayon-wrapped\" data-settings=\" no-popup minimize scroll-mouseover wrap\">\n<div class=\"crayon-plain-wrap\"><\/div>\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">\n<div class=\"crayon-nums-content\">\n<div class=\"crayon-num\" data-line=\"crayon-5c0156a9cabf6957612789-1\">1<\/div>\n<\/div>\n<\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-5c0156a9cabf6957612789-1\" class=\"crayon-line\"><span class=\"crayon-e\">bash <\/span><span class=\"crayon-v\">ocserv<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">sh<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">install<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">route<\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>\u6dfb\u52a0<strong>no-route<\/strong>\u8def\u7531\u8868\u548c\u4e00\u4e2a\u7528\u6237\u540d\u548c\u5bc6\u7801\u5747\u4e3a<strong>Test<\/strong>\u7684\u7528\u6237.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div id=\"crayon-5c0156a9cabfa282228116\" class=\"crayon-syntax crayon-theme-amity crayon-font-monaco crayon-os-pc print-yes notranslate crayon-wrapped\" data-settings=\" no-popup minimize scroll-mouseover wrap\">\n<div class=\"crayon-plain-wrap\"><\/div>\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">\n<div class=\"crayon-nums-content\">\n<div class=\"crayon-num\" data-line=\"crayon-5c0156a9cabfa282228116-1\">1<\/div>\n<\/div>\n<\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-5c0156a9cabfa282228116-1\" class=\"crayon-line\"><span class=\"crayon-e\">bash <\/span><span class=\"crayon-v\">ocserv<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">sh<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">noroute<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-e\">add <\/span><span class=\"crayon-e\">Test <\/span><span class=\"crayon-v\">Test<\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>\u5220\u9664\u4e00\u4e2a\u7528\u6237\u540d\u4e3a<code>Test<\/code>\u7684\u7528\u6237.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div id=\"crayon-5c0156a9cabfd395210097\" class=\"crayon-syntax crayon-theme-amity crayon-font-monaco crayon-os-pc print-yes notranslate crayon-wrapped\" data-settings=\" no-popup minimize scroll-mouseover wrap\">\n<div class=\"crayon-plain-wrap\"><\/div>\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">\n<div class=\"crayon-nums-content\">\n<div class=\"crayon-num\" data-line=\"crayon-5c0156a9cabfd395210097-1\">1<\/div>\n<\/div>\n<\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-5c0156a9cabfd395210097-1\" class=\"crayon-line\"><span class=\"crayon-e\">bash <\/span><span class=\"crayon-v\">ocserv<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">sh<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-e\">del <\/span><span class=\"crayon-v\">Test<\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>\u5207\u6362\u4f7f\u7528\u8bc1\u4e66\u767b\u9646(cret\u4e0d\u533a\u5206\u5927\u5c0f\u5199.\u9700\u8981\u5b89\u88c5\u65f6\u9009\u62e9\u914d\u7f6e\u4e3a\u8bc1\u4e66\u767b\u5f55,\u5426\u5219\u53ef\u80fd\u65e0\u6cd5\u6b63\u5e38\u8fd0\u884c.)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div id=\"crayon-5c0156a9cac00173734607\" class=\"crayon-syntax crayon-theme-amity crayon-font-monaco crayon-os-pc print-yes notranslate crayon-wrapped\" data-settings=\" no-popup minimize scroll-mouseover wrap\">\n<div class=\"crayon-plain-wrap\"><\/div>\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">\n<div class=\"crayon-nums-content\">\n<div class=\"crayon-num\" data-line=\"crayon-5c0156a9cac00173734607-1\">1<\/div>\n<\/div>\n<\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-5c0156a9cac00173734607-1\" class=\"crayon-line\"><span class=\"crayon-e\">bash <\/span><span class=\"crayon-v\">ocserv<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">sh<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-st\">use<\/span> <span class=\"crayon-v\">Cert<\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>\u5207\u6362\u4f7f\u7528\u5bc6\u7801\u767b\u9646(password\u4e0d\u533a\u5206\u5927\u5c0f\u5199.)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div id=\"crayon-5c0156a9cac03137276333\" class=\"crayon-syntax crayon-theme-amity crayon-font-monaco crayon-os-pc print-yes notranslate crayon-wrapped\" data-settings=\" no-popup minimize scroll-mouseover wrap\">\n<div class=\"crayon-plain-wrap\"><\/div>\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\">\n<div class=\"crayon-nums-content\">\n<div class=\"crayon-num\" data-line=\"crayon-5c0156a9cac03137276333-1\">1<\/div>\n<\/div>\n<\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-5c0156a9cac03137276333-1\" class=\"crayon-line\"><span class=\"crayon-e\">bash <\/span><span class=\"crayon-v\">ocserv<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">sh<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-st\">use<\/span> <span class=\"crayon-v\">password<\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ul>\n<li><strong>\u4e0b\u8f7d<\/strong>:<\/li>\n<\/ul>\n<pre class=\"pure-highlightjs\"><code class=\"\" null=\"\">wget --no-check-certificate -qO ocserv.sh 'https:\/\/moeclub.org\/attachment\/LinuxShell\/ocserv.sh' &amp;&amp; chmod a+x ocserv.sh<\/code><\/pre>\n<ul>\n<li><strong>\u4ee3\u7801\u9884\u89c8<\/strong>:<\/li>\n<\/ul>\n<pre class=\"pure-highlightjs\"><code class=\"\" null=\"\">#!\/bin\/bash\nfunction Welcome()\n{\nclear\nif [[ $EUID -ne 0 ]]; then\n   echo \"Error:This script must be run as root!\" 1&gt;&amp;2\n   exit 1\nfi\nclear\necho -n \"                      Local Time :   \" &amp;&amp; date \"+%F [%T]       \";\necho \"            ======================================================\";\necho \"            |         OpenConnect(ocserv) &amp; serverSpeeder        |\";\necho \"            |                                                    |\";\necho \"            |                                         for Debian |\";\necho \"            |----------------------------------------------------|\";\necho \"            |                           -- By MoeClub.org(Vicer) |\";\necho \"            ======================================================\";\necho;\n}\n \nfunction pause()\n{\necho;\nread -n 1 -p \"Press Enter to Continue...\" INP\nif [ \"$INP\" != '' ] ; then\necho -ne '\\b \\n'\necho;\nfi\n}\n \nfunction ETHER()\n{\nsysBits=x$(getconf LONG_BIT);\nifname=`cat \/proc\/net\/dev | awk -F: 'function trim(str){sub(\/^[ \\t]*\/,\"\",str); sub(\/[ \\t]*$\/,\"\",str); return str } NR&gt;2 {print trim($1)}'  | grep -Ev '^lo|^sit|^stf|^gif|^dummy|^vmnet|^vir|^gre|^ipip|^ppp|^bond|^tun|^tap|^ip6gre|^ip6tnl|^teql' | awk 'NR==1 {print $0}'`\necho -n $ifname |grep -q 'venet'\n[ $? -eq '0' ] &amp;&amp; Insatll_serverSpeeder='n' || Insatll_serverSpeeder='y'\n}\n \nfunction OWNNET()\n{\necho -ne \"\\nSelect a IP Address from \\e[33m[\\e[32m0\\e[0m.\\e[35m${MACIP}\\e[33m\/\\e[33m1\\e[0m.\\e[35m${PublicIP}\\e[33m]\\e[0m. \\nIt will be regard as default IP Address: \"\nread OWNNETIP\nif [ -n \"$OWNNETIP\" ]; then\nif [ \"$OWNNETIP\" == '0' ]; then\n    DefaultIP=\"${MACIP}\"\nelif [ \"$OWNNETIP\" == '1' ]; then\n    DefaultIP=\"${PublicIP}\"\nelse\n    OWNNET;\nfi\nelse\n    DefaultIP=\"${MACIP}\"\nfi\n}\n \nfunction ServerIP()\n{\nPublicIP=\"$(wget -qO- checkip.amazonaws.com)\"\necho -ne \"Default Server IP: \\e[36m${PublicIP}\\e[0m .\\nIf Default Server IP \\e[31mcorrect\\e[0m, Press Enter .\\nIf Default Server IP \\e[31mincorrect\\e[0m, Please input Server IP :\"\nread iptmp\nif [[ -n \"$iptmp\" ]]; then\n    PublicIP=$iptmp\nfi\nsysBits=x$(getconf LONG_BIT);\nifname=`cat \/proc\/net\/dev | awk -F: 'function trim(str){sub(\/^[ \\t]*\/,\"\",str); sub(\/[ \\t]*$\/,\"\",str); return str } NR&gt;2 {print trim($1)}'  | grep -Ev '^lo|^sit|^stf|^gif|^dummy|^vmnet|^vir|^gre|^ipip|^ppp|^bond|^tun|^tap|^ip6gre|^ip6tnl|^teql' | awk 'NR==1 {print $0}'`;\necho -n $ifname |grep -q 'venet';\n[ $? -eq '0' ] &amp;&amp; oVZ='y' || oVZ='n';\nMACIP=\"$(ifconfig $ifname |awk -F ':' '\/inet addr\/{ print $2}' |grep -o '[0-9]\\{1,3\\}.[0-9]\\{1,3\\}.[0-9]\\{1,3\\}.[0-9]\\{1,3\\}')\";\n[ \"${PublicIP}\" != \"${MACIP}\" ] &amp;&amp; OWNNET\n[ \"${PublicIP}\" == \"${MACIP}\" ] &amp;&amp; DefaultIP=\"${PublicIP}\";\necho -ne \"Server IP: \\e[35m${DefaultIP}\\e[0m .\\n\";\nMyDomain=\"${PublicIP}\"\necho -ne \"\\nIf you \\e[31mdo not have\\e[0m a domain name, \\e[33mPress Enter\\e[0m! \\nIf you \\e[31mhave\\e[0m a domain name, Please \\e[32mInput your domain name\\e[0m :\"\nread DomainTMP\nif [[ -n \"$DomainTMP\" ]]; then\n    MyDomain=$DomainTMP\n    echo -ne \"Domain name: \\e[35m$MyDomain\\e[0m .\\n\"\nfi\nDOMAIN=`echo \"$MyDomain\" |awk -F\"[.]\" '{print $(NF-1)\".\"$NF}'`\necho \"$DOMAIN\" |grep -q '[0-9]\\{1,3\\}.[0-9]\\{1,3\\}'\n[ $? -eq '0' ] &amp;&amp; DOMAIN='' || echo -ne \"\\nPlease put your \\e[33mdomain certificate\\e[0m and \\e[33mprivate key\\e[0m into \\e[33m\/etc\/ocserv\\e[0m when the shell script install finish! \\n\\e[31mrename\\e[0m \\e[33mcertificate\\e[0m with \\e[32mserver.cert.pem\\e[0m\\n\\e[31mrename\\e[0m \\e[33mprivate key\\e[0m with \\e[32mserver.key.pem\\e[0m\\n\"\n[ $oVZ == 'y' ] &amp;&amp; {\necho -ne \"\\nIt will install \\e[35mocserv\\e[0m and \\e[35mserverSpeeder\\e[0m automaticly.\" \n}\n[ $oVZ == 'n' ] &amp;&amp; {\necho -ne \"\\nIt will install \\e[35mocserv\\e[0m automaticly.\" \n}\npause;\n}\n \nfunction Ask_ocserv_port()\n{\necho -ne \"\\n\\e[35mInstall OpenConnect...\\e[0m\\n\"\nSSLTCP=443;\nSSLUDP=443;\necho -ne \"\\n\\e[35mPlease enter AnyConnet port\\e[33m[Default:\\e[32m443\\e[33m]\\e[0m: \"\nread myPORT\nif [[ -n \"$myPORT\" ]]; then\n    SSLTCP=$myPORT\n    SSLUDP=$myPORT\nfi\n}\n \nfunction Ask_ocserv_type()\n{\necho -ne \"\\n\\e[35mPlease select a type to login AnyConnet.\\e[33m[\\e[32m0\\e[0m.\\e[35mcertificate\\e[33m\/\\e[33m1\\e[0m.\\e[35mpassword\\e[33m]\\e[0m: \"\nread logintype\nif [ -n \"$logintype\" ]; then\nif [ \"$logintype\" == '0' ]; then\n    MyType='certificate'\nelif [ \"$logintype\" == '1' ]; then\n    MyType='password'\nelse\n    Ask_ocserv_type;\nfi\nelse\n    MyType='certificate'\nfi\n}\n \nfunction Ask_ocserv_password()\n{\n[ $MyType == 'certificate' ] &amp;&amp; {\nFILL1='CANAME'\nFILL2='ORGANIZATION'\n}\n[ $MyType == 'password' ] &amp;&amp; {\nFILL1='UserName'\nFILL2='PassWord'\n}\n[ -n \"$FILL1\" -a -n \"$FILL2\" ] &amp;&amp; {\nFILLIT1='MoeClub.org'\necho -ne \"\\n\\e[35mPlease input AnyConnet $FILL1\\e[33m[Default:\\e[32mMoeClub.org\\e[33m]\\e[0m: \"\nread tmpFILL1\nif [[ -n \"$tmpFILL1\" ]]; then\n    FILLIT1=$tmpFILL1\nfi\nFILLIT2='Vicer'\necho -ne \"\\n\\e[35mPlease input AnyConnet $FILL2\\e[33m[Default:\\e[32mVicer\\e[33m]\\e[0m: \"\nread tmpFILL2\nif [[ -n \"$tmpFILL2\" ]]; then\n    FILLIT2=$tmpFILL2\nfi\n}\n}\n \nfunction SYSCONF()\n{\nsed -i '\/net.ipv4.ip_forward\/d' \/etc\/sysctl.conf\necho \"net.ipv4.ip_forward = 1\" &gt;&gt; \/etc\/sysctl.conf\nsed -i '\/net.ipv4.tcp_syncookies\/d' \/etc\/sysctl.conf\necho \"net.ipv4.tcp_syncookies = 1\" &gt;&gt; \/etc\/sysctl.conf\nsed -i '\/soft nofile\/d' \/etc\/security\/limits.conf\necho \"* soft nofile 51200\" &gt;&gt; \/etc\/security\/limits.conf\nsed -i '\/hard nofile\/d' \/etc\/security\/limits.conf\necho \"* hard nofile 51200\" &gt;&gt; \/etc\/security\/limits.conf\n[ $oVZ == 'n' ] &amp;&amp; {\ncat &gt;\/etc\/sysctl.conf&lt;&lt;EOFSYS\n#This line below add by user.\n#sysctl net.ipv4.tcp_available_congestion_control\n#modprobe tcp_htcp\nnet.ipv4.ip_forward = 1\nfs.file-max = 51200\nnet.core.wmem_max = 8388608\nnet.core.rmem_max = 8388608\nnet.core.rmem_default = 131072\nnet.core.wmem_default = 131072\nnet.core.somaxconn = 4096\nnet.core.netdev_max_backlog = 65535\nnet.ipv4.tcp_rmem = 10240 81920 8388608\nnet.ipv4.tcp_wmem = 10240 81920 8388608\nnet.ipv4.tcp_mtu_probing = 1\nnet.ipv4.tcp_syncookies = 1\nnet.ipv4.tcp_tw_reuse = 1\nnet.ipv4.tcp_tw_recycle = 0\nnet.ipv4.tcp_fin_timeout = 15\nnet.ipv4.tcp_window_scaling = 1\nnet.ipv4.tcp_keepalive_time = 1200\nnet.ipv4.tcp_max_syn_backlog = 8192\nnet.ipv4.tcp_congestion_control = htcp\nnet.ipv4.icmp_echo_ignore_all = 1\n#net.ipv4.tcp_fastopen = 3\nEOFSYS\n[ -f \"\/proc\/sys\/net\/ipv4\/tcp_fastopen\" ] &amp;&amp; [ -f \/etc\/sysctl.conf ] &amp;&amp; sed -i 's\/#net.ipv4.tcp_fastopen\/net.ipv4.tcp_fastopen\/g' \/etc\/sysctl.conf\n}\nsysctl -p &gt;\/dev\/null 2&gt;&amp;1\n}\n \nfunction ins_ocserv()\n{\nBitVer='';\nmkdir -p \/tmp;\n[ $sysBits == 'x32' ] &amp;&amp; BitVer='i386'\n[ $sysBits == 'x64' ] &amp;&amp; BitVer='amd64'\n[ -n \"$BitVer\" ] &amp;&amp; {\nwget --no-check-certificate -qO \"\/tmp\/libradcli4_1.2.6-3~bpo8+1_$BitVer.deb\" \"https:\/\/moeclub.org\/attachment\/DebianPackage\/ocserv\/libradcli4_1.2.6-3~bpo8+1_$BitVer.deb\"\nwget --no-check-certificate -qO \"\/tmp\/ocserv_0.11.6-1~bpo8+2_$BitVer.deb\" \"https:\/\/moeclub.org\/attachment\/DebianPackage\/ocserv\/ocserv_0.11.6-1~bpo8+2_$BitVer.deb\"\n} || {\necho \"Error, download fail! \"\nexit 1\n}\nbash -c \"$(wget --no-check-certificate -qO- 'https:\/\/moeclub.org\/attachment\/LinuxShell\/src.sh')\"\nDEBIAN_FRONTEND=noninteractive apt-get install -y -t jessie dbus init-system-helpers libc6 libev4 libgnutls-deb0-28 libgssapi-krb5-2 libhttp-parser2.1 liblz4-1 libnettle4 libnl-3-200 libnl-route-3-200 liboath0 libopts25 libpcl1 libprotobuf-c1 libsystemd0 libtalloc2 gnutls-bin ssl-cert\ndpkg -i \/tmp\/libradcli4_*.deb\ndpkg -i \/tmp\/ocserv_*.deb\nwhich ocserv &gt;\/dev\/null 2&gt;&amp;1\n[ $? -ne '0' ] &amp;&amp; echo 'Error, Install ocerv.' &amp;&amp; exit 1\nsed -i '\/exit .*\/d' \/etc\/rc.local\nsed -i '$a\\iptables -t nat -A POSTROUTING -o '${ifname}' -j MASQUERADE' \/etc\/rc.local\nsed -i '$a\\iptables -I INPUT -p tcp --dport '${SSLTCP}' -j ACCEPT' \/etc\/rc.local\nsed -i '$a\\iptables -I INPUT -p udp --dport '${SSLUDP}' -j ACCEPT' \/etc\/rc.local\nsed -i '$a\\iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu' \/etc\/rc.local\nsed -i '$a\\exit 0' \/etc\/rc.local\ncat &gt;\/etc\/ocserv\/ocserv.conf&lt;&lt;EOF\n#Login Type\n#auth = \"plain[passwd=\/etc\/ocserv\/ocpasswd]\"\nauth = \"certificate\"\n \n# TCP and UDP port number\ntcp-port = $SSLTCP\n#udp-port = $SSLUDP\n \nserver-cert = \/etc\/ocserv\/server.cert.pem\nserver-key = \/etc\/ocserv\/server.key.pem\nca-cert = \/etc\/ocserv\/ca.cert.pem\ndh-params = \/etc\/ocserv\/dh.pem\n \nsocket-file = \/var\/run\/ocserv.socket\nocctl-socket-file = \/var\/run\/occtl.socket\npid-file = \/var\/run\/ocserv.pid\nuser-profile = \/etc\/ocserv\/profile.xml\nrun-as-user = nobody\ncert-user-oid = 2.5.4.3\nisolate-workers = false\nmax-clients = 192\nmax-same-clients = 192\nkeepalive = 32400\ndpd = 300\nmobile-dpd = 1800\n#output-buffer = 1000\ntry-mtu-discovery = true\ncompression = true\nno-compress-limit = 256\nauth-timeout = 40 \nidle-timeout = 1200\nmobile-idle-timeout = 1200\ncookie-timeout = 43200\npersistent-cookies = true\ndeny-roaming = false\nrekey-time = 43200\nrekey-method = ssl\nuse-utmp = true\nuse-occtl = true\ndevice = ocserv\npredictable-ips = false\nping-leases = false\ncisco-client-compat = true\ntls-priorities = \"NORMAL:%SERVER_PRECEDENCE:%COMPAT:-RSA:-VERS-SSL3.0:-ARCFOUR-128\"\nipv4-network = 192.168.8.0\nipv4-netmask = 255.255.255.0\ndns = 192.168.8.1\n \nEOF\ncat &gt;\/etc\/ocserv\/profile.xml&lt;&lt;EOF\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;AnyConnectProfile xmlns=\"http:\/\/schemas.xmlsoap.org\/encoding\/\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:schemaLocation=\"http:\/\/schemas.xmlsoap.org\/encoding\/ AnyConnectProfile.xsd\"&gt;\n \n &lt;ClientInitialization&gt;\n &lt;UseStartBeforeLogon UserControllable=\"false\"&gt;false&lt;\/UseStartBeforeLogon&gt;\n &lt;StrictCertificateTrust&gt;false&lt;\/StrictCertificateTrust&gt;\n &lt;RestrictPreferenceCaching&gt;false&lt;\/RestrictPreferenceCaching&gt;\n &lt;RestrictTunnelProtocols&gt;false&lt;\/RestrictTunnelProtocols&gt;\n &lt;BypassDownloader&gt;true&lt;\/BypassDownloader&gt;\n &lt;WindowsVPNEstablishment&gt;AllowRemoteUsers&lt;\/WindowsVPNEstablishment&gt;\n &lt;CertEnrollmentPin&gt;pinAllowed&lt;\/CertEnrollmentPin&gt;\n &lt;CertificateMatch&gt;\n &lt;KeyUsage&gt;\n &lt;MatchKey&gt;Digital_Signature&lt;\/MatchKey&gt;\n &lt;\/KeyUsage&gt;\n &lt;ExtendedKeyUsage&gt;\n &lt;ExtendedMatchKey&gt;ClientAuth&lt;\/ExtendedMatchKey&gt;\n &lt;\/ExtendedKeyUsage&gt;\n &lt;\/CertificateMatch&gt;\n \n &lt;BackupServerList&gt;\n             &lt;HostAddress&gt;$MyDomain&lt;\/HostAddress&gt;\n &lt;\/BackupServerList&gt;\n &lt;\/ClientInitialization&gt;\n&lt;\/AnyConnectProfile&gt;\nEOF\n \nmkdir -p \/etc\/ocserv\/template\ncat &gt;\/etc\/ocserv\/template\/ca.tmp&lt;&lt;EOF\ncn = \"$FILLIT1\"\norganization = \"$FILLIT2\"\nserial = 1\nexpiration_days = 1825\nca\nsigning_key\ncert_signing_key\ncrl_signing_key\nEOF\nopenssl genrsa -out \/etc\/ocserv\/template\/ca.key.pem 2048\ncerttool --generate-self-signed --hash SHA256 --load-privkey \/etc\/ocserv\/template\/ca.key.pem --template \/etc\/ocserv\/template\/ca.tmp --outfile \/etc\/ocserv\/ca.cert.pem\ncerttool --generate-dh-params --outfile \/etc\/ocserv\/dh.pem\n \ncat &gt;\/etc\/ocserv\/template\/server.tmp&lt;&lt;EOF\ncn = \"$MyDomain\" \norganization = \"MoeClub.org\" \nserial = 2\nexpiration_days = 1825\nsigning_key \nencryption_key\ntls_www_server\nEOF\nopenssl genrsa -out \/etc\/ocserv\/server.key.pem 2048\ncerttool --generate-certificate --hash SHA256 --load-privkey \/etc\/ocserv\/server.key.pem --load-ca-certificate \/etc\/ocserv\/ca.cert.pem --load-ca-privkey \/etc\/ocserv\/template\/ca.key.pem --template \/etc\/ocserv\/template\/server.tmp --outfile \/etc\/ocserv\/server.cert.pem\ncat \/etc\/ocserv\/ca.cert.pem &gt;&gt;\/etc\/ocserv\/server.cert.pem\n}\n \nfunction login_ocserv()\n{\n[ $MyType == 'certificate' ] &amp;&amp; {\ncat &gt;\/etc\/ocserv\/template\/user.tmp&lt;&lt;EOF\ncn = \"$FILLIT1\"\nunit = \"$FILLIT2\"\nexpiration_days = 1825\nsigning_key\ntls_www_client\nEOF\nopenssl genrsa -out \/etc\/ocserv\/template\/user.key.pem 2048\ncerttool --generate-certificate --hash SHA256 --load-privkey \/etc\/ocserv\/template\/user.key.pem --load-ca-certificate \/etc\/ocserv\/template\/ca.cert.pem --load-ca-privkey \/etc\/ocserv\/template\/ca.key.pem --template \/etc\/ocserv\/template\/user.tmp --outfile \/etc\/ocserv\/template\/user.cert.pem\ncat \/etc\/ocserv\/ca.cert.pem &gt;&gt;\/etc\/ocserv\/template\/user.cert.pem\nopenssl pkcs12 -export -inkey \/etc\/ocserv\/template\/user.key.pem -in \/etc\/ocserv\/template\/user.cert.pem -name \"Vicer\" -certfile \/etc\/ocserv\/ca.cert.pem -caname \"$FILLIT1\" -out \/etc\/ocserv\/AnyConnect.p12 -passout pass:\n[ -f \/etc\/ocserv\/ocserv.conf ] &amp;&amp; sed -i 's\/^auth =\/#auth =\/g;s\/^#auth = \"certificate\".*\/auth = \"certificate\"\/g' \/etc\/ocserv\/ocserv.conf\n}\n[ $MyType == 'password' ] &amp;&amp; {\n[ -f \/etc\/ocserv\/ocpasswd ] &amp;&amp; sed -i '\/'${FILLIT1}':\/d' \/etc\/ocserv\/ocpasswd\necho -n \"$FILLIT1:*:\" &gt;&gt;\/etc\/ocserv\/ocpasswd\nopenssl passwd \"$FILLIT2\" &gt;&gt;\/etc\/ocserv\/ocpasswd\n[ -f \/etc\/ocserv\/ocserv.conf ] &amp;&amp; sed -i 's\/^auth =\/#auth =\/g;s\/^#auth = \"plain.*\/auth = \"plain\\[passwd=\\\/etc\\\/ocserv\\\/ocpasswd\\]\"\/g' \/etc\/ocserv\/ocserv.conf\n}\n}\n \nfunction ask_ocserv()\n{\nWelcome\nAsk_ocserv_port\nAsk_ocserv_type\nAsk_ocserv_password\npause\nclear\n}\n \nfunction ins_dnsmasq()\n{\napt-get install -y dnsmasq\ncat &gt;\/etc\/dnsmasq.conf&lt;&lt;EOF\nexcept-interface=$ifname\ndhcp-range=192.168.8.2,192.168.8.254,255.255.255.0,24h\ndhcp-option-force=option:router,192.168.8.1\ndhcp-option-force=option:dns-server,192.168.8.1\ndhcp-option-force=option:netbios-ns,192.168.8.1\nlisten-address=127.0.0.1,192.168.8.1\nno-resolv\nbogus-priv\nno-negcache\nclear-on-reload\ncache-size=81920\nserver=208.67.220.220#5353\nEOF\nbash \/etc\/init.d\/dnsmasq restart\n}\n \nfunction ins_serverSpeeder()\n{\n[ $oVZ == 'n' ] &amp;&amp; {\nwget --no-check-certificate -qO \/tmp\/appex.sh \"https:\/\/raw.githubusercontent.com\/0oVicero0\/serverSpeeder_Install\/master\/appex.sh\"\n[ $? -eq '0' ] &amp;&amp; {\ninsNum=\"$(awk '\/^SelectKernel;\/{print NR}' \/tmp\/appex.sh)\"\necho \"sed -i '\/^# Set acc inf\/,\\$d' \/tmp\/appex\/install.sh\" &gt;\/tmp\/ins.tmp\necho \"echo -e 'boot=y &amp;&amp; addStartUpLink' &gt;&gt;\/tmp\/appex\/install.sh\" &gt;&gt;\/tmp\/ins.tmp\n[ -f \/tmp\/ins.tmp ] &amp;&amp; {\nsed -i ''${insNum}'r \/tmp\/ins.tmp' \/tmp\/appex.sh\nsed -i '\/^pause;$\/d' \/tmp\/appex.sh\nsed -i '\/serverSpeeder.sh status$\/d' \/tmp\/appex.sh\n}\nbash \/tmp\/appex.sh install\n}\n}\n}\n \nfunction add_user()\n{\n[ \"$(grep -c '^auth =' \/etc\/ocserv\/ocserv.conf)\" != '1' ] &amp;&amp; sed -i 's\/^auth =\/#auth =\/g;s\/^#auth = \"plain.*\/auth = \"plain\\[passwd=\\\/etc\\\/ocserv\\\/ocpasswd\\]\"\/g' \/etc\/ocserv\/ocserv.conf\nMyType='password'\nFILLIT1=\"$tmpUser\"\nFILLIT2=\"$tmpPass\"\n[ -n \"$FILLIT1\" ] &amp;&amp; [ -n \"$FILLIT2\" ] &amp;&amp; login_ocserv\n}\n \nfunction del_user()\n{\n[ -f \/etc\/ocserv\/ocpasswd ] &amp;&amp; sed -i '\/'${delUser}':\/d' \/etc\/ocserv\/ocpasswd\n}\n \nfunction ChangeType()\n{\nTheType=\"$(echo -n \"$tmpType\"|sed -r 's\/(.*)\/\\L\\1\/')\"\necho -n \"$TheType\" |grep -q '^cert'\n[ $? -eq '0' ] &amp;&amp; [ -f \/etc\/ocserv\/ocserv.conf ] &amp;&amp; sed -i 's\/^auth =\/#auth =\/g;s\/^#auth = \"certificate\".*\/auth = \"certificate\"\/g' \/etc\/ocserv\/ocserv.conf\necho -n \"$TheType\" |grep -q '^pass'\n[ $? -eq '0' ] &amp;&amp; [ -f \/etc\/ocserv\/ocserv.conf ] &amp;&amp; sed -i 's\/^auth =\/#auth =\/g;s\/^#auth = \"plain.*\/auth = \"plain\\[passwd=\\\/etc\\\/ocserv\\\/ocpasswd\\]\"\/g' \/etc\/ocserv\/ocserv.conf\n[ -e \/etc\/init.d\/ocserv ] &amp;&amp; bash \/etc\/init.d\/ocserv restart\n}\n \nfunction add_route()\n{\nsed -i '\/^route\/d' \/etc\/ocserv\/ocserv.conf\nsed -i '\/^no-route\/d' \/etc\/ocserv\/ocserv.conf\ncat &gt;&gt;\/etc\/ocserv\/ocserv.conf&lt;&lt;EOF\n## Route List\nroute = 0.0.0.0\/248.0.0.0\nroute = 8.0.0.0\/254.0.0.0\nroute = 11.0.0.0\/255.0.0.0\nroute = 12.0.0.0\/252.0.0.0\nroute = 16.0.0.0\/248.0.0.0\nroute = 24.0.0.0\/254.0.0.0\nroute = 26.0.0.0\/255.0.0.0\nroute = 27.0.0.0\/255.128.0.0\nroute = 27.128.0.0\/255.192.0.0\nroute = 27.224.0.0\/255.224.0.0\nroute = 28.0.0.0\/252.0.0.0\nroute = 32.0.0.0\/252.0.0.0\nroute = 36.0.0.0\/255.192.0.0\nroute = 36.64.0.0\/255.224.0.0\nroute = 36.224.0.0\/255.224.0.0\nroute = 37.0.0.0\/255.0.0.0\nroute = 38.0.0.0\/255.0.0.0\nroute = 39.0.0.0\/255.192.0.0\nroute = 39.96.0.0\/255.224.0.0\nroute = 39.192.0.0\/255.192.0.0\nroute = 40.0.0.0\/252.0.0.0\nroute = 44.0.0.0\/254.0.0.0\nroute = 46.0.0.0\/255.0.0.0\nroute = 47.0.0.0\/255.192.0.0\nroute = 47.64.0.0\/255.224.0.0\nroute = 47.128.0.0\/255.128.0.0\nroute = 48.0.0.0\/255.0.0.0\nroute = 49.0.0.0\/255.192.0.0\nroute = 49.96.0.0\/255.224.0.0\nroute = 49.128.0.0\/255.128.0.0\nroute = 50.0.0.0\/254.0.0.0\nroute = 52.0.0.0\/252.0.0.0\nroute = 56.0.0.0\/254.0.0.0\nroute = 58.0.0.0\/255.224.0.0\nroute = 58.64.0.0\/255.192.0.0\nroute = 58.128.0.0\/255.192.0.0\nroute = 58.224.0.0\/255.224.0.0\nroute = 59.0.0.0\/255.224.0.0\nroute = 59.64.0.0\/255.192.0.0\nroute = 59.128.0.0\/255.192.0.0\nroute = 60.32.0.0\/255.224.0.0\nroute = 60.64.0.0\/255.192.0.0\nroute = 60.128.0.0\/255.224.0.0\nroute = 60.192.0.0\/255.192.0.0\nroute = 61.0.0.0\/255.128.0.0\nroute = 61.192.0.0\/255.192.0.0\nroute = 62.0.0.0\/254.0.0.0\nroute = 64.0.0.0\/224.0.0.0\nroute = 96.0.0.0\/248.0.0.0\nroute = 104.0.0.0\/252.0.0.0\nroute = 108.0.0.0\/254.0.0.0\nroute = 110.0.0.0\/255.192.0.0\nroute = 110.64.0.0\/255.224.0.0\nroute = 110.128.0.0\/255.192.0.0\nroute = 110.224.0.0\/255.224.0.0\nroute = 111.64.0.0\/255.192.0.0\nroute = 111.160.0.0\/255.224.0.0\nroute = 111.192.0.0\/255.192.0.0\nroute = 112.64.0.0\/255.192.0.0\nroute = 112.128.0.0\/255.192.0.0\nroute = 112.192.0.0\/255.224.0.0\nroute = 113.0.0.0\/255.192.0.0\nroute = 113.128.0.0\/255.128.0.0\nroute = 114.0.0.0\/255.128.0.0\nroute = 114.128.0.0\/255.192.0.0\nroute = 114.192.0.0\/255.224.0.0\nroute = 115.0.0.0\/255.128.0.0\nroute = 115.128.0.0\/255.192.0.0\nroute = 115.224.0.0\/255.224.0.0\nroute = 116.0.0.0\/255.128.0.0\nroute = 116.192.0.0\/255.192.0.0\nroute = 117.0.0.0\/255.128.0.0\nroute = 117.192.0.0\/255.192.0.0\nroute = 118.0.0.0\/254.0.0.0\nroute = 120.0.0.0\/255.128.0.0\nroute = 120.128.0.0\/255.192.0.0\nroute = 121.0.0.0\/255.240.0.0\nroute = 121.16.0.0\/255.240.0.0\nroute = 121.32.0.0\/255.240.0.0\nroute = 121.48.0.0\/255.254.0.0\nroute = 121.50.0.0\/255.255.0.0\nroute = 121.52.0.0\/255.252.0.0\nroute = 121.56.0.0\/255.248.0.0\nroute = 121.64.0.0\/255.192.0.0\nroute = 121.128.0.0\/255.128.0.0\nroute = 122.0.0.0\/255.192.0.0\nroute = 122.96.0.0\/255.224.0.0\nroute = 122.128.0.0\/255.128.0.0\nroute = 123.0.0.0\/255.192.0.0\nroute = 123.96.0.0\/255.224.0.0\nroute = 123.128.0.0\/255.128.0.0\nroute = 124.0.0.0\/255.0.0.0\nroute = 125.0.0.0\/255.192.0.0\nroute = 125.96.0.0\/255.224.0.0\nroute = 125.128.0.0\/255.128.0.0\nroute = 126.0.0.0\/254.0.0.0\nroute = 128.0.0.0\/248.0.0.0\nroute = 136.0.0.0\/252.0.0.0\nroute = 140.0.0.0\/255.128.0.0\nroute = 140.128.0.0\/255.192.0.0\nroute = 140.192.0.0\/255.248.0.0\nroute = 140.200.0.0\/255.252.0.0\nroute = 140.204.0.0\/255.255.0.0\nroute = 140.208.0.0\/255.240.0.0\nroute = 140.224.0.0\/255.224.0.0\nroute = 141.0.0.0\/255.0.0.0\nroute = 142.0.0.0\/254.0.0.0\nroute = 144.0.0.0\/240.0.0.0\nroute = 160.0.0.0\/248.0.0.0\nroute = 168.0.0.0\/255.128.0.0\nroute = 168.128.0.0\/255.192.0.0\nroute = 168.192.0.0\/255.224.0.0\nroute = 168.224.0.0\/255.240.0.0\nroute = 168.240.0.0\/255.248.0.0\nroute = 168.248.0.0\/255.252.0.0\nroute = 168.252.0.0\/255.254.0.0\nroute = 168.255.0.0\/255.255.0.0\nroute = 169.0.0.0\/255.0.0.0\nroute = 170.0.0.0\/254.0.0.0\nroute = 172.0.0.0\/255.240.0.0\nroute = 172.32.0.0\/255.224.0.0\nroute = 172.64.0.0\/255.192.0.0\nroute = 172.128.0.0\/255.128.0.0\nroute = 173.0.0.0\/255.0.0.0\nroute = 174.0.0.0\/255.0.0.0\nroute = 175.0.0.0\/255.192.0.0\nroute = 175.96.0.0\/255.224.0.0\nroute = 175.128.0.0\/255.128.0.0\nroute = 176.0.0.0\/252.0.0.0\nroute = 180.0.0.0\/255.192.0.0\nroute = 180.64.0.0\/255.224.0.0\nroute = 180.128.0.0\/255.128.0.0\nroute = 181.0.0.0\/255.0.0.0\nroute = 182.0.0.0\/255.192.0.0\nroute = 182.64.0.0\/255.224.0.0\nroute = 182.128.0.0\/255.128.0.0\nroute = 183.64.0.0\/255.192.0.0\nroute = 183.160.0.0\/255.224.0.0\nroute = 184.0.0.0\/248.0.0.0\nroute = 192.0.0.0\/255.128.0.0\nroute = 192.128.0.0\/255.224.0.0\nroute = 192.160.0.0\/255.248.0.0\nroute = 192.169.0.0\/255.255.0.0\nroute = 192.170.0.0\/255.254.0.0\nroute = 192.172.0.0\/255.252.0.0\nroute = 192.176.0.0\/255.240.0.0\nroute = 192.192.0.0\/255.192.0.0\nroute = 193.0.0.0\/255.0.0.0\nroute = 194.0.0.0\/254.0.0.0\nroute = 196.0.0.0\/252.0.0.0\nroute = 200.0.0.0\/248.0.0.0\nroute = 208.0.0.0\/248.0.0.0\nroute = 216.0.0.0\/254.0.0.0\nroute = 218.32.0.0\/255.224.0.0\nroute = 218.96.0.0\/255.224.0.0\nroute = 218.128.0.0\/255.128.0.0\nroute = 219.0.0.0\/255.128.0.0\nroute = 219.160.0.0\/255.224.0.0\nroute = 219.192.0.0\/255.192.0.0\nroute = 220.0.0.0\/255.128.0.0\nroute = 220.128.0.0\/255.224.0.0\nroute = 220.192.0.0\/255.192.0.0\nroute = 221.0.0.0\/255.0.0.0\nroute = 222.0.0.0\/255.224.0.0\nroute = 222.96.0.0\/255.224.0.0\nroute = 222.128.0.0\/255.192.0.0\nroute = 222.224.0.0\/255.224.0.0\nroute = 223.0.0.0\/255.192.0.0\nroute = 223.96.0.0\/255.224.0.0\nroute = 223.128.0.0\/255.128.0.0\nroute = 224.0.0.0\/224.0.0.0\nEOF\n[ -e \/etc\/init.d\/ocserv ] &amp;&amp; bash \/etc\/init.d\/ocserv restart\n}\n \nfunction add_noroute()\n{\nsed -i '\/^route\/d' \/etc\/ocserv\/ocserv.conf\nsed -i '\/^no-route\/d' \/etc\/ocserv\/ocserv.conf\nPublicIP=\"$(wget -qO- checkip.amazonaws.com)\"\ncat &gt;&gt;\/etc\/ocserv\/ocserv.conf&lt;&lt;EOF\n## No Route List\nno-route = $PublicIP\/255.255.255.255\nno-route = 192.168.0.0\/255.255.0.0\n \nno-route = 1.0.0.0\/255.192.0.0\nno-route = 1.64.0.0\/255.224.0.0\nno-route = 1.112.0.0\/255.248.0.0\nno-route = 1.176.0.0\/255.240.0.0\nno-route = 1.192.0.0\/255.240.0.0\nno-route = 14.0.0.0\/255.224.0.0\nno-route = 14.96.0.0\/255.224.0.0\nno-route = 14.128.0.0\/255.224.0.0\nno-route = 14.192.0.0\/255.224.0.0\nno-route = 27.0.0.0\/255.192.0.0\nno-route = 27.96.0.0\/255.224.0.0\nno-route = 27.128.0.0\/255.224.0.0\nno-route = 27.176.0.0\/255.240.0.0\nno-route = 27.192.0.0\/255.224.0.0\nno-route = 27.224.0.0\/255.252.0.0\nno-route = 36.0.0.0\/255.192.0.0\nno-route = 36.96.0.0\/255.224.0.0\nno-route = 36.128.0.0\/255.192.0.0\nno-route = 36.192.0.0\/255.224.0.0\nno-route = 36.240.0.0\/255.240.0.0\nno-route = 39.0.0.0\/255.255.0.0\nno-route = 39.64.0.0\/255.224.0.0\nno-route = 39.96.0.0\/255.240.0.0\nno-route = 39.128.0.0\/255.192.0.0\nno-route = 40.72.0.0\/255.254.0.0\nno-route = 40.124.0.0\/255.252.0.0\nno-route = 42.0.0.0\/255.248.0.0\nno-route = 42.48.0.0\/255.240.0.0\nno-route = 42.80.0.0\/255.240.0.0\nno-route = 42.96.0.0\/255.224.0.0\nno-route = 42.128.0.0\/255.128.0.0\nno-route = 43.224.0.0\/255.224.0.0\nno-route = 45.65.16.0\/255.255.240.0\nno-route = 45.112.0.0\/255.240.0.0\nno-route = 45.248.0.0\/255.248.0.0\nno-route = 47.92.0.0\/255.252.0.0\nno-route = 47.96.0.0\/255.224.0.0\nno-route = 49.0.0.0\/255.128.0.0\nno-route = 49.128.0.0\/255.224.0.0\nno-route = 49.192.0.0\/255.192.0.0\nno-route = 52.80.0.0\/255.252.0.0\nno-route = 54.222.0.0\/255.254.0.0\nno-route = 58.0.0.0\/255.128.0.0\nno-route = 58.128.0.0\/255.224.0.0\nno-route = 58.192.0.0\/255.224.0.0\nno-route = 58.240.0.0\/255.240.0.0\nno-route = 59.32.0.0\/255.224.0.0\nno-route = 59.64.0.0\/255.224.0.0\nno-route = 59.96.0.0\/255.240.0.0\nno-route = 59.144.0.0\/255.240.0.0\nno-route = 59.160.0.0\/255.224.0.0\nno-route = 59.192.0.0\/255.192.0.0\nno-route = 60.0.0.0\/255.224.0.0\nno-route = 60.48.0.0\/255.240.0.0\nno-route = 60.160.0.0\/255.224.0.0\nno-route = 60.192.0.0\/255.192.0.0\nno-route = 61.0.0.0\/255.192.0.0\nno-route = 61.80.0.0\/255.248.0.0\nno-route = 61.128.0.0\/255.192.0.0\nno-route = 61.224.0.0\/255.224.0.0\nno-route = 91.234.36.0\/255.255.255.0\nno-route = 101.0.0.0\/255.128.0.0\nno-route = 101.128.0.0\/255.224.0.0\nno-route = 101.192.0.0\/255.240.0.0\nno-route = 101.224.0.0\/255.224.0.0\nno-route = 103.0.0.0\/255.0.0.0\nno-route = 106.0.0.0\/255.128.0.0\nno-route = 106.224.0.0\/255.240.0.0\nno-route = 110.0.0.0\/255.128.0.0\nno-route = 110.144.0.0\/255.240.0.0\nno-route = 110.160.0.0\/255.224.0.0\nno-route = 110.192.0.0\/255.192.0.0\nno-route = 111.0.0.0\/255.192.0.0\nno-route = 111.64.0.0\/255.224.0.0\nno-route = 111.112.0.0\/255.240.0.0\nno-route = 111.128.0.0\/255.192.0.0\nno-route = 111.192.0.0\/255.224.0.0\nno-route = 111.224.0.0\/255.240.0.0\nno-route = 112.0.0.0\/255.128.0.0\nno-route = 112.128.0.0\/255.240.0.0\nno-route = 112.192.0.0\/255.252.0.0\nno-route = 112.224.0.0\/255.224.0.0\nno-route = 113.0.0.0\/255.128.0.0\nno-route = 113.128.0.0\/255.240.0.0\nno-route = 113.192.0.0\/255.192.0.0\nno-route = 114.16.0.0\/255.240.0.0\nno-route = 114.48.0.0\/255.240.0.0\nno-route = 114.64.0.0\/255.192.0.0\nno-route = 114.128.0.0\/255.240.0.0\nno-route = 114.192.0.0\/255.192.0.0\nno-route = 115.0.0.0\/255.0.0.0\nno-route = 116.0.0.0\/255.0.0.0\nno-route = 117.0.0.0\/255.128.0.0\nno-route = 117.128.0.0\/255.192.0.0\nno-route = 118.16.0.0\/255.240.0.0\nno-route = 118.64.0.0\/255.192.0.0\nno-route = 118.128.0.0\/255.128.0.0\nno-route = 119.0.0.0\/255.128.0.0\nno-route = 119.128.0.0\/255.192.0.0\nno-route = 119.224.0.0\/255.224.0.0\nno-route = 120.0.0.0\/255.192.0.0\nno-route = 120.64.0.0\/255.224.0.0\nno-route = 120.128.0.0\/255.240.0.0\nno-route = 120.192.0.0\/255.192.0.0\nno-route = 121.0.0.0\/255.128.0.0\nno-route = 121.192.0.0\/255.192.0.0\nno-route = 122.0.0.0\/254.0.0.0\nno-route = 124.0.0.0\/255.0.0.0\nno-route = 125.0.0.0\/255.128.0.0\nno-route = 125.160.0.0\/255.224.0.0\nno-route = 125.192.0.0\/255.192.0.0\nno-route = 137.59.59.0\/255.255.255.0\nno-route = 137.59.88.0\/255.255.252.0\nno-route = 139.0.0.0\/255.224.0.0\nno-route = 139.128.0.0\/255.128.0.0\nno-route = 140.64.0.0\/255.240.0.0\nno-route = 140.128.0.0\/255.240.0.0\nno-route = 140.192.0.0\/255.192.0.0\nno-route = 144.0.0.0\/255.248.0.0\nno-route = 144.12.0.0\/255.255.0.0\nno-route = 144.48.0.0\/255.248.0.0\nno-route = 144.123.0.0\/255.255.0.0\nno-route = 144.255.0.0\/255.255.0.0\nno-route = 146.196.0.0\/255.255.128.0\nno-route = 150.0.0.0\/255.255.0.0\nno-route = 150.96.0.0\/255.224.0.0\nno-route = 150.128.0.0\/255.240.0.0\nno-route = 150.192.0.0\/255.192.0.0\nno-route = 152.104.128.0\/255.255.128.0\nno-route = 153.0.0.0\/255.192.0.0\nno-route = 153.96.0.0\/255.224.0.0\nno-route = 157.0.0.0\/255.255.0.0\nno-route = 157.18.0.0\/255.255.0.0\nno-route = 157.61.0.0\/255.255.0.0\nno-route = 157.112.0.0\/255.240.0.0\nno-route = 157.144.0.0\/255.240.0.0\nno-route = 157.255.0.0\/255.255.0.0\nno-route = 159.226.0.0\/255.255.0.0\nno-route = 160.19.0.0\/255.255.0.0\nno-route = 160.20.48.0\/255.255.252.0\nno-route = 160.202.0.0\/255.255.0.0\nno-route = 160.238.64.0\/255.255.252.0\nno-route = 161.207.0.0\/255.255.0.0\nno-route = 162.105.0.0\/255.255.0.0\nno-route = 163.0.0.0\/255.192.0.0\nno-route = 163.96.0.0\/255.224.0.0\nno-route = 163.128.0.0\/255.192.0.0\nno-route = 163.192.0.0\/255.224.0.0\nno-route = 164.52.0.0\/255.255.128.0\nno-route = 166.111.0.0\/255.255.0.0\nno-route = 167.139.0.0\/255.255.0.0\nno-route = 167.189.0.0\/255.255.0.0\nno-route = 167.220.244.0\/255.255.252.0\nno-route = 168.160.0.0\/255.255.0.0\nno-route = 170.179.0.0\/255.255.0.0\nno-route = 171.0.0.0\/255.128.0.0\nno-route = 171.192.0.0\/255.224.0.0\nno-route = 175.0.0.0\/255.128.0.0\nno-route = 175.128.0.0\/255.192.0.0\nno-route = 180.64.0.0\/255.192.0.0\nno-route = 180.128.0.0\/255.128.0.0\nno-route = 182.0.0.0\/255.0.0.0\nno-route = 183.0.0.0\/255.192.0.0\nno-route = 183.64.0.0\/255.224.0.0\nno-route = 183.128.0.0\/255.128.0.0\nno-route = 192.124.154.0\/255.255.255.0\nno-route = 192.140.128.0\/255.255.128.0\nno-route = 202.0.0.0\/255.128.0.0\nno-route = 202.128.0.0\/255.192.0.0\nno-route = 202.192.0.0\/255.224.0.0\nno-route = 203.0.0.0\/255.0.0.0\nno-route = 210.0.0.0\/255.192.0.0\nno-route = 210.64.0.0\/255.224.0.0\nno-route = 210.160.0.0\/255.224.0.0\nno-route = 210.192.0.0\/255.224.0.0\nno-route = 211.64.0.0\/255.248.0.0\nno-route = 211.80.0.0\/255.240.0.0\nno-route = 211.96.0.0\/255.248.0.0\nno-route = 211.136.0.0\/255.248.0.0\nno-route = 211.144.0.0\/255.240.0.0\nno-route = 211.160.0.0\/255.248.0.0\nno-route = 216.250.108.0\/255.255.252.0\nno-route = 218.0.0.0\/255.128.0.0\nno-route = 218.160.0.0\/255.224.0.0\nno-route = 218.192.0.0\/255.192.0.0\nno-route = 219.64.0.0\/255.224.0.0\nno-route = 219.128.0.0\/255.224.0.0\nno-route = 219.192.0.0\/255.192.0.0\nno-route = 220.96.0.0\/255.224.0.0\nno-route = 220.128.0.0\/255.128.0.0\nno-route = 221.0.0.0\/255.224.0.0\nno-route = 221.96.0.0\/255.224.0.0\nno-route = 221.128.0.0\/255.128.0.0\nno-route = 222.0.0.0\/255.0.0.0\nno-route = 223.0.0.0\/255.224.0.0\nno-route = 223.64.0.0\/255.192.0.0\nno-route = 223.128.0.0\/255.128.0.0\nEOF\n[ -e \/etc\/init.d\/ocserv ] &amp;&amp; bash \/etc\/init.d\/ocserv restart\n}\n \nfunction ins_all()\n{\nWelcome\nServerIP\nask_ocserv\nins_ocserv\nlogin_ocserv\nins_dnsmasq\nins_serverSpeeder\nSYSCONF\nins_Finish\n}\n \nfunction ins_Finish()\n{\ngrep '^iptables' \/etc\/rc.local &gt;\/tmp\/iptables.tmp\n[ -f \/tmp\/iptables.tmp ] &amp;&amp; bash \/tmp\/iptables.tmp\n[ -e \/etc\/init.d\/dnsmasq ] &amp;&amp; bash \/etc\/init.d\/dnsmasq restart\n[ -e \/etc\/init.d\/ocserv ] &amp;&amp; bash \/etc\/init.d\/ocserv restart\n[ -e \/etc\/init.d\/serverSpeeder ] &amp;&amp; bash \/etc\/init.d\/serverSpeeder restart\nrm -rf \/tmp\/*.tmp\n}\n \n[ $# -eq '0' ] &amp;&amp; ins_all\nins_it='0';\naddroute='0';\naddnoroute='0';\nadduser='0';\ndelUser='0';\nUseType='0';\ntmpUser=\"\";\ntmpPass=\"\";\ntmpType=\"\";\nwhile [[ $# -ge 1 ]]; do\n  case $1 in\n    -i|ins|-ins|install|-install)\n      shift\n      ins_it='1'\n      ;;\n    -u|u|use|-use)\n      shift\n      UseType='1'\n      tmpType=\"$1\"\n      shift\n      ;;\n    -a|a|-add|add)\n      shift\n      adduser='1'\n      tmpUser=\"$1\"\n      shift\n      tmpPass=\"$1\"\n      shift\n      ;;\n    -d|d|-del|del)\n      shift\n      delUser='1'\n      tmpUser=\"$1\"\n      shift\n      ;;\n    -route|route)\n      shift\n      addroute=\"1\"\n      ;;\n    -noroute|noroute)\n      shift\n      addnoroute=\"1\"\n      ;;\n    *)\n      echo -ne \" Usage:\\n\\tbash $0\\t\\n\"\n      exit 1;\n      ;;\n    esac\n  done\n \n[ \"$ins_it\" == '1' ] &amp;&amp; ins_all;\n[ \"$addroute\" == '1' ] &amp;&amp; add_route;\n[ \"$addnoroute\" == '1' ] &amp;&amp; add_noroute;\n[ \"$UseType\" == '1' ] &amp;&amp; [ -n \"$tmpType\" ] &amp;&amp; ChangeType;\n[ \"$delUser\" == '1' ] &amp;&amp; [ -n \"$tmpUser\" ] &amp;&amp; del_user;\n[ \"$adduser\" == '1' ] &amp;&amp; [ -n \"$tmpUser\" ] &amp;&amp; [ -n \"$tmpPass\" ] &amp;&amp; add_user;<\/code><\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\t\t\t\t\t\t&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"http:\/\/www.zhangyijun.com\/?p=131\">\u9605\u8bfb\u66f4\u591a<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-131","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=\/wp\/v2\/posts\/131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=131"}],"version-history":[{"count":0,"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=\/wp\/v2\/posts\/131\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zhangyijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}