Linux-kernel mailing list archive 2000-29,: transproxy and linux-2.4

# transproxy and linux-2.4

Alexander V. Lukyanov (lav@long.yar.ru)
Wed, 19 Jul 2000 03:05:00 +0400

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Richard Gooch: "[BUG] PCMCIA CardBus problems"
- Previous message: Thomas Davis: "Re: Japanese (or other language) postings"
- Next in thread: Thomas Drillich: "Re: transproxy and linux-2.4"
- Reply: Thomas Drillich: "Re: transproxy and linux-2.4"

Hello!

I tried to setup transparent proxy on 2.4.0-pre4 kernel, with the following
commands:

iptables --table nat -A PREROUTING -p tcp -d 0.0.0.0/0 --dport 80 -j REDIRECT --to-port 81
iptables --table nat -A OUTPUT -p tcp -d 0.0.0.0/0 --dport 80 -j REDIRECT --to-port 81

(OUTPUT for connections outgoing from localhost, old kernels like 2.2
cannot do that)

Everything works if the HTTP request includes Host: field with port number.
But if it is absent, the request goes to correct host but to port 81, this
is where tproxy listens. This happens when connection originates at localhost,
I have not tried it with forwarding yet.

I guess this is either a bug in kernel (which returns wrong port in
getsockname), or there is some other method for retrieving original port
number. I hope somebody knows it.

Thanks.

    --
       Alexander.

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

- Next message: Richard Gooch: "[BUG] PCMCIA CardBus problems"
- Previous message: Thomas Davis: "Re: Japanese (or other language) postings"
- Next in thread: Thomas Drillich: "Re: transproxy and linux-2.4"
- Reply: Thomas Drillich: "Re: transproxy and linux-2.4"