全球主机交流论坛

标题: 使用IPTABLES端口转发 [打印本页]

作者: NoF    时间: 2020-4-6 22:57
标题: 使用IPTABLES端口转发
使用IPTABLES端口转发会导致SS UDP转发失败,求解

作者: ddo    时间: 2020-4-6 22:58
这是转发tcp啊
作者: kzklot    时间: 2020-4-6 22:59
提示: 作者被禁止或删除 内容自动屏蔽
作者: NoF    时间: 2020-4-6 23:02
kzklot 发表于 2020-4-6 22:59
iptables -t nat -A PREROUTING -p udp --dport port -j DNAT --to-destination ip
iptables -t nat -A POS ...

我是用的逗比的一键脚本
作者: envoy    时间: 2020-4-6 23:07
kzklot 发表于 2020-4-6 22:59
iptables -t nat -A PREROUTING -p udp --dport port -j DNAT --to-destination ip
iptables -t nat -A POS ...

又看到大佬技术帖了
作者: Drbo    时间: 2020-4-7 00:07
大佬们你们好
作者: 搬瓦工    时间: 2020-4-7 00:14
Firewall 就几行命令,不香吗?
  1. echo 1 > /proc/sys/net/ipv4/ip_forward

  2. systemctl start firewalld.service
  3. systemctl enable firewalld.service

  4. firewall-cmd --permanent --add-masquerade

  5. firewall-cmd --permanent --add-port=8080/tcp
  6. firewall-cmd --permanent --add-port=8080/udp
  7. firewall-cmd --permanent --add-forward-port=port=8080:proto=tcp:toport=8080:toaddr=44.44.44.44
  8. firewall-cmd --permanent --add-forward-port=port=8080:proto=udp:toport=8080:toaddr=44.44.44.44
  9. firewall-cmd --reload
复制代码

作者: llyang    时间: 2020-4-7 00:26
转发,发源于iptable,firewalld用起来也还方便。

如果你要转换成ufw,最费劲
作者: llyang    时间: 2020-4-7 00:29
NoF 发表于 2020-4-6 23:02
我是用的逗比的一键脚本

快10年前的脚本,系统变化太多了。确实该转换成 firewalld, ufw




欢迎光临 全球主机交流论坛 (https://loc.010206.xyz/) Powered by Discuz! X3.4