All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alvaro Uría" <fermat@rigel.deusto.es>
To: lartc@vger.kernel.org
Subject: [LARTC] Where is the returning connection?
Date: Sun, 11 Mar 2007 22:47:33 +0000	[thread overview]
Message-ID: <20070311224733.GC6990@mogli> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 3037 bytes --]

Hi all! I'm new to the list :-)

I'm having a weird problem in which I'm a little bit lost right now.

I've got a machine (Debian) connected to 2 different networks (A and B,
with 2 different net cards), and a web server that is listening on the
second one (B). I think I've configured correctly the rules and routes,
but I'm not being able to see the returning connection comming from the
same machine, but using the A network to reach the service in the B
network.

Being more precise,
        * A network: 192.168.1.2 connected to a switch (default gw)
        * B network: 192.168.2.2 connected to a router with 2 interfaces
        (192.168.2.1 and 192.168.1.30)

        * Clients can only connect to the service through
	192.168.1.30:80 (the router), where the dst IP is masked to
	192.168.2.2:10080

        * If I connect from any host but 192.168.1.2, everything runs ok
	(tcpdump shows me both ways of tcp packets)

Now, if I connect from that machine (that has the web server) through
the router (192.168.1.30:80),
	1. I see a SYN_SENT to 192.168.1.30 when I execute "netstat".

	2. If I put tcpdump on eth0 (192.168.1.2), I see the tcp packets
	going to 192.168.1.30 (I don't see any packets comming back)

	3. If I put tcpdump on eth1 (192.168.2.2), I see the tcp packets
	going to 192.168.2.2:10080 (from 192.168.1.2), but I don't see
	any packets comming back.

	4. I've replaced the web server with a tiny tcp listener that
	shows the client IP, and I don't see the connection from
	192.168.1.2 (I mean, any other clients connect correctly, but
	this one does not. Please remember that I can see tcpdump logs
	that say "192.168.1.2.32759 > 192.168.2.2.10080", etc.

	5. I've also put tcpdump on "lo" but I can't see anything either
	:-S

	6. I've tried "iptables --sport 10080 -j LOG"'s rules for OUTPUT
	chain, and nothing is shown.

The routes and rules I've configured are,

# A network
ip route add 192.168.1.0/24 dev eth0 src 192.168.1.2 table main
ip route add default via 192.168.1.1 table main

ip rule add from 192.168.1.2 table main

# B network
ip route add 192.168.2.0/24 dev eth1 src 192.168.2.2 table router
ip route add default via 192.168.2.1 dev eth1 onlink table router

ip rule add from 192.168.2.2 table router


And last, I've also tried to "-j MARK" those packets going to "--dport
10080" and add a rule like:

ip rule add fwmark <number> table router

But it didn't work either.

Why the connection is not arriving to the application that is listening?
(But it is arriving to the machine)

Why I can't see any kind of returning connection or ICMP packet telling
that something is unreachable? (Maybe that will be solved after the
first question)

Thank you very much in advance for any light on this ;-)

Best regards,
  Alvaro Uría

PS1: Direct connection from 192.168.1.2 to 192.168.2.2 (or using
127.0.0.1) is not a solution (I've kind of simplified the
infrastructure).

PS2: BTW, LARTC-HOWTO is great :-))

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

                 reply	other threads:[~2007-03-11 22:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20070311224733.GC6990@mogli \
    --to=fermat@rigel.deusto.es \
    --cc=lartc@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 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.