Author Topic: Squid proxy transparent + iptables not working  (Read 345 times)

Offline exylonteam

  • Newbie
  • *
  • Posts: 1
Squid proxy transparent + iptables not working
« on: March 14, 2014, 03:07:07 PM »
Im trying to create a proxy server with squid that serves a LAN, the computers in LAN connect to server and go out to the internet, and when then try to go to a banned page, it blocks them.

It isnt working for me....

I will detail what Ive modified here:

nano /etc/network/interfaces:

Quote
auto LAN
iface LAN inet static
address 172.30.2.10
netmask 255.255.255.0

auto WAN
iface WAN inet dhcp

It working, I can send ping to LAN and to Google at same time, no problem with network.

nano /etc/squid3/squid.conf:

Quote
http_port 3128 transparent

# And uncheck this:
http_access allow localnet

The rest of the file is as default one.

sudo nano /etc/sysctl.conf:

Quote
# Just unchecked this:
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1

And the last file that Ive modified, sudo nano /etc/rc.local:

Quote
#I add this line:
sbin/iptables -t nat -A PREROUTING -s 172.30.2.0/24 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128

I have a windows xp client connected to server with this LAN  configuration:

Quote
address: 172.30.2.100
netmask: 255.255.255.0
gateway: 172.30.2.10
dns: 8.8.8.8, 8.8.4.4

I can send ping to server but I cant ping www.google.es(exemple).

Please someone can help me? where is my error?
« Last Edit: March 14, 2014, 03:11:07 PM by exylonteam »

Ubuntu Forums (Ubuntu Linux Support)

Squid proxy transparent + iptables not working
« on: March 14, 2014, 03:07:07 PM »