Tag: iptables的

将定向到端口5000的包重定向到另一个端口

我正在尝试使用eboard连接到FICS服务器(http://www.freechess.org),但由于端口5000被阻止(公司防火墙),它失败了。 但是,我可以通过telnet端口(23)连接到服务器: telnet freechess.org 23 (succeeds) telnet freechess.org 5000 (fails) 不幸的是,端口号是硬编码的(见这里: http : //ubuntuforums.org/archive/index.php/t-1613075.html )。 我宁愿不必破解源代码,因为该线程的作者最终做了。 我可以使用iptables转发本地计算机上的端口吗? 我试过了: sudo iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 5000 -j REDIRECT –to-port 23 和 sudo iptables -t nat -I OUTPUT –src 0/0 -p tcp –dport 5000 -j REDIRECT –to-ports 23 但这些都不起作用…… 注意: $ sudo […]

iptables允许dyndns域名和自动更新规则

我已经在dyndns域注册了我动态更改的公共IP地址,以便与iptable规则一起使用。 在服务器上,我在iptables配置中允许这个域的一些端口,如下面的条目: -A INPUT -s mycompany.dyndns.com -p tcp -m tcp –dport 22 -j ACCEPT -A INPUT -s mycompany.dyndns.com -p tcp -m tcp –dport 3306 -j ACCEPT -A INPUT -s mycompany.dyndns.com -p tcp -m tcp –dport 21 -j ACCEPT 但是当我的调制解调器重新启动时,我无法连接到这些允许的端口,因为公共IP更改调制解调器重新启动并且未在服务器上的iptables中更新。 是否有任何选项可以自动更新服务器上的iptable规则。

如何启动/停止iptables?

在学习关于iptables的一些新东西时,我无法通过这个。 虽然我想开始,但它的说法是 root@badfox:~# iptables -L -n -v Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in […]

服务器重新启动时iptables重置

每次我的服务器重新启动时,似乎我必须将我的iptables重置为默认值,我曾经使用过firestarter但是暂时将其删除了。 是否有任何设置在服务器重新启动时更改iptables?

如何保存iptables的规则?

我为iptables创建了规则。 但是,当我重新启动计算机时,规则不起作用! 如何在Ubuntu上保存规则? 问题解决了! 做: 在编写命令iptables之后,执行: 1. sudo su 2. iptables-save > /etc/iptables.rules 3. In /etc/network/if-pre-up.d/iptables,put: #!/bin/sh iptables-restore /etc/iptables.rules if [ -f /etc/iptables.rules ]; then iptables-restore < /etc/iptables.rules fi exit 0 5. After, give permission to the scripts: sudo chmod +x /etc/network/if-post-down.d/iptables sudo chmod +x /etc/network/if-pre-up.d/iptables 更多信息: https : //help.ubuntu.com/community/IptablesHowTo#Saving_iptables祝您好运!