Linux防火牆介紹 iptables

2021-10-22 06:16:59 字數 1301 閱讀 8270

linux防火牆介紹

selinux 介紹

/etc/selinux/config  配置檔案路徑

setenforce 0   暫時關閉

setenforce 1   暫時開啟

iptables 介紹

netfilter --> iptables

table  表

chain  表內規則

iptables -t filter -nvl  檢視 「filter」 表

iptables -t nat -nvl   檢視 「nat」 表

iptables -t mangle -nvl   檢視 「mangle」 表

附註:filter表作用:

1、過濾資料報

iptables -t filter -i(在表最上面插入規則) input -p tcp --dport 80 -s 192.168.0.119 -j reject(拒絕)/drop(扔掉)/accept(接受)  

iptables -t filter -d(刪除) input -p tcp --dport 80 -s 192.168.0.119 -j reject(拒絕)/drop(扔掉)/accept(接受)  

iptables -t filter -a(全域性新增到表最底層) input -p tcp --dport 80 -s 192.168.0.119 -j reject(拒絕)/drop(扔掉)/accept(接受)  

iptables 介紹

iptables -p input accept/drop/..   調整表規則預設策略屬性

sh腳步執行

#!/bin/bash

ipt="/sbin/iptables"

$ipt -f

$ipt -p input accept

$ipt -p output accept

$ipt -p forward accept

$ipt -a input -s 192.168.0.0/24 -p tcp --dport 22 -j accept

$ipt -a input -p tcp --dport 80 -j accept

$ipt -a input -p tcp --dport 21 -j accept

$ipt -a input -p tcp --dport 22 -j drop

sh 12.ipt.sh   執行指令碼

nat 表的作用:

1.用於網路機制轉換

2.相當於路由功能

mangle 介紹

mangle 表的作用:

1.給包打標籤

防火牆介紹

在電腦運算領域中,防火牆 英文 firewall 是一項協助確保資訊保安的裝置,會依照特定的規則,允許或是限制傳輸的資料通過。防火牆可能是一台專屬的硬體或是架設在一般硬體上的一套軟體。隱藏 3防火牆架構 4缺點5相關條目 6外部鏈結 防火牆最基本的功能就是隔離網路,通過將網路劃分成不同的區域 通常情...

tcp wrappers防火牆介紹

幾個關鍵字如下所示。一般規則 linux會首先判斷 etc hosts.allow這個檔案。如果遠端登入的計算機滿足檔案 etc hosts.allow設定規則,就不會使用 etc hosts.deny檔案了。相反,如果不滿足 etc hosts.allow設定規則,就會使用 etc hosts.d...

防火牆 防火牆安全

作為計算機的第一道屏障,防火牆的重要性不言而喻,儘管防火牆在面臨網路攻擊時仍有很大的缺陷,不如無法阻止自內而外的攻擊,對複雜多變的網路攻擊攻擊無法預警和像ids所做的那樣。但防火牆依然是伺服器乃至個人機的一道不可或缺的屏障。木桶原理 本文將對防火牆做乙個初步的簡介,顯然像我們知道的那樣,防火牆是一款...