Procházet zdrojové kódy

wgmtu脚本添加命令行帮助;蘭雅sRGB Youtebe频道导航

hongwenjun před 6 roky
rodič
revize
6a52b98658

+ 1 - 1
README.md

@@ -3,7 +3,7 @@
     # curl脚本可以使用菜单,方便选择 # wget脚本是静默安装 # 目前 WireGuard 脚本支持 IPV6,稳定有待测试
     # wget -qO- git.io/vps.sh | bash
 
-- [蘭雅sRGB YouTube频道](https://www.youtube.com/channel/UCupRwki_4n87nrwP0GIBUXA/videos) 可以看到更多相关工具的演示视频!
+- [蘭雅sRGB![](https://raw.githubusercontent.com/hongwenjun/vps_setup/master/img/youtube.png)频道](https://www.youtube.com/channel/UCupRwki_4n87nrwP0GIBUXA/videos)    可以看相关脚本工具的演示视频!
 
 | [一键安装 WireGuard 脚本](https://github.com/hongwenjun/vps_setup/blob/master/Wireguard/README.md) |[一键安装 Shadowsocks 脚本](https://github.com/hongwenjun/vps_setup/blob/master/shadowsocks/README.md) | [V2Ray 官方一键脚本](https://github.com/hongwenjun/vps_setup/blob/master/v2ray/README.md) |
 | :------:| :------: | :------: |

+ 2 - 0
Wireguard/README.md

@@ -1,3 +1,5 @@
+- [蘭雅sRGB![](https://raw.githubusercontent.com/hongwenjun/vps_setup/master/img/youtube.png)频道](https://www.youtube.com/channel/UCupRwki_4n87nrwP0GIBUXA/videos)    可以观看相关脚本工具的演示视频!
+
 ## 一键安装wireguard 脚本(支持IPV6) For Debian_9  Ubuntu  Centos_7
 ```
 # 一键安装wireguard 脚本 Debian 9 (源:逗比网安装笔记)

+ 2 - 2
Wireguard/wg5clients.sh

@@ -101,8 +101,8 @@ cat <<EOF >wg0.conf
 [Interface]
 PrivateKey = $(cat sprivatekey)
 Address = 10.0.0.1/24,  ${ipv6_range}1/64
-PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
-PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
+PostUp   = iptables -I FORWARD -i wg0 -j ACCEPT; iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT; ip6tables -I FORWARD -i wg0 -j ACCEPT; ip6tables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
+PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -D FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
 ListenPort = $port
 DNS = 8.8.8.8, 2001:4860:4860::8888
 MTU = $mtu

+ 33 - 5
Wireguard/wgmtu.sh

@@ -286,7 +286,7 @@ udp2raw_update()
     mv speederv2_amd64 /usr/bin/speederv2
     rm speederv2* -rf
     rm version.txt
-    
+
     systemctl restart rc-local
     ps aux | grep -e kcp -e udp -e speed
 }
@@ -295,7 +295,7 @@ rc-local_remove(){
    echo -e "${RedBG}   卸载Udp2Raw套接服务配置 /etc/rc.local ${Font}"
    systemctl stop rc-local
    rm /usr/bin/udp2raw  /usr/bin/kcp-server  /usr/bin/speederv2
-   ps aux | grep -e kcp -e udp -e speed 
+   ps aux | grep -e kcp -e udp -e speed
    mv  /etc/rc.local  ~/rc.local
    echo -e "${RedBG}   卸载完成,备份在 /root/rc.local  ${Font}"
 }
@@ -459,6 +459,9 @@ start_menu(){
     echo -e ">  7. Vps_Setup 一键脚本 藏经阁"
     echo -e ">  8. ${RedBG}  IPTABLES 防火墙设置脚本  ${Font}"
     echo
+    echo_SkyBlue  "Usage: ${GreenBG} bash wgmtu ${SkyBlue} [ setup | remove | vps | bench | -U ] "
+    echo_SkyBlue                      "                    [ v2ray | vnstat | log | trace | -h ] "
+    echo
     read -p "请输入数字(1-8):" num
     case "$num" in
         1)
@@ -496,7 +499,15 @@ start_menu(){
         esac
 }
 
-# WireGuard 管理使用命令 bash wgmtu
+wgmtu_help(){
+    echo_SkyBlue  "Usage: ${GreenBG} bash wgmtu ${SkyBlue} [ setup | remove | vps | bench | -U ] "
+    echo_SkyBlue                      "                    [ v2ray | vnstat | log | trace | -h ] "
+    echo
+    echo_Yellow "[setup 惊喜 | remove 卸载 | vps 脚本 | bench 基准测试 | -U 更新]"
+    echo_Yellow "[v2ray 你懂 | vnstat 流量 | log 信息 | trace 网络回程 | -h 帮助]"
+}
+
+# WireGuard 管理命令 bash wgmtu 命令行参数
 if [[ $# > 0 ]]; then
     key="$1"
     case $key in
@@ -511,11 +522,28 @@ if [[ $# > 0 ]]; then
         scp_conf
         ;;
         -U)
-        update_remove_menu
         update_self
         ;;
         -h)
-        echo_SkyBlue  "Usage: ${GreenBG} bash wgmtu ${SkyBlue} [ setup | remove | -U | -h ] "
+        wgmtu_help
+        ;;
+        vps)
+        bash <(curl -L -s https://git.io/vps.sh)
+        ;;
+        vnstat)
+        wget -qO- git.io/fxxlb | bash
+        ;;
+        bench)
+        wget -qO- git.io/superbench.sh | bash
+        ;;
+        trace)
+        wget -qO- git.io/fp5lf | bash
+        ;;
+        v2ray)
+        bash <(curl -L -s https://git.io/v2ray.ss)
+        ;;
+        log)
+        cat vps_setup.log
         ;;
     esac
 else

+ 2 - 2
debian_wg_vpn.sh

@@ -1,5 +1,7 @@
 #!/bin/bash
 
+# https://www.wireguard.com/install/
+
 # 高速新VPN协议WireGuard服务端一键脚本
 # GCP香港  和 Vutrl  搬瓦工 测试可用,已经添加自动判断网卡名
 # OpenVZ  PVE 不能用
@@ -8,8 +10,6 @@
 # https://tunsafe.com/download
 
 # Debian9  安装 WireGuard 步骤
-# 详细参考逗比  https://doub.io/wg-jc1/
-
 
 debian_wireguard_install(){
 

binární
img/youtube.png


+ 1 - 1
netlog.sh

@@ -74,7 +74,7 @@ vnstat_install(){
 		systemctl restart crond
 	fi
 	rm -f crontab.txt
-
+    echo "vnstat conf @ /etc/vnstat.conf"
 }
 
 # 首次运行脚本需要安装

+ 2 - 1
openwrt-18.06.2/README.md

@@ -1,5 +1,6 @@
 ## OpenWRT 安装 WireGuard 配置 Udp2Raw + UdpSpeeder + WireGuard 文档教程
-- 短网址: https://git.io/wrt.wg           [蘭雅sRGB YouTube频道](https://www.youtube.com/channel/UCupRwki_4n87nrwP0GIBUXA/videos)
+- 短网址: https://git.io/wrt.wg  &nbsp;&nbsp;&nbsp; [蘭雅sRGB![](https://raw.githubusercontent.com/hongwenjun/vps_setup/master/img/youtube.png)频道](https://www.youtube.com/channel/UCupRwki_4n87nrwP0GIBUXA/videos) &nbsp;&nbsp;&nbsp;可以观看相关脚本工具的演示视频!
+
 - OpenWRT-18.06.2 编译完成的 udp2raw-tunne udpspeeder luci-udptools [安装包下载](https://github.com/hongwenjun/vps_setup/blob/master/openwrt-18.06.2/openwrt_udptools.zip)
 - [openwrt_udptools.zip](https://github.com/hongwenjun/vps_setup/blob/master/openwrt-18.06.2/openwrt_udptools.zip)
 -----------------

+ 18 - 5
safe_iptables.sh

@@ -61,6 +61,12 @@ disable_ipv6(){
     echo 1 > /proc/sys/net/ipv6/conf/${ni}/disable_ipv6
 }
 
+# 恢复网卡IPV6功能
+enable_ipv6(){
+    ni=$(ls /sys/class/net | awk {print} | grep -e eth. -e ens. -e venet.)
+    echo 0 > /proc/sys/net/ipv6/conf/${ni}/disable_ipv6
+}
+
 no_use_passwd(){
     # 禁用密码登陆
     sed -i "s/PasswordAuthentication.*/PasswordAuthentication no/g"    /etc/ssh/sshd_config
@@ -93,7 +99,8 @@ hide_menu(){
     echo -e ">  3. frps_iptables 防火墙规则"
     echo -e ">  4. 菜单项1-2-3全功能开放"
     echo -e ">  5. 使用临时${GreenBG} srgb18.ga ${Font}${Green}域名(更新脚本)"
-    echo -e ">  6. ${RedBG}禁止使用密码远程SSH登陆${Font}"
+    echo -e ">  6. ${GreenBG} 恢复网卡IPV6功能 ${Font}"
+    echo -e ">  7. ${RedBG} 禁止使用密码远程SSH登陆 ${Font}"
     echo
     read -p "请输入数字(1-6):" num_x
     case "$num_x" in
@@ -114,6 +121,9 @@ hide_menu(){
         srgb18_ga_ddns
         ;;
         6)
+        enable_ipv6
+        ;;
+        7)
         no_use_passwd
         ;;
         *)
@@ -183,7 +193,7 @@ safe_iptables(){
     iptables -A INPUT -p tcp -m tcp --dport 22  -j ACCEPT
     iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
     iptables -A INPUT -j DROP
-    iptables -P FORWARD DROP
+    iptables -P FORWARD  DROP
     iptables -P OUTPUT  ACCEPT
 }
 
@@ -249,10 +259,13 @@ no_ping(){
     iptables -D INPUT -p icmp --icmp-type echo-request -j ACCEPT
 }
 
+# 关闭防火墙命令 iptables -F
 no_iptables(){
-    # Debian 和 Centos 关闭防火墙命令分别是
-    iptables -F  && iptables-save > /etc/iptables/rules.v4   >/dev/null 2>&1
-    iptables -F  && service iptables save                    >/dev/null 2>&1
+    iptables -P INPUT ACCEPT
+    iptables -P FORWARD ACCEPT
+    iptables -F
+
+    save_iptables
 }
 
 # 设置菜单

+ 3 - 1
shadowsocks/README.md

@@ -1,3 +1,5 @@
+- [蘭雅sRGB![](https://raw.githubusercontent.com/hongwenjun/vps_setup/master/img/youtube.png)频道](https://www.youtube.com/channel/UCupRwki_4n87nrwP0GIBUXA/videos) &nbsp;&nbsp;&nbsp;可以观看相关脚本工具的演示视频!
+
 # 一键安装shadowsocks-libev脚本 For Debian_9  Ubuntu  Centos_7
 ```
 # 一键安装shadowsocks-libev
@@ -14,7 +16,7 @@ ss-server -s 0.0.0.0 -p 40000 -k ${PASSWORD} -m aes-256-gcm -t 300 >> /var/log/s
 ```
 ### 基于alipine构建的shadowsocks-libev服务 -- Docker安装
   https://hub.docker.com/r/taterli/shadowsocks-tiny
-  
+
 ### V2Ray和Shadowsocks配置显示二维码  短网址: https://git.io/v2ray.ss
 ![](https://raw.githubusercontent.com/hongwenjun/vps_setup/master/v2ray/v2ray.ss.png)
 

+ 3 - 4
ubuntu_wireguard_install.sh

@@ -7,7 +7,6 @@
 # https://tunsafe.com/download
 
 # Ubuntu  安装 WireGuard 步骤
-# 详细参考逗比  https://doub.io/wg-jc1/
 
 # 更新软件包源
 apt update
@@ -45,7 +44,7 @@ echo "[Interface]
 PrivateKey = $(cat sprivatekey)
 
 # VPN中本机的内网IP,一般默认即可,除非和你服务器或客户端设备本地网段冲突
-Address = 10.0.0.1/24 
+Address = 10.0.0.1/24
 
 # 运行 WireGuard 时要执行的 iptables 防火墙规则,用于打开NAT转发之类的。
 # 如果你的服务器主网卡名称不是 eth0 ,那么请修改下面防火墙规则中最后的 eth0 为你的主网卡名称。
@@ -111,7 +110,7 @@ PersistentKeepalive = 25"|sed '/^#/d;/^\s*$/d' > client.conf
 
 # 赋予配置文件夹权限
 chmod 777 -R /etc/wireguard
- 
+
 sysctl_config() {
     sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
     sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
@@ -140,5 +139,5 @@ wg
 
 # 以上配置文本只是参考文档使用,实际调用另一脚本生成配置
 
-# 一键 WireGuard 多用户配置共享脚本 
+# 一键 WireGuard 多用户配置共享脚本
 wget -qO- https://git.io/fpnQt | bash

+ 2 - 0
v2ray/README.md

@@ -1,3 +1,5 @@
+- [蘭雅sRGB![](https://raw.githubusercontent.com/hongwenjun/vps_setup/master/img/youtube.png)频道](https://www.youtube.com/channel/UCupRwki_4n87nrwP0GIBUXA/videos) &nbsp;&nbsp;&nbsp;可以观看相关脚本工具的演示视频!
+
 ### V2Ray官方提供了一个在 Linux 服务端 自动化安装脚本。
 ```
 ###  V2Ray官方一键脚本