Linux Netfilter discussions
 help / color / mirror / Atom feed
* ip rule with fwmark trouble
@ 2008-06-01  9:19 李伟华
  2008-06-01 16:45 ` Thomas Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: 李伟华 @ 2008-06-01  9:19 UTC (permalink / raw)
  To: netfilter



i have a linux router box ( kernel   2.6.23.12  iptables 1.4.0 ) with 3 interface,  eth0 to lan , eth1 to isp1  ,eth2 to isp2. i add these rule to iptables's nat table:
-A POSTROUTING -s LAN_IP -o eth1 -j MASQUERADE
-A POSTROUTING -s LAN_IP -o eth2 -j MASQUERADE

then, add route to route table:
ip route add 0/0 via ISP1_GW dev eth1 
ip route add 0/0 via ISP2_GW dev eth2 tables ISP2

now ,i want some ip in my lan out with ISP2,  use this rule :
ip rule add from SOME_IP table ISP2

it is work fine.
but when i use iptables  add mark to out-traffic and use ip rule with fwmark like this:
iptables -t mangle -A PREROUTING -s SOME_IP -j MARK --set-mark 11
ip rule add fwmark 11 table ISP2

the SOME_IP computers can't access internet , what's wrong ? Does anyone have hints ?



_________________________________________________________________
新年换新颜,快来妆扮自己的MSN给心仪的TA一个惊喜!
http://im.live.cn/emoticons/?ID=18

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ip rule with fwmark trouble
  2008-06-01  9:19 ip rule with fwmark trouble 李伟华
@ 2008-06-01 16:45 ` Thomas Jacob
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Jacob @ 2008-06-01 16:45 UTC (permalink / raw)
  To: netfilter

On Sun, Jun 01, 2008 at 09:19:40AM +0000, 李伟华 wrote:
> but when i use iptables  add mark to out-traffic and use ip rule with fwmark like this:
> iptables -t mangle -A PREROUTING -s SOME_IP -j MARK --set-mark 11
> ip rule add fwmark 11 table ISP2
> 
> the SOME_IP computers can't access internet , what's wrong ? Does anyone have hints ?QUW1 

Maybe it's caused by rp_filter according to the following mail, if that
information is still valid:

http://lists.netfilter.org/pipermail/netfilter/2000-November/006089.html
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-01 16:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-01  9:19 ip rule with fwmark trouble 李伟华
2008-06-01 16:45 ` Thomas Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox