成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

netfilter/iptables系統(tǒng)的安裝

運(yùn)維 系統(tǒng)運(yùn)維
netfilter/iptables系統(tǒng)的安裝:在Linux中,提供了一個(gè)非常優(yōu)秀的防火墻工具netfilter/iptables。netfilter/iptables是完全免費(fèi)的,而且功能強(qiáng)大,使用靈活。netfilter/iptables可以對(duì)流入和流出的信息進(jìn)行細(xì)化控制,且可以在一臺(tái)低配置機(jī)器上很好地運(yùn)行。本文講述的是netfilter/iptables系統(tǒng)的安裝

  安裝netfilter/iptables 系統(tǒng):

  因?yàn)?netfilter/iptables 的 netfilter 組件是與內(nèi)核 2.4.x 集成在一起的,所以只需要下載并安裝 iptables 用戶空間工具。

  需求

  下面是安裝 netfilter/iptables 系統(tǒng)的需求:

  硬件:要使用 netfilter/iptables,需要有一個(gè)運(yùn)行 Linux OS 并連接到因特網(wǎng)、LAN 或 WAN 的系統(tǒng)。

  軟件:帶有內(nèi)核 2.4 或更高版本的任何版本的 Linux OS。可以從 http://www.kernel.org 下載最新版本的內(nèi)核。還需要從 http://www.netfilter.org 下載 iptables 這個(gè)用戶空間工具,因?yàn)檫@個(gè)工具不是內(nèi)核的一部分。但對(duì)于 RedHat Linux 版本 7.1 或更高版本,不需要下載此工具,因?yàn)樵诎姹?7.1 或更高版本中,標(biāo)準(zhǔn)安裝中已經(jīng)包含了此工具。

  用戶:至少對(duì) Linux OS 有中等水平的了解,以及具備配置 Linux 內(nèi)核的經(jīng)驗(yàn)。

  安裝前的準(zhǔn)備

  在開始安裝 iptables 用戶空間工具之前,需要對(duì)系統(tǒng)做某些修改。首先,需要使用 make config 命令來配置內(nèi)核的選項(xiàng)。在配置期間,必須通過將 CONFIG_NETFILTER 和 CONFIG_IP_NF_IPTABLES 選項(xiàng)設(shè)置為 Y 來打開它們,因?yàn)檫@是使 netfilter/iptables 工作所必需的。下面是可能要打開的其它選項(xiàng):

  CONFIG_PACKET : 如果要使應(yīng)用程序和程序直接使用某些網(wǎng)絡(luò)設(shè)備,那么這個(gè)選項(xiàng)是有用的。

  CONFIG_IP_NF_MATCH_STATE : 如果要配置 有狀態(tài)的防火墻,那么這個(gè)選項(xiàng)非常重要而且很有用。這類防火墻會(huì)記得先前關(guān)于信息包過濾所做的決定,并根據(jù)它們做出新的決定。我將在 netfilter/iptables 系統(tǒng)的優(yōu)點(diǎn)一節(jié)中進(jìn)一步討論這方面的問題。

  CONFIG_IP_NF_FILTER : 這個(gè)選項(xiàng)提供一個(gè)基本的信息包過濾框架。如果打開這個(gè)選項(xiàng),則會(huì)將一個(gè)基本過濾表(帶有內(nèi)置的 INPUT 、 FORWARD 和 OUTPUT 鏈)添加到內(nèi)核空間。

  CONFIG_IP_NF_TARGET_REJECT : 這個(gè)選項(xiàng)允許指定:應(yīng)該發(fā)送 ICMP 錯(cuò)誤消息來響應(yīng)已被 DROP 掉的入站信息包,而不是簡單地殺死它們。

  現(xiàn)在,可以準(zhǔn)備安裝這個(gè)用戶空間工具了。

  安裝用戶空間工具

  在下載 iptables 用戶空間工具的源代碼(它類似于 iptables-1.2.6a.tar.bz2)之后,可以開始安裝。您需要以 root 身份登錄來執(zhí)行安裝。 清單 1 給出了一個(gè)示例,它指出了安裝該工具所需的命令、其必要的次序及其說明。

  清單 1. 用戶空間工具安裝的示例

  1.   First, unpack the tool package into a directory:  
  2.  
  3.   # bzip2 -d iptables-1.2.6a.tar.bz2  
  4.  
  5.   # tar -xvf iptables-1.2.6a.tar  
  6.  
  7.   This will unpack the tool source into a directory named iptables-1.2.6a.  
  8.  
  9.   Now change to the iptables-1.2.6a directory:  
  10.  
  11.   # cd iptables-1.2.6a  
  12.  
  13.   The INSTALL file in this directory contains a lot of useful information  
  14.  
  15.   on compiling and installing this tool.  
  16.  
  17.   Now compile the userspace tool using the following command:  
  18.  
  19.   # make KERNEL_DIR=/usr/src/linux/  
  20.  
  21.   Here the KERNEL_DIR=/usr/src/linux/ specifies the path to the kernel's  
  22.  
  23.   directory. If the directory of kernel happens to be different on some  
  24.  
  25.   systems, the appropriate directory path should be substituted for  
  26.  
  27.   /usr/src/linux.  
  28.  
  29.   Now install the source binaries using the following command:  
  30.  
  31.   # make install KERNEL_DIR=/usr/src/linux/  
  32.  
  33.   Now the installation is complete.  
  34.  

  注:如果您有 RedHat Linux 版本 7.1 或更高版本,就不需要執(zhí)行這里說明的前兩個(gè)步驟。正如我們所知道的,該 Linux 分發(fā)版(distribution)的標(biāo)準(zhǔn)安裝中包含了 iptables 用戶空間工具。但在缺省情況下,這個(gè)工具是關(guān)閉的。為了使該工具運(yùn)行,需要執(zhí)行以下步驟( 清單 2):

  清單 2. 在 RedHat 7.1 系統(tǒng)上設(shè)置用戶空間工具的示例

  1.   First you'll have to turn off the old ipchains module (predecessor of  
  2.  
  3.   iptables) available in this OS package.  
  4.  
  5.   This can be done using the following command:  
  6.  
  7.   # chkconfig --level 0123456 ipchains off  
  8.  
  9.   Next, to completely stop the ipchains module from running, so that it  
  10.  
  11.   doesn't conflict with the iptables tool, you will have to stop the ipchains  
  12.  
  13.   service using the following command:  
  14.  
  15.   # service ipchains stop  
  16.  
  17.   Now if you don't want to keep this old ipchains module on your system,  
  18.  
  19.   uninstall it using the following command:  
  20.  
  21.   # rpm -e ipchains  
  22.  
  23.   Now you can turn on the iptables userspace tool with the following command:  
  24.  
  25.   # chkconfig --level 235 iptables on  
  26.  
  27.   Finally, you'll have to activate the iptables service to make the userspace  
  28.  
  29.   tool work by using this command:  
  30.  
  31.   # service iptables start  
  32.  
  33.   Now the userspace tool is ready to work on a RedHat 7.1 or higher system.  
  34.  

  現(xiàn)在,一切都已妥當(dāng),并且 netfilter/iptables 系統(tǒng)應(yīng)該正在運(yùn)行,接下來(下一節(jié)講述),需要建立規(guī)則和鏈來過濾信息包

【編輯推薦】

Linux下Iptables防火墻的使用

iptables簡介與安裝命令

Squid+iptables代理配置

責(zé)任編輯:zhaolei 來源: IBM
相關(guān)推薦

2011-03-15 15:47:34

netfilteriptables

2011-03-15 12:47:11

netfilteriptables

2011-03-15 15:51:12

netfilteriptables

2011-03-15 10:00:01

NetfilterIPTables

2011-03-15 15:47:26

netfilteriptables

2021-04-14 20:10:50

Netfileter Iptables 源碼

2011-03-15 09:10:43

iptables防火墻

2010-12-07 09:51:43

Linux安全性netfilteriptables

2011-03-15 10:48:47

2011-03-15 09:59:54

2011-03-15 09:59:54

2011-07-05 14:34:23

2011-07-13 10:30:09

2022-10-27 20:31:19

iptablesnetfilter

2011-03-14 15:12:27

iptables安裝

2011-03-15 15:47:25

iptables安裝命令

2018-10-10 10:37:03

2011-03-15 16:12:45

iptablesRed Hat

2011-03-18 09:26:13

Iptables規(guī)則

2011-03-17 16:00:57

點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)

主站蜘蛛池模板: 国产精品地址 | 色综合欧美 | 久久精品99久久 | 欧美一区二区三区四区视频 | 色婷婷亚洲国产女人的天堂 | 久久一二区 | 粉色午夜视频 | 日韩不卡视频在线观看 | 国产高清视频 | 91av视频在线观看 | 亚洲另类自拍 | 精品视频一区二区三区在线观看 | 日韩欧美三级 | 蜜桃色网 | 日韩免费视频一区二区 | 亚洲第一av网站 | 97超碰站 | 成年免费大片黄在线观看一级 | 国产欧美三区 | www.日韩| 2023亚洲天堂 | 激情网五月天 | 午夜tv免费观看 | 99精品国产一区二区青青牛奶 | 久久久久久九九九九 | 亚洲第一网站 | 久久久tv | 国产乱码精品一区二区三区五月婷 | 国产精品久久久久久一区二区三区 | 日韩成人av在线 | 在线观看亚洲欧美 | av网站在线看 | 9久久婷婷国产综合精品性色 | 在线观看午夜视频 | 国产精品久久精品 | 欧美福利 | 日韩精品一区二区三区中文在线 | 自拍视频网站 | 国产999精品久久久久久 | 婷婷桃色网 | 亚洲福利在线视频 |