iptables 打开端口

您所在的位置:网站首页 iptables开启指定端口 iptables 打开端口

iptables 打开端口

2023-09-11 01:57| 来源: 网络整理| 查看: 265

iptables 打开端口

How to open a port, say 3389, in iptables to allow incoming traffics to it?

如何在iptables中打开一个端口(例如3389),以允许传入流量到该端口?

There are several cases for this question: ipv4 or ipv6 or both, TCP or UDP or both and which interface?

这个问题有几种情况:ipv4或ipv6或两者,TCP或UDP或两者,以及哪个接口?

For simplicity, I give commands to allow all (ipv4 and ipv6, TCP and UDP from all interfaces) using port 3389 as an example. You may choose which ones to be used. For other ports, replace 3389 with the port you want to open.

为简单起见,我以端口3389为例给出命令以允许所有命令(所有接口的ipv4和ipv6,TCP和UDP)。 您可以选择要使用的那些。 对于其他端口,将3389替换为要打开的端口。

# allow TCP ipv4 iptables -I INPUT -p tcp --dport 3389 -j ACCEPT # allow UDP ipv4 iptables -I INPUT -p udp --dport 3389 -j ACCEPT # allow TCP ipv6 ip6tables -I INPUT -p tcp --dport 3389 -j ACCE


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3