Network Troublshooting > General Networking Support in Linux

IP masq and squid proxy.

(1/3) > >>

I need to know how to configure squid proxy and IP masq on my server, if I may say the necessery conf and steps to take in getting it solved. I will appreciate it.

I think you are asking for transparent proxy:: but i m giving you both solution 1. only routing.. 2. transparent proxy..
1. Only Nat or routing::
--- Code: --- #!/bin/sh

$iptables --flush -t nat

iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
--- End code ---
In above i m assuming that you have eth1 connected to internet and eth0  your local network.. By running the above script on your computert u will able to share the internet from it to other computers.

2. Now for transparent proxy...

--- Code: --- #Transparent proxy
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
--- End code ---
Now in addition to script of NAT if you use these lines on your computer u wil be able to use transparent proxy . i am assuming that your proxy port is 3128.

I need to know how am going to run the follow script and how to edit the transparent scripts.
were do I go to if i want to run this script. I need to know the steps to take .

just make a text file say !!  "rc.nat" and put all the above code in that file now... save this file to your startup script directory i.e. /etc/rc.d/

Also make that file execuatble by
--- Code: ---chmod 755 <filename>
--- End code ---

the last step is to open the /etc/rc.d/rc.local file and in the end of file put the following  
--- Code: ---/etc/rc.d/rc.nat
--- End code ---
It will make the script to be execute on bootup..

I have a problem with the squid in Redhat 9.0, Whwn I finished to install it and I type
service  squid start , it's not work

Which the problem is ?


[0] Message Index

[#] Next page

Go to full version