Networking Forums

Networking Forums > Computer Networking > Linux Networking > split access routing: how to direct NEW connections

Reply
Thread Tools Display Modes

split access routing: how to direct NEW connections

 
 
Rudolf Potucek
Guest
Posts: n/a

 
      07-09-2004, 08:04 PM
Hi!

Ok, I have what would seem like a really simple setup: a linux machine
(debian woody) with two network cards and split access. One of the split
access connections has a static IP, the other a dynamic IP. I would like
to route default traffic through the dynamic IP but need to route certain
things (specifically SMTP so as not to get killed by RBL/DUL) through the
static IP. I have successfully configured this so it will reply to
incoming connections via the source interface.

Now for the problem: I would like to have all traffic originating on the
linux box and destined for port 25 sent trough the static IP and all
other traffic through dynamic.

I tried this:

# route add default gw "dynamic"
# iptables -t mangle -A OUTPUT -p tcp --dport 25 -j MARK --set-mark 1
# ip rule add fwmark 1 table static

For some reason I do not understand this fails. The outbound packets are
correctly sent via the static interface as I can verify on the server
being connected to, but the connection is then never established. The
destination server shows the connection hanging in SYN_RECV state.
However, if I set the default gateway to also be the static IP this
works, albeit sluggishly.

Any ideas or suggestions welcome!

Rudolf

--
The biggest spendings on MY credit card are Pizza ...
.... and Patents.
Rudolf, Dec. 15, 2002
 
Reply With Quote
 
 
 
 
Zenon Panoussis
Guest
Posts: n/a

 
      07-10-2004, 11:51 AM

Rudolf Potucek wrote:

> ...The outbound packets are
> correctly sent via the static interface as I can verify on the server
> being connected to, but the connection is then never established. The
> destination server shows the connection hanging in SYN_RECV state.


Could it be that the smtp server has a route to your
static IP which goes through your dynamic IP? Or that
its route to your host simply goes to your dynamic IP?
In that case the client sends out SYN on static and
expects a reply on it, the server sends SYN/ACK to the
dynamic, iptables see a SYN/ACK to a SYN that was never
sent out that inteface and drop it, so then both client
and server end up hanging, waiting for the other, until
they time out.

This situation could easily be caused by DNS, if for
instance your static IP starts talking as host.example.com
while host.example.com resolves to your dynamic IP. Try
giving your interfaces different hostnames and see if
it makes any difference.

Z
 
Reply With Quote
 
Rudolf Potucek
Guest
Posts: n/a

 
      07-11-2004, 10:18 PM
[Snip]pets of what Zenon Panoussis <(E-Mail Removed)> wrote:

: Rudolf Potucek wrote:
: Could it be that the smtp server has a route to your
: static IP which goes through your dynamic IP? Or that
: its route to your host simply goes to your dynamic IP?
: In that case the client sends out SYN on static and
: expects a reply on it, the server sends SYN/ACK to the
: dynamic, iptables see a SYN/ACK to a SYN that was never
: sent out that inteface and drop it, so then both client
: and server end up hanging, waiting for the other, until
: they time out.

I figured this had to be the case but there is no reason
that the destination should see my machine as anything
other than the static IP ... unless there is another
connection being established via the default GW.

: This situation could easily be caused by DNS, if for
: instance your static IP starts talking as host.example.com
: while host.example.com resolves to your dynamic IP. Try
: giving your interfaces different hostnames and see if
: it makes any difference.

Not in this case because if I set the default GW to the static
IP everything works and there is no change in the DNS behavior.
I shall need to investigate further ...

R

--
The more sophisticated you [become], the less you [rely] on fear and pain
to keep you alive; you [can] afford to ignore them because you [have]
other means of coping with the consequences if things [go] badly wrong.

-- Iain Banks, Look to Windward
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Direct Cable connections. =?Utf-8?B?UGV0ZXI=?= Windows Networking 0 02-01-2005 12:09 PM
Split 2 ISP connections riviereg Linux Networking 7 09-02-2004 10:28 AM
LPT direct connections JIMB Windows Networking 0 04-27-2004 05:18 PM
direct connections Ewak Windows Networking 1 09-19-2003 02:43 AM
Direct connections through NAT/firewall Jem Berkes Linux Networking 14 07-24-2003 10:53 AM



1 2 3 4 5 6 7 8 9 10 11