![在linux上的iptables防火墙上怎么设置信任MAC地址访问端口,第1张 在linux上的iptables防火墙上怎么设置信任MAC地址访问端口,第1张](/aiimages/%E5%9C%A8linux%E4%B8%8A%E7%9A%84iptables%E9%98%B2%E7%81%AB%E5%A2%99%E4%B8%8A%E6%80%8E%E4%B9%88%E8%AE%BE%E7%BD%AE%E4%BF%A1%E4%BB%BBMAC%E5%9C%B0%E5%9D%80%E8%AE%BF%E9%97%AE%E7%AB%AF%E5%8F%A3.png)
端口 *** 作相关示例: 6.1 添加
端口(1)允许源地址为x.x.x.x/x的主机通过22(ssh)端口.iptables -A INPUT -p tcp -s x.x.x.x/x --dport 22 -j ACCEPT (2)允许80(http)端口的数据包进入 iptables -A INPUT -p tcp --dport 80 -j ACCEPT (3)允许110(pop3)端口的数据包进入,如果不加这
规则,就只能通过web
页面来收信(无法用OE或Foxmail等来收)iptables -A INPUT -p tcp --dport 110 -j ACCEPT (4) 允许25(smtp)端口的数据包进入,如果不加这规则,就只能通过web页面来发信(无法用OE或Foxmail等来发)iptables -A INPUT -p tcp --dport 25 -j ACCEPT (5)允许21(ftp)端口的数据包进入(传数据) iptables -A INPUT -p tcp --dport 21 -j ACCEPT (6)允许20(ftp)端口的数据包进入(执行ftp命令,如dir等) iptables -A INPUT -p tcp --dport 20 -j ACCEPT (7)允许53(dns)端口的数据包进入(tcp)
iptables -A INPUT -p tcp --dport 53 -j ACCEPT (8)允许53(dns)端口的数据包进入(udp)
iptables -A INPUT -p udp --dport 53 -j ACCEPT (9)允许ICMP包通过,也就是允许ping iptables -A INPUT -p icmp -j ACCEPT(10)利用 iptables 对连接状态的支持iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT(11)把INPUT链的默认规则设置为DROP iptables -P INPUT DROP
1、ps -ef看有没有类似httpd/nginx/tomcat之类的进程2、netstat -ntlp看看有没有开启80/8080之类的端口3、iptables -nvL检查防火墙是否允许访问80端口
评论列表(0条)