Fedora Linux Support Community & Resources Center
  #1  
Old 30th August 2005, 06:03 PM
Jeff Sadowski Offline
Registered User
 
Join Date: Jun 2005
Age: 38
Posts: 350
iptables redirect

Ok I'm not sure what im looking for. I thought I knew iptables well enough but I need a little help.

what I want to do:
When a computer 172.16.0.100 through 172.16.0.150 requests to connect to port 80 on machine 172.16.0.200(my linux box) it redirects that to port 80 on 172.16.0.250. My gateway is 172.16.0.1

I tried the following on 172.16.0.200 but it doesn't work as I expected
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT -d 172.16.0.250 --to-port 80
echo 1 >/proc/sys/net/ipv4/ip_forward

Has anyone done anything similar?
Reply With Quote
  #2  
Old 30th August 2005, 06:12 PM
Jeff Sadowski Offline
Registered User
 
Join Date: Jun 2005
Age: 38
Posts: 350
this should be very simmilar to a transparent proxy server with the exceptions that it is on a different machine than the original request and that this machine is not the gateway
Reply With Quote
  #3  
Old 30th August 2005, 06:17 PM
Jeff Sadowski Offline
Registered User
 
Join Date: Jun 2005
Age: 38
Posts: 350
heres a relevant transparent proxy snip

Configuring a transparent proxy
Traffic interception
Intercept and/or redirect the traffic to the chosen port. Having the proxy on the same machine as the interceptor is preferable. The code example uses iptables as the redirection mechanism, and port 8080 as the proxy's http_port.
To a different machine
iptables -t nat -A PREROUTING -i $INTERFACE -p tcp --dport 80 -j DNAT --to 10.0.3.1:8080
Reply With Quote
  #4  
Old 30th August 2005, 06:22 PM
Jeff Sadowski Offline
Registered User
 
Join Date: Jun 2005
Age: 38
Posts: 350
I tried on 172.16.0.200
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to 172.16.0.250:80

but then when I try "lynx -dump -source http://172.16.0.200" on 172.16.0.100 lynx stalls

so this isn't quite it
Reply With Quote
Reply

Tags
iptables, redirect

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
command #service iptables save changed the original config of iptables kesavulur Security and Privacy 0 28th November 2007 06:33 AM
How to redirect (prerouting?) ports using iptables? emamm Servers & Networking 1 22nd August 2006 01:38 AM
help! redirect tcp port tcp/4000 to tcp/22 using iptables ikkubus Servers & Networking 0 2nd June 2006 07:59 AM


Current GMT-time: 10:53 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat