[問題] iptables route target 設定問題

看板Linux作者 (kukuku~)時間17年前 (2008/08/18 02:39), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
小弟我安裝了patch-o-matic-ng裡面所提供的 ROUTE target 目的是為了把封包導向到所指定的介面上。說明如下 The target can be or not a final target. It has to be used inside the mangle table. ROUTE target options: --oif ifname Send the packet out using `ifname' network interface. --iif ifname Change the packet's incoming interface to `ifname'. --gw ip Route the packet via this gateway. --continue Route the packet and continue traversing the rules. --tee Route a copy of the packet, but continue traversing the rules with the original packet, undisturbed. 但是目前遇到一個問題,只要在PREROUTING內設定之後會發現整個網路都不動了...。 例如 iptables -t mangle -A PREROUTING -p icmp -j ROUTING --oif eth0 之後再ping就會發現ping不出去...。 但是設在POSTROUTING則不會發生此問題。 不過好像也就單純把封包丟向eth0而已,就算source ip不是eth0的ip也不會去重填封包的 source ip。 設在PREROUTING網路就不通有辦法解決嗎? 又如果希望能夠做到可以重填source ip的話要設在哪呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.123.236.115
文章代碼(AID): #18g71yNt (Linux)