linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rainer Hochreiter <rainer@hochreiter.at>
To: linux-kernel@vger.kernel.org
Subject: ip routing
Date: 30 Nov 2003 09:24:01 +0100	[thread overview]
Message-ID: <1070180482.1852.25.camel@freddie.hochreiter.at> (raw)

hi list!

i have a problem with ip routing!

first of all my configuration:

Tux1 .... embedded linux (kernel-2.4.10) running busybox-0.60.3
          and 2 lan interfaces in different networks
          default gateway 10.1.0.254 via eth0
R1, R2 .. router (linux for testing)
Tux2 .... linux with network different to Tux1/eth0/eth1

     eth0=10.1.0.1/16 +-----+ eth1=10.2.0.1/16
                   .--|Tux1 |--.
                   |  +-----+  |
eth1=10.1.0.254/16 |           | eth1=10.2.0.254/16
                +-----+     +-----+
   ip_forward=1 | R1  |     | R2  | ip_forward=1
                +-----+     +-----+
eth0=10.3.1.254/16 |           | eth0=10.3.2.254/16
                   |           |
                   '-----+-----'
                         | eth0=10.3.0.1/16
                      +-----+
                      |Tux2 |
                      +-----+

i want to achieve, that each packet received on Tux1/eth1 will also be
replied via this interface. this isn't the case now, because the
received packets came from a different network and therefore the replies
are sent back via Tux1/eth0 using the default route.

but the replies have to be sent even when the connection between
Tux1/et0 and R1 is not available. a possible solution is, setting a
network route for network Tux2/eth0 via Tux1/eth1, but in my special
case, i do not know from which network i'll receive the packets!

and here i reached the point where my knowledge ends;-(

i tried to solve this problem in my application running on Tux1, using
the following code:

s = socket();
bind(s, "10.2.0.1"); // bind to Tux1/eth1
listen(s);
s2 = accept(s);
int yes=1;
setsockopt(s2, SOL_SOCKET, SO_DONTROUTE, &yes, sizeof(yes));

...but setting SO_DONTROUTE on socket s2 doesn't have the effect, that
the reply packets are always sent back via Tux1/eth1! 
is it possible at all to guarantee this in any case? because this means
bypassing the routing stuff!

any hints welcome!

greetings, 
rainer

PLEASE personally CC any answers and comment to my question - thnx!



             reply	other threads:[~2003-11-30  8:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-30  8:24 Rainer Hochreiter [this message]
2003-11-30 10:20 ` ip routing bert hubert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1070180482.1852.25.camel@freddie.hochreiter.at \
    --to=rainer@hochreiter.at \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).