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 - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-07-2018, 01:43 AM   #1
butek
LQ Newbie
 
Registered: Oct 2009
Posts: 5

Rep: Reputation: 0
Dansguardian problem


Code:
eno1: 192.168.1.2/26 - WAN
eno2: 172.23.198.1/24 LAN
Squid block all. I can't see any website on workstation.
When I forward all on squid
Code:
iptables -t nat -A PREROUTING -s 172.23.198.0/255.255.255.0 -p tcp --dport 80 -j REDIRECT --to-port 3128
then everything work well.

but when I forward all on port 8080 ( Dansguardian) then workstation work bad.

Code:
iptables -t nat -A PREROUTING -s 172.23.198.0/255.255.255.0 -p tcp --dport 80 -j REDIRECT --to-port 8080
My firewall
Code:
echo "1" > /proc/sys/net/ipv4/ip_forward

iptables -F -t nat
iptables -X -t nat
iptables -F -t filter
iptables -X -t filter
iptables -t filter -P FORWARD DROP
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 8080 -j ACCEPT


iptables -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED
iptables -A FORWARD -j ACCEPT -m state --state ESTABLISHED,RELATED
iptables -A OUTPUT -j ACCEPT -m state --state ESTABLISHED,RELATED


iptables -t filter -A FORWARD -s 172.23.198.0/255.255.255.0 -d 0/0 -j ACCEPT
iptables -t filter -A FORWARD -s 0/0 -d 172.23.198.0/255.255.255.0 -j ACCEPT
iptables -t nat -A POSTROUTING -s 172.23.198.0/24 -d 0/0 -j MASQUERADE

iptables -A FORWARD -s 172.23.198.0/24 -j ACCEPT

iptables -t nat -A PREROUTING -i eno2 -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -i eno2 -p tcp --dport 3124 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -i eno2 -p tcp --dport 3127 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -i eno2 -p tcp --dport 3128 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -i eno2 -p tcp --dport 8080 -j REDIRECT --to-port 8080

iptables -A INPUT -i eno2 -p tcp --dport 8080 -j ACCEPT
iptables -t nat -A PREROUTING -i eno2 -p tcp --dport 80 -j REDIRECT --to-ports 8080

iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
squid.conf
Code:
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl siec src 172.23.198.0/24
acl godziny_pracy time  00:01-21:30


acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

http_access allow localhost
http_access allow siec godziny_pracy

# And finally deny all other access to this proxy
http_access deny all

http_port 172.23.198.1:3128 transparent
dansguardian.conf
Code:
filterip =172.23.198.1
filterport = 8080
proxyip = 172.23.198.1
 
Old 03-15-2018, 02:01 AM   #2
bcwagne
Member
 
Registered: Feb 2008
Distribution: Debian Testing
Posts: 169

Rep: Reputation: 32
I had the runaround with dansguardian and squid. I don’t know your application, but if you just want a dans guardian filter and don’t need the caching capability of squid then you might try looking at a lighter weight proxy server. I tried a bunch of proxies and finally settled on tinyproxy. This was many years ago, however, and I haven’t needed or set up a proxy lately so I’m sure things have changed.

Squid is powerful, but sometimes it is like using a swiss army knife when all you need is a screwdriver—in other words, squid tries to do too many things.

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
Problem Starting Dansguardian doode31 Linux - Software 0 05-14-2012 02:05 AM
Dansguardian Problem helios99 Linux - Software 3 05-27-2009 08:11 PM
Problem with dansguardian ajayan Linux - Newbie 0 05-05-2009 04:50 AM
DansGuardian lag problem rvo Linux - Server 3 02-10-2009 12:40 PM
Dansguardian problem please help staleksandar Linux - Server 7 08-07-2007 07:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:39 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