linux下关闭防火墙命令

时间:2022-05-23 07:00:45

今天使用linux虚拟机搭建jenkins,但是在虚拟机内部使用浏览器可以访问jenkins主页,在物理机上却无法访问jenkins主页,查找原因后是因为linux虚拟机没有关闭防火墙,关闭防火墙后,问题解决,下面整理下linux下关闭防火墙的命令。

1.命令执行完即可生效,重启后还原。

 关闭防火墙:service iptables stop
开启防火墙:service iptables start

2.永久生效,重启后不会还原

 关闭防火墙:chkconfig iptables stop
开启防火墙:chkconfig iptables start