LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-08-2006, 04:32 AM   #1
collen
Member
 
Registered: Jun 2003
Location: /
Distribution: Fedora/Debian
Posts: 86

Rep: Reputation: 15
Question redirect all inet trafic to proxy how ?? [2]


Ok, i'm (still) trying to make an internal lan talk to an external proxy..

lan <-> Linuxrouter <-> proxy -> inet

proxy works transparent.
linuxrouter can trace and ping the outside world (inet)

here is my iptables script for linuxrouter:
192.168.2.19 = proxy
192.168.2.8 = eth0 linuxrouter [external-net]
192.168.1.10 = eth1 linux router [internal-net]
192.168.1.0/24 = lan
-------------------------------------------
#!/bin/sh
echo "flushing.."
iptables -F
iptables -t nat -F
echo "default -> accept"
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
echo "forward"
echo 1> /proc/sys/net/ipv4/ip_forward
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
###iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo "redirect"
iptables -t nat -A PREROUTING -i eth0 -s ! 192.168.2.19 -p tcp --dport 80 -j DNAT --to 192.168.2.19:8080
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.0/24 -d 192.168.2.19 -j SNAT --to 192.168.2.8
iptables -A FORWARD -s 192.168.1.0/24 -d 192.168.2.19 -i eth1 -o eth0 -p tcp --dport 8080 -j ACCEPT
-------------------------------------------

these rules give nothing, no trace or ping to proxy/inet
the idee is to send all http/inet requests to the proxy-server.
and no trafic goes outside...
so i need 0.0.0.0 port 80 request redirected to the proxy port 8080.

the last 3 lines are copied from http://tldp.org/HOWTO/TransparentProxy-6.html

what goes wrong with this script..??
 
Old 02-08-2006, 09:07 PM   #2
halvy
Member
 
Registered: Aug 2005
Location: Anchorage, Alaska (soon EU, hopefully)
Distribution: Anything NOT SystemD (ie. M$) related.
Posts: 918

Rep: Reputation: 42
where is the error message or summary from logs?

i don't know iptables hardly at all, sorry.

but this seems like a 'doable' thing.

but without a clearer understanding of what is going wrong, i'm not sure anyone can help you.

i'd start by taking it all down (ie the walls)..(leave inet off if you are tooo scared), then build until it works.

good luck.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
redirect all inet trafic to proxy how ?? collen Linux - Networking 4 02-07-2006 06:03 AM
Trafic shaper ... how ? sys7em Linux - Networking 0 01-24-2005 06:35 PM
trafic limits gekkie_007 Linux - Networking 1 02-23-2003 05:06 AM
redirect my proxy qweqwe Linux - Networking 1 07-04-2002 08:33 PM
Monitor http trafic Justinw Linux - Networking 2 05-04-2001 07:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration