Linux Netfilter discussions
 help / color / mirror / Atom feed
* Re: owner based routing
@ 2005-10-11 22:46 Ignatich
  0 siblings, 0 replies; 6+ messages in thread
From: Ignatich @ 2005-10-11 22:46 UTC (permalink / raw)
  To: netfilter

Hello,

> The mangle table OUTPUT chain is consulted before routing.
>
> root@room101:~# iptables -vt mangle -A OUTPUT -m owner --uid-owner rob0 -j MARK --set-mark 0x80
> MARK  all opt -- in * out *  0.0.0.0/0  -> 0.0.0.0/0  OWNER UID match 1000 MARK set 0x80
>
> Did you try this?

Yes, i overlooked this. Thank you very much, it solved my problem.

-- 
 Ignatich                          mailto:ignatich@gmail.com



^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: owner based routing
@ 2005-10-11 14:25 Ignatich
  2005-10-11 14:46 ` /dev/rob0
  0 siblings, 1 reply; 6+ messages in thread
From: Ignatich @ 2005-10-11 14:25 UTC (permalink / raw)
  To: netfilter

Hello,

dr> On Tuesday 2005-October-11 08:57, Ignatich wrote:
>> Since ipt_owner does not work in PREROUTING chain and fwmark is
>> pointless, I thought that ipt_ROUTE from p-o-m can help me.

dr> Why is fwmark pointless?

>> Any ideas how to solve my problem?

dr> I would try -j MARK --set-mark $UID for your -m owner matched packets
dr> and use a ip rule / ip route combination. I've not done this, but I
dr> don't see why it wouldn't work.

It's pointless because ipt_owner does not work in PREROUTING table. So
even if I mark packet routing decision is already made.

-- 
 Ignatich                          mailto:ignatich@gmail.com



^ permalink raw reply	[flat|nested] 6+ messages in thread
* owner based routing
@ 2005-10-11 13:57 Ignatich
  2005-10-11 14:07 ` /dev/rob0
  2005-10-12 20:57 ` Henrik Nordstrom
  0 siblings, 2 replies; 6+ messages in thread
From: Ignatich @ 2005-10-11 13:57 UTC (permalink / raw)
  To: netfilter

Hello,

I have a following problem. My goal is to allow traffic originating
from specific user/group to be routed via different gateway.

Here's my setup:
eth0 - default internet interface, ip z.z.z.z
eth1 - LAN, ip y.y.y.y

In LAN I have a hardware ADSL router with ip x.x.x.x.

Since ipt_owner does not work in PREROUTING chain and fwmark is
pointless, I thought that ipt_ROUTE from p-o-m can help me.

Here's what I did:

iptables -t mangle -A OUTPUT -o eth0 -m owner --gid-owner adsl -j
ROUTE --gw x.x.x.x --oif eth1

But it did not work. I belive this happened because matched packets
still had z.z.z.z as their source address.

So i tried that:

iptables -t mangle -A OUTPUT -o eth0 -m owner --gid-owner adsl -j
ROUTE --gw x.x.x.x --oif eth1 --continue
iptables -t nat -A POSTROUTING -o eth1 -m owner --gid-owner adsl -j
SNAT --to-source y.y.y.y

But still no luck. :(

Any ideas how to solve my problem?

-- 
 Ignatich                          mailto:ignatich@gmail.com



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

end of thread, other threads:[~2005-10-12 20:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-11 22:46 owner based routing Ignatich
  -- strict thread matches above, loose matches on Subject: below --
2005-10-11 14:25 Ignatich
2005-10-11 14:46 ` /dev/rob0
2005-10-11 13:57 Ignatich
2005-10-11 14:07 ` /dev/rob0
2005-10-12 20:57 ` Henrik Nordstrom

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