欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

Linux配置防火墙端口 8080端口

程序员文章站 2022-05-02 12:02:25
1、查看防火墙状态,哪些端口开放了 /etc/init.d/iptables status 2、配置防火墙 vi /etc/sysconfig/iptables ###################################### # Firewall configuration writt ......

1、查看防火墙状态,哪些端口开放了

/etc/init.d/iptables status

2、配置防火墙

vi /etc/sysconfig/iptables   ######################################  # firewall configuration written by system-config-firewall  # manual customization of this file is not recommended.  *filter  :input accept [0:0]  :forward accept [0:0]  :output accept [0:0]  -a input -m state –state established,related -j accept  -a input -p icmp -j accept  -a input -i lo -j accept  -a input -m state –state new -m tcp -p tcp –dport 22 -j accept  -a input -m state –state new -m tcp -p tcp –dport 80 -j accept  -a input -m state –state new -m tcp -p tcp –dport 8080 -j accept  -a input -j reject –reject-with icmp-host-prohibited  -a forward -j reject –reject-with icmp-host-prohibited  commit  #####################################

#最后重启防火墙使配置生效

/etc/init.d/iptables restart