防火墙相关操作命令

来源:互联网 发布:ubuntu虚拟机硬盘空间 编辑:程序博客网 时间:2024/06/05 10:47

命令如下:
开启指定端口
/sbin/iptables -I INPUT -p tcp –dport 8080 -j ACCEPT #8080为指定端口
查看防火墙信息
/etc/init.d/iptables status

/etc/rc.d/init.d/iptables save #将更改进行保存

/etc/init.d/iptables restart #重启防火墙以便改动生效,

注:防火墙的基本操作命令:

查询防火墙状态:
[root@localhost ~]# service iptables status
停止防火墙:
[root@localhost ~]# service iptables stop
启动防火墙:
[root@localhost ~]# service iptables start
重启防火墙:
[root@localhost ~]# service iptables restart
永久关闭防火墙:
[root@localhost ~]# chkconfig iptables off
永久关闭后启用:
[root@localhost ~]# chkconfig iptables on

0 0
原创粉丝点击