linux查看防火墙当前的状态
1)查看防火墙状态:
/etc/init.d/iptables status
暂时关闭防火墙:
/etc/init.d/iptables stop
禁止防火墙在系统启动时启动
/sbin/chkconfig --level 2345 iptables off
重启iptables:
/etc/init.d/iptables restart
重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off 或者 /sbin/chkconfig --level 2345 iptables off
2) 即时生效,重启后失效
service 方式
开启: service iptables start
关闭: service iptables stop
iptables方式
查看防火墙状态:
/etc/init.d/iptables status
暂时关闭防火墙:
/etc/init.d/iptables stop
重启iptables:
/etc/init.d/iptables restart
开放端口,在/etc/sysconfig/iptables中增加一行:
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 8080 -j ACCEPT
相关推荐
Wepe0 2020-10-30
Lostinthewoods 2020-10-29
hickwu 2020-10-23
focusforce 2020-10-10
summerinsist 2020-08-21
winki 2020-08-19
89284553 2020-07-17
大老张学编程 2020-07-04
xiaohouye 2020-06-28
lizhengfa 2020-06-26
Aveiox 2020-06-25
clamzxf 2020-06-16
kerson 2020-06-16
zhangwentaohh 2020-06-14
学峰的学习笔记 2020-06-11
linuxalienyan 2020-06-11