iptables来自外部IP的一个连接


0

我希望能够从办公室外部连接到我的服务器,但是我想让一个人可以一次使用远程桌面

iptables -A PREROUTING -t nat -p tcp  -s 00.00.00.00 -d $INET_IP --dport 1122 \
 -j DNAT --to-destination 127.0.0.1:3344

我必须添加什么才能使其工作,并且可以使用iptables吗?

Answers:


0

如果要基于源IP地址限制规则,则需要在-s source_ip选项中指定IP地址。

另外,您需要确保在INPUT链(访问本地主机)或FORWARD链(通过防火墙访问另一台计算机)中允许所需的端口。


0

如果您想将可能的连接限制为一个,则connlimit是您的朋友。确保限制目标而不是源,因为您将只限制每个想要连接到一个连接的人,而不是一次只连接一个人。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.