linux 日常使用中,检查端口是否通的,一般使用telnet ip port
但此方法只适用TCP
而UDP则使用其他命令:
列如 161 端口↓↓↓↓↓↓↓↓↓↓
[root@cookie ~]#nc -vuz 192.168.2.10 161
Connection to 192.168.2.10 161 port [udp/snmp] succeeded!
使用命令nc即可。
添加规则:
-A INPUT -m state --state NEW -m udp -p udp --dport 161 -j ACCEPT
其他UDP端口类似此方法。