甲骨文韩国首尔,利用iptables设置端口转发的shell脚本

728次阅读
没有评论

共计 1027 个字符,预计需要花费 3 分钟才能阅读完成。

甲骨文韩国首尔,墙中墙。利用端口转发分流

项目作用

  1. 便捷地设置 iptables 流量转发规则
  2. 当域名解析的地址发生变化时,自动更新流量转发规则,不需要手动变更(适用于 ddns 域名)

用法

# 如果 vps 不能访问 raw.githubusercontent.com 推荐使用这个

wget --no-check-certificate -qO natcfg.sh https://www.arloor.com/sh/iptablesUtils/natcfg.sh && bash natcfg.sh

wget --no-check-certificate -qO natcfg.sh https://raw.githubusercontent.com/arloor/iptablesUtils/master/natcfg.sh && bash natcfg.sh

输出如下:

#############################################################
# Usage: setup iptables nat rules for domian/ip             #
# Website:  http://www.arloor.com/                          #
# Author: ARLOOR <[email protected]>                         #
# Github: https://github.com/arloor/iptablesUtils           #
#############################################################

你要做什么呢(请输入数字)?Ctrl+C 退出本脚本
1) 增加转发规则          3) 列出所有转发规则
2) 删除转发规则          4) 查看当前 iptables 配置
#?

此时按照需要,输入 1 - 4 中的任意数字,然后按照提示即可

卸载

wget --no-check-certificate -qO uninstall.sh https://raw.githubusercontent.com/arloor/iptablesUtils/master/dnat-uninstall.sh && bash uninstall.sh

查看日志

journalctl -exu dnat

配置文件备份和导入导出

配置文件在

/etc/dnat/conf

trojan 转发

总是有人说,不能转发 trojan,这么说的人大部分是证书配置不对。最简单的解决方案是:客户端选择不验证证书。复杂一点是自己把证书和中转机的域名搭配好。

小白记住一句话就好: 客户端不验证证书。

正文完
 
alecctv
版权声明:本文于2023-03-03转载自GIT,共计1027字。
转载提示:此文章非本站原创文章,若需转载请联系原作者获得转载授权。
评论(没有评论)
验证码