firewall

Redhat Linux 6 版本打开图形化管理防火墙   system-config-firewall

Redhat Linux 7 安装,开启、关闭iptables服务:http://www.cnblogs.com/kreo/p/4368811.html

#先检查是否安装了iptables

service iptables status

#安装iptables

yum install -y iptables

#安装iptables-services

yum install iptables-services

禁用/停止自带的firewalld服务

#停止firewalld服务 systemctl stop firewalld.service

#禁用firewalld服务 systemctl mask firewalld.service

#systemctl unmask firewalld    解除禁用

#iptables-save  保存策略到/etc/sysconfig/iptables(重启服务失效)

#保存规则

service iptables save

#查看iptables现有规则

iptables -L -n

#先允许所有,不然有可能会杯具

iptables -P INPUT ACCEPT

#清空所有默认规则

iptables -F

#清空所有自定义规则

iptables -X

centos6的版本防火墙使用的iptables,iptables是一个静态防火墙,也就是说它不能够动态的添加开启端口,必须在配置文件中添加开启端口,然后重启防火墙才能生效。

centos7的防火墙使用的是firewalld,它是动态的,可以通过命令添加开启端口,不用重启服务就可以使改变生效。有两种方式

1.图像化的 firewall-config 工具

2.提供命令行客户端,firewall-cmd,用于进行永久性或非永久性运行时间的改变

firewalld防火墙:https://access.redhat.com/documentation/zh-CN/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.html

  • target:目标,可以理解为默认行为,有四个可选值:default、ACCEPT、%%REJECT%%、DROP,如果不设置默认为default
  • service:这个在前面学生已经给大家解释过了,他表示一个服务
  • port:端口,使用port可以不通过service而直接对端口进行设置
  • interface:接口,可以理解为网卡
  • source:源地址,可以是ip地址也可以是ip地址段
  • icmp-block:icmp报文阻塞,可以按照icmp类型进行设置
  • masquerade:ip地址伪装,也就是按照源网卡地址进行NAT转发
  • forward-port:端口转发
  • rule:自定义规则

firewalld默认配置文件有两个:/usr/lib/firewalld/ (系统配置,尽量不要修改)和 /etc/firewalld/ (用户配置地址)

查看防火墙状态。

systemctl status firewalld  或 firewall-cmd --state

查询服务的启用状态

firewall-cmd --query-service ftp

输入如下命令来检查版本:

~]$ &nbsp123

&nbsp123&nbsp123

&nbsp123

&nbsp123&nbsp123

&nbsp123&nbsp123

&nbsp123&nbsp123&nbsp123

&nbsp123&nbsp123

&nbsp123&nbsp123&nbsp123

&nbsp123

&nbsp123&nbsp123

&nbsp123

&nbsp123&nbsp123&nbsp123&nbsp123&nbsp123&nbsp123&nbsp123&nbsp123&nbsp123&nbsp123

&nbsp123&nbsp123&nbsp123

&nbsp123&nbsp123&nbsp123&nbsp123&nbsp123&nbsp123&nbsp123&nbsp123&nbsp123&nbsp123

&nbsp123&nbsp123

&nbsp123

&nbsp123&nbsp123&nbsp123&nbsp123

&nbsp123&nbsp123&nbsp123

&nbsp123&nbsp123

‘‘

&nbsp123

&nbsp123

&nbsp123

"

‘‘

‘‘

‘‘

""

&nbsp123"

"""

&nbsp123"

"""

&nbsp123

&nbsp123""""""

&nbsp123

&nbsp123

""""

&nbsp123

""

""""

""""""""""""

""""""""""""

""""

""""""""""""

&nbsp123&nbsp123"""""&nbsp123"

""""&nbsp123&nbsp123&nbsp123‘‘

‘‘

‘‘

‘‘

‘‘

时间: 2024-08-05 11:14:57

firewall的相关文章

CentOS7中firewall防火墙详解和配置

官方文档地址: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.html#sec-Introduction_to_firewalld1 cd /usr/lib/firewalld/services 目录中存放定义好的网络服务和端口参数,系统参数,不能修改. cd /etc/firewalld/services/ syst

Cross The GFW(Great Firewall of China)

Present Situation GFWGreat Firewall of China Theory How To Present Situation As we all know, those who from Mainland China could not enjoy the freedom which brought by the real Internet. For example, we could not access the websites such as Google, F

centos7 关闭firewall安装iptables并配置

一.配置防火墙,开启80端口.3306端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 2.安装iptables防火墙 yum install iptables-services #安装 vi /etc/sysconfig/ip

Firewall 配置

在 CentOS 7暫時開放 ftp 服務# firewall-cmd --add-service=ftp 永久開放 ftp 服務# firewall-cmd --add-service=ftp --permanent 永久關閉# firewall-cmd --remove-service=ftp --permanentsuccess 讓設定生效# systemctl restart firewalld 檢視設定是否生效# iptables -L -n | grep 21ACCEPT     t

CentOS7 Firewall防火墙

# systemctl start firewalld # 启动, # systemctl enable firewalld # 开机启动 # systemctl stop firewalld # 关闭 # systemctl disable firewalld # 取消开机启动 查看特性firewall-cmd --list-all 查看firewall服务状态systemctl status firewalld firewall-cmd --state 开启端口 firewall-cmd -

【基础部分】之Firewall和iptables

Firewall和iptables firewall 和 iptables 默认只能开一个 火墙: 图形界面形式配置火墙 firewall-config 使用命令行接口配置防火墙 查看firewalld的状态: firewall-cmd --state 查看当前活动的区域,并附带一个目前分配给它们的接口列表: # firewall-cmd --get-active-zones 查看默认区域: # firewall-cmd --get-default-zone 查看所有可用区域: # firewa

CentOS7下Firewall防火墙配置用法详解

官方文档地址: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.html#sec-Introduction_to_firewalld1 修改防火墙配置文件之前,需要对之前防火墙做好备份 重启防火墙后,需要确认防火墙状态和防火墙规则是否加载,若重启失败或规则加载失败,则所有请求都会被防火墙拦截 1 2 3 4 5 6 7

ModSecurity web application firewall (WAF) Research

catalog 0. 引言 1. OWASP ModSecurity Core Rule Set (CRS) Project 2. Installation mod_security for Apache 3. Installation mod_security for nginx 4. Installation mod_security for IIS 5. mod_security Configuration Directives 6. Processing Phases 7. Variab

VPN ,Bypass the FIrewall

Bypass the China Firewall Methods November 16th, 2012Posted in , Tech With their assortment of techniques to prohibit access to websites they do not like, China is probably the country where the “Site not found” errors are most common, with the possi

config OSX firewall programmatically

osx firewall configuration file is : /Library/Preferences/com.apple.alf.plist the default plist and firewall programs are under:/usr/libexec/ApplicationFirewall To configure the firewall to block all incoming traffic: /usr/libexec/ApplicationFirewall