All of lore.kernel.org
 help / color / mirror / Atom feed
* Multiple output routes
@ 2004-12-15  9:44 O-Zone
  2004-12-15 15:10 ` Jason Opperisano
  0 siblings, 1 reply; 2+ messages in thread
From: O-Zone @ 2004-12-15  9:44 UTC (permalink / raw)
  To: netfilter

Hi all,
i want to route traffico for a specific subnet to routeA while default route 
for my linuxbox is routeB. Here's the diagram:

(internet)--[Router A]---+
                                    |
                                [Linux BOX]----(Subnet 10.0.0.x)
                                    |
(internet)--[Router B]---+

RouterA and RouterB have the same subnet (i.e. RouterA lan is 192.168.0.1 and 
RouterB has 192.168.0.2) and LinuxBox have ONLY ONE externat iface like 
192.168.0.3. While i use LinuxBOX i wanna go "out" trought 192.168.0.1 but 
PC's MASQ'ed in Subnet 10.0.0.x must go out throug 192.168.0.2. 

Can someone point me in the right direction ?

Thanks ! Oz

-- 
------
O-Zone ! www.zerozone.it


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

* Re: Multiple output routes
  2004-12-15  9:44 Multiple output routes O-Zone
@ 2004-12-15 15:10 ` Jason Opperisano
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Opperisano @ 2004-12-15 15:10 UTC (permalink / raw)
  To: netfilter

On Wed, 2004-12-15 at 04:44, O-Zone wrote:
> Hi all,
> i want to route traffico for a specific subnet to routeA while default route 
> for my linuxbox is routeB. Here's the diagram:
> 
> (internet)--[Router A]---+
>                                     |
>                                 [Linux BOX]----(Subnet 10.0.0.x)
>                                     |
> (internet)--[Router B]---+
> 
> RouterA and RouterB have the same subnet (i.e. RouterA lan is 192.168.0.1 and 
> RouterB has 192.168.0.2) and LinuxBox have ONLY ONE externat iface like 
> 192.168.0.3. While i use LinuxBOX i wanna go "out" trought 192.168.0.1 but 
> PC's MASQ'ed in Subnet 10.0.0.x must go out throug 192.168.0.2. 

leave the default gateway of "Linux Box" set to RouterA--which will take
care of all packets from "Linux Box" being routed out via RouterA.

setup policy routing so that packets from 10.0.0.0/24 get routed out via
RouterB:

  echo 200 RouterB >> /etc/iproute2/rt_tables

  ip rule add fwmark 0x01 table RouterB

  ip route add default via 192.168.0.2 table RouterB

  ip route flush cache

  iptables -t mangle -A PREROUTING -i $insideIF -s 10.0.0.0/24 \
    -j MARK --set-mark 0x01

add filter and nat rules as necessary...

-j

--
"I'm a well-wisher, in that I don't wish you any specific harm."
	--The Simpsons



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

end of thread, other threads:[~2004-12-15 15:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-15  9:44 Multiple output routes O-Zone
2004-12-15 15:10 ` Jason Opperisano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.