看了好几个页面内容都有错,下面是正确方法:
#/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
#/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT

然后保存:
#/etc/rc.d/init.d/iptables save

再查看是否已经有了:
[root@vcentos ~]# /etc/init.d/iptables status 
Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         
1    ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:80 
2    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 
3    RH-Firewall-1-INPUT  all  --  0.0.0.0/0            0.0.0.0/0           

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination         
1    RH-Firewall-1-INPUT  all  --  0.0.0.0/0            0.0.0.0/0
....

相关文章:

  • 2022-03-03
  • 2021-12-25
  • 2021-06-11
  • 2021-12-07
  • 2021-12-09
  • 2022-03-02
  • 2022-02-05
猜你喜欢
  • 2021-08-13
  • 2021-10-13
  • 2022-02-09
  • 2021-11-20
  • 2022-01-12
  • 2021-11-20
  • 2022-02-08
相关资源
相似解决方案