中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > Linux Iptables 內(nèi)核2.6.18添加time模塊

        Linux Iptables 內(nèi)核2.6.18添加time模塊

        作者: 時(shí)間:2018-09-06 來(lái)源:網(wǎng)絡(luò) 收藏

        系統(tǒng):CentOS 5.1 內(nèi)核:2.6.18-53.1.19.el5

        本文引用地址:http://www.antipu.com.cn/article/201809/388532.htm

        iptables 版本 1.3.5(系統(tǒng)自帶的)

        下載一個(gè)內(nèi)核:linux-2.6.18 解壓到/usr/src/linux

        #cd linux

        #make mrproper

        #make menuconfig

        什么也不做,退出.

        vi Makefile

        把EXTRAVERSION = 更改為EXTRAVERSION = -53.1.19.el5

        保持跟uname -a 的版本一致

        下載一個(gè)iptables1.3.5解壓到/usr/src/iptables (下面會(huì)用到)

        (下載)patch-o-matic-ng-20080214.tar.bz2

        wget ftp://ftp.netfilter.org/pub/iptables/iptables-1.4.0.tar.bz2

        #cd patch-o-matic-ng-20080214

        #./runme --download

        ...........

        應(yīng)用time補(bǔ)丁到內(nèi)核:

        選y ,至此,netfilter的補(bǔ)丁打完了,如果你需要?jiǎng)e的模塊可以根據(jù)需要加上.

        編譯kernel的modules

        #cd /usr/src/linux

        #make menuconfig

        在Device Drivers->;Networking support->;Networking options->;Network packet filtering (replaces ipchains)

        ->;IP: Netfilter Configuration中把下面的兩項(xiàng)M選中.

        ; TIME match support

        保存,退出.

        編譯安裝模塊

        下面就是最重要的步驟了,因?yàn)槲覀兊脑瓌t是節(jié)省時(shí)間,不重新編譯內(nèi)核,而只編譯其中的模塊,這點(diǎn)2.4的內(nèi)核跟2.6的內(nèi)核有所不同,2.4內(nèi)核的模塊是以*.o形式的,而2.6內(nèi)核是以*.ko形式的,

        [root@jiecho]# make modules

        HOSTCC scripts/basic/fixdep

        HOSTCC scripts/basic/split-include

        HOSTCC scripts/basic/docproc

        HOSTCC scripts/conmakehash

        HOSTCC scripts/kallsyms

        CC scripts/empty.o

        HOSTCC scripts/mk_elfconfig

        MKELF scripts/elfconfig.h

        HOSTCC scripts/file2alias.o

        HOSTCC scripts/modpost.o

        HOSTCC scripts/sumversion.o

        HOSTLD scripts/modpost

        HOSTCC scripts/pnmtologo

        HOSTCC scripts/bin2c

        到這里就可以ctrl+c中止了,因?yàn)槲覀儾皇且幾g所有的模塊,這樣太浪費(fèi)時(shí)間,而僅僅是netfilter的模塊,但是如果你直接執(zhí)行make modules SUBDIRS=net/ipv4/netfilter就會(huì)出錯(cuò),這就是2.4和2.6的區(qū)別,我們先生成了scripts目錄下的一系列需要的文件后就可以make modules SUBDIRS=net/ipv4/netfilter,并用modpost等等把*.o文件生成為*.ko文件.

        #make modules SUBDIRS=net/ipv4/netfilter

        編譯完成netfilter的模塊后拷貝編譯完成的模塊

        #chmod +x /usr/src/linux/net/ipv4/netfilter/ipt_time.ko

        # cp /usr/src/linux/net/ipv4/netfilter/ipt_time.ko /lib/modules/2.6.18-53.1.19.el5/kernel/net/ipv4/netfilter/

        #depmod -a 或 insmod /usr/src/linux/net/ipv4/netfilter/ipt_time.ko

        #lsmod   grep ip

        此時(shí),能看到以下東東

        ipt_time 6400 1

        但現(xiàn)在還不能用,還卻少libipt_time.so 這個(gè)東東

        現(xiàn)編譯下載的iptables

        #cd /usr/src/iptables

        #make KERNEL_DIR=/usr/src/linux

        # make install KERNEL_DIR=/usr/src/linux (我編譯時(shí)出現(xiàn)不少警告,錯(cuò)誤!)

        完了以后,

        #cp /usr/src/iptables/extensions/libipt_time.so /lib/iptables中

        到此結(jié)束, iptables -A INPUT -m time --timestart 8:00 --timestop 18:00 --days Mon,Tue,Wed,Thu,Fri



        關(guān)鍵詞:

        評(píng)論


        相關(guān)推薦

        技術(shù)專區(qū)

        關(guān)閉