Get original destination IP and port with Linux 2.4 iptables redirect?
From: Lincoln Yeoh (junkto_at_tm.net.my)
Date: 11/12/03
- Next message: Tony George: "Using File::Copy with ClearCase Views"
- Previous message: Steve Grazzini: "Re: opendir and if -d $files problem"
- Next in thread: Ben Morrow: "Re: Get original destination IP and port with Linux 2.4 iptables redirect?"
- Reply: Ben Morrow: "Re: Get original destination IP and port with Linux 2.4 iptables redirect?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 12 Nov 2003 20:12:29 +0800
Sorry to repost this but I still haven't figured it out and there
weren't any responses.
--- Say I use iptables to redirect tcp connections to my perl proxy servers. How then do I get the original destination IP address and tcp port? On FreeBSD I just use ipfw and fwd and then following works: $daddr=$client->sockhost; $dport=$client->sockport; And then my various proxies work transparently. But on Linux I'm supposed to use some FD options: e.g. getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, &dst_addr, &slen) What's a good way to do this with perl? Working examples would be very helpful. I've tried perl's getsockopt but replacing OPTNAME with SO_ORIGINAL_DST doesn't work - it's not defined. perl -f getsockopt getsockopt SOCKET,LEVEL,OPTNAME I've tried specifying a numerical 80 for OPTNAME but not sure how to get the address etc. Thanks, Link.
- Next message: Tony George: "Using File::Copy with ClearCase Views"
- Previous message: Steve Grazzini: "Re: opendir and if -d $files problem"
- Next in thread: Ben Morrow: "Re: Get original destination IP and port with Linux 2.4 iptables redirect?"
- Reply: Ben Morrow: "Re: Get original destination IP and port with Linux 2.4 iptables redirect?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|