酷!學園

技術討論區 => Linux 討論版 => 主題作者是: wangfang 於 2004-05-26 10:17

主題: 在kernel 2.6上使用iptables時發生的問題
作者: wangfang2004-05-26 10:17
distburtion是redhat 9.0
kernel更新成2.6.6時
使用iptables時發生如下的問題
可否有人指教一、二

#iptables -L
iptables v1.2.7a: can't initialize iptables table `filter': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
主題: Re: 在kernel 2.6上使用iptables時發生的問題
作者: twu22004-05-26 12:22
引述: "wangfang"
distburtion是redhat 9.0
kernel更新成2.6.6時
使用iptables時發生如下的問題
可否有人指教一、二

#iptables -L
iptables v1.2.7a: can't initialize iptables table `filter': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.


不是有寫嗎?

不過, 你有安裝 module-init-tools 嗎? 2.6 的核心如果沒更新 module 的 userspace tools, 會無法載入任何 module 的.
主題: 在kernel 2.6上使用iptables時發生的問題
作者: wangfang2004-05-26 19:26
你所說的已經安裝了
而且網路一切正常
唯獨iptables有問題............
主題: 在kernel 2.6上使用iptables時發生的問題
作者: twu22004-05-26 20:42
自己編的 kernel?
換 redhat 編的看看. http://people.redhat.com/arjanv/2.6/

至少我們這個用這個 kernel 沒有這問題.
主題: 在kernel 2.6上使用iptables時發生的問題
作者: wangfang2004-05-27 10:09
使用你介紹的是沒有問題了
但使用編譯的方式為何有這種問題
可否有人告知???
主題: 在kernel 2.6上使用iptables時發生的問題
作者: twu22004-05-27 10:26
引述: "wangfang"
使用你介紹的是沒有問題了
但使用編譯的方式為何有這種問題
可否有人告知???


因為 netfilter 的 userspace 與 kernel 端的某些資料結構不同造成的.
最簡單的解決方式是依照你使用的 kernel source 來重編一份 userspace tools (iptables) 來用.
主題: 在kernel 2.6上使用iptables時發生的問題
作者: wangfang2004-05-29 08:34
已經重編了iptables
但好像還是有問題
iptables 速1.2.9的
編譯時需要參照kernel source,
也作了
但問題還是相同
不知何解???
主題: 在kernel 2.6上使用iptables時發生的問題
作者: twu22004-05-29 08:40
應該不會有別的問題.
請檢查看看, 是不是使用的舊的 iptables 的相關檔案或模組. 存放的路徑可能與你自己編的不同.
主題: 在kernel 2.6上使用iptables時發生的問題
作者: wangfang2004-05-29 10:43
試過了
兩種不同的版本
特別使用iptables -V
結果,還是相同.......
一個是redhat的路徑
/sbin及/lib
一個是我編譯的
/usr/local/sbin及/usr/local/lib
執行時,特別標示路徑
/usr/local/sbin/iptables

結果.......一樣
是不是需要將過程放上來
主題: 在kernel 2.6上使用iptables時發生的問題
作者: twu22004-05-29 12:25
先把舊版的 iptables 相關檔案都砍了, 再安裝新的.

你有一份 /lib/iptables/*.so, 也有一份 /usr/local/lib/*.so or /usr/local/lib/iptables/*.so (沒安裝過到別的路徑, 不知道是放那個下頭).
請問一下, 你所執行的 iptables 會使用那一份? 你能確定嗎?

把舊版的都移除吧. 然後新版本再裝上, 避免這個問題.