Brook/iptables端口转发 一键管理脚本,支持DDNS

一、Brook 脚本版

基于原 Brook端口转发 一键管理脚本 的修改版,增加对动态域名的支持,开启监控后自动更新域名IP。

基于iptables防火墙,记得安装iptables。

安装Brook,然后配置端口转发,最后启动Brook。

wget -N --no-check-certificate https://raw.githubusercontent.com/motao123/Brook/master/brook-pf-mod.sh && chmod +x brook-pf-mod.sh ./brook-pf-mod.sh 
#或者 
wget -N --no-check-certificate https://gitee.com/pigfei/Brook/raw/master/brook-pf-mod.sh && chmod +x brook-pf-mod.sh ./brook-pf-mod.sh

 

Brook/iptables端口转发 一键管理脚本,支持DDNSBrook/iptables端口转发 一键管理脚本,支持DDNS

转自:https://github.com/motao123/Brook

二、iptables 脚本版

wget -N --no-check-certificate https://raw.githubusercontent.com/motao123/iptables-pf/master/iptables-pf.sh && chmod +x iptables-pf.sh bash iptables-pf.sh 
#或者
 wget -N --no-check-certificate https://gitee.com/pigfei/iptables-pf/raw/master/iptables-pf.sh && chmod +x iptables-pf.sh bash iptables-pf.sh

 

三、相关问题

1、卸载 firewalld 和 ufw

apt remove firewalld ufw

 

yum remove firewalld ufw

 

然后重启。

2、安装iptables

yum install -y iptables
yum update iptables 
yum install iptables-services

 

iptables配置文件:/etc/sysconfig/iptables

3、开启转发功能

echo -e "net.ipv4.ip_forward=1" >> /etc/sysctl.conf 
sysctl -p

 

4、设置一下iptable开机启动自动载入规则功能

CentOS 系统:

service iptables 
save systemctl enable iptables.service

 

Debian/Ubuntu 系统:

iptables-save > /etc/iptables.up.rules 
echo -e '#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules' > /etc/network/if-pre-up.d/iptables 
chmod +x /etc/network/if-pre-up.d/iptables

 

原创文章,作者:陌涛,如若转载,请注明出处:https://imotao.com/3551.html

(0)
陌涛的头像陌涛
上一篇 2020年8月12日
下一篇 2020年8月12日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据