- 论坛徽章:
- 1
|
还是我来点官方的文档吧:
参看:http://netfilter.org/documentati ... ering-HOWTO-10.html
10. iptables 與 ipchains 的差異
首先﹐內建鏈名稱從小寫還換成大寫﹐因為 INPUT 與 OUTPUT 鏈目前只會抓目標為本機以及從本機產生的封包。它們分別用來查看傳入與傳出的封包。
現在有一個 `-i' 旗標來代表傳入界面﹐並且只工作於 INPUT 和 FORWARD 鏈中。在 FORWARD 與 OUTPUT 鏈中就要將 `-i' 改成 `-o' 了。
TCP 與 UDP 埠口現在都要用 --source-port 或 --sport 選項來拼寫出來(或是掉過來寫 --destination-port 或 --dport)﹐同時﹐必需置於 `-p tcp' 或 `-p udp' 選項之後﹐因為 TCP 或 UDP 延伸是分開載入的。
以前 TCP 那個 -y 現在變成 --syn﹐並且必需置於 `-p tcp' 之後。
原來的 DENY 目標現在終於變成 DROP 了。
在列示其工作的同時可以將該鏈歸零(zeroing)。
歸零內建鏈也可以清掉原則記數器(policy counters)。
列示鏈可以讓您把記數器變成微小快照(atomic snapshot)。
REJECT 與 LOG 現在變成延伸目標了﹐意味著它們已經和核心模組分開。
鏈名稱最長可達 31 個字母。
MASQ 現在變成 MASQUERADE﹐ 而且使用不同的語法。REDIRECT 在保留相同名稱的同時﹐也經歷了語法的變遷。至於如何設定它們的詳細資料﹐請參閱 NAT-HOWTO。
而 -o 選項則不再用來將封包傳遞給使用者空間設備了(參考前面的 -i )。現在則用 QUEUE 目標將封包送給使用者空間。
哦﹐我可能已記不得那麼多了。
10. Differences Between iptables and ipchains
Firstly, the names of the built-in chains have changed from lower case to UPPER case, because the INPUT and OUTPUT chains now only get locally-destined and locally-generated packets. They used to see all incoming and all outgoing packets respectively.
The `-i' flag now means the incoming interface, and only works in the INPUT and FORWARD chains. Rules in the FORWARD or OUTPUT chains that used `-i' should be changed to `-o'.
TCP and UDP ports now need to be spelled out with the --source-port or --sport (or --destination-port/--dport) options, and must be placed after the `-p tcp' or `-p udp' options, as this loads the TCP or UDP extensions respectively.
The TCP -y flag is now --syn, and must be after `-p tcp'.
The DENY target is now DROP, finally.
Zeroing single chains while listing them works.
Zeroing built-in chains also clears policy counters.
Listing chains gives you the counters as an atomic snapshot.
REJECT and LOG are now extended targets, meaning they are separate kernel modules.
Chain names can be up to 31 characters.
MASQ is now MASQUERADE and uses a different syntax. REDIRECT, while keeping the same name, has also undergone a syntax change. See the NAT-HOWTO for more information on how to configure both of these.
The -o option is no longer used to direct packets to the userspace device (see -i above). Packets are now sent to userspace via the QUEUE target.
Probably heaps of other things I forgot.
http://netfilter.org/documentation/HOWTO/cn/NAT-HOWTO-6.html
需要修改本機產生的封包之目的地的話﹐那麼 OUTPUT 鏈就可以用上了﹐不過這並不常碰到。 |
|