All of lore.kernel.org
 help / color / mirror / Atom feed
* IPTABLES + IPROUTE2
@ 2004-01-30  9:39 L.Malinov
  2004-01-30 10:50 ` Ray Leach
  0 siblings, 1 reply; 9+ messages in thread
From: L.Malinov @ 2004-01-30  9:39 UTC (permalink / raw)
  To: netfilter

Hi Antony,

According to the iproute2 manual, I can't do routing based on a destination
port but based on the fwmark. So that's why I think I can achieve that alone
with iproute2 only and I need iptables to put the mark as well. But in this
case I'm not sure that this can be achieved on a box with one network card
only or for traffic generated lacaly from the box. Any suggestions?

Regards

L.Malinov


On Saturday 24 January 2004 12:57 pm, L.Malinov wrote:

> Hi Antony,
>
> In my situation is not possible to set router1 as a default route because
> the machine acts as a mail server as well and the mail needs to go through
> router1.

Okay then - in that case I suggest you use iproute2 to route all TCP port 80
packets via router2, all TCP port 25 packets via router1, and decide what
you
want to do with everything else such as DNS.   I don't see that there should
be any need to MARK packets - just route based on the destination port
number.

see http://lartc.org for more details of iproute2 and what it can do.

Regards,

Antony.

--
Wanted: telepath.   You know where to apply.

                                                     Please reply to the
list;
                                                           please don't CC
me.




^ permalink raw reply	[flat|nested] 9+ messages in thread
* IPTABLES + IPROUTE2
@ 2004-01-24 12:57 L.Malinov
  2004-01-24 14:54 ` Antony Stone
  0 siblings, 1 reply; 9+ messages in thread
From: L.Malinov @ 2004-01-24 12:57 UTC (permalink / raw)
  To: netfilter

Hi Antony,

In my situation is not possible to set router1 as a default route because
the machine acts as a mail server as well and the mail needs to go through
router1.




^ permalink raw reply	[flat|nested] 9+ messages in thread
* IPTABLES + IPROUTE2
@ 2004-01-23 11:44 L.Malinov
  2004-01-23 23:51 ` Antony Stone
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: L.Malinov @ 2004-01-23 11:44 UTC (permalink / raw)
  To: netfilter

Hi there,

I have the following configuration: Local Net with Linux RedHat 9.0 Squid
proxy server (with one net card) and 2 gateways - router1 and router2. The
default gateway for everyone including the proxy is router1. I'd like, the
http request from the local net sent to the proxy to be forwarded to the
Internet via router2. I'm trying the following configuration:

iptables -A OUTPUT -o eth0 -t mangle -p tcp --dport 80 -j MARK --set-mark 2
echo 202 www.out >> /etc/iproute2/rt_tables
ip rule add fwmark 2 table www.out
ip route add default via router2 dev eth0 table www.out

It looks like the packets go through the right chain under iptables and get
marked, however after that they still don't get forwarded via router2 but
router1. What could be wrong in this config and is this possible to achieve
at all with the above configuration?

Regards

L.Malinov



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

end of thread, other threads:[~2004-01-30 10:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-30  9:39 IPTABLES + IPROUTE2 L.Malinov
2004-01-30 10:50 ` Ray Leach
  -- strict thread matches above, loose matches on Subject: below --
2004-01-24 12:57 L.Malinov
2004-01-24 14:54 ` Antony Stone
2004-01-23 11:44 L.Malinov
2004-01-23 23:51 ` Antony Stone
2004-01-24  1:04 ` Ramin Dousti
2004-01-24 12:05   ` L.Malinov
2004-01-26  7:53 ` Klemen Kecman

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.