Skip to content

Instantly share code, notes, and snippets.

@alsotang
Created September 13, 2021 14:10
Show Gist options
  • Save alsotang/539328adce8fe6af5d02d29b0b4f9e23 to your computer and use it in GitHub Desktop.
Save alsotang/539328adce8fe6af5d02d29b0b4f9e23 to your computer and use it in GitHub Desktop.
华硕路由器的科学上网插件与访客网络冲突的解决办法
# 新建一个这个文件,给 chmod +x 权限,放到此位置:/jffs/.koolshare/ss/postscripts/P01iptables.sh
#!/bin/sh
# shadowsocks script for HND/AXHND router with kernel 4.1.27/4.1.51 merlin firmware
# 此脚本是一个示例,实际写法按照自己的方法来做
# 更改此脚本的名字,保证此脚本的名字格式是: P+数字+名字.sh
# 例如在/koolshare/ss/postscripts下放入两个脚本:P01V2xxx.sh, P99Brook.sh
# SS插件运行后货自动按照数字从小到大顺序运行 P01xxx.sh start, P99Brook.sh start
# SS插件关闭前会自动按照数字从大到小顺序运行 P99Brook.sh stop, P01xxx.sh stop
#------------------------------------------
# 读取所有SS配置,1.6.0版本及其以后插件,请用此方法获取配置,以前的方法可能导致配置获取不全
source /koolshare/scripts/ss_base.sh
#------------------------------------------
start_xxx(){
iptables -t nat -I SHADOWSOCKS -p tcp -s "192.168.101.0/24" -j RETURN
}
stop_xxx(){
iptables -t nat -D SHADOWSOCKS -p tcp -s "192.168.101.0/24" -j RETURN
}
#------------------------------------------
case $1 in
start)
start_xxx
;;
stop)
stop_xxx
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment