решил сделать сервак,поставил dns dhcp squid настроил,проверил,всё работает,
поставил траффпро
тут начались проблемы,вот конфиг сквида:
http_port 192.168.0.1:3128 transparent
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \\\\?
cache deny QUERY
acl apache rep_header Server ^Apache
cache_dir ufs /var/spool/squid 4096 16 256
hosts_file /etc/hosts
acl all src 192.168.0.0/24
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8ac
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
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 Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl Safe_ports port 995 # POP3
acl Safe_ports port 25 # SMTP
acl Safe_ports port 5222 # JABBER
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow all
http_access allow localhost
http_access allow all
http_reply_access allow all
icp_access allow all
cache_effective_group proxy
coredump_dir /var/spool/squid
logformat traffpro %>a %<A %lp %<st %ru
access_log /var/log/squid/access.log traffpro
visible_hostname artem-server
dns_nameservers 192.168.0.1
вот конфиг трафпро:
to_install_dir=/opt/traffpro
daemon=true
db_url=localhost
db_usr=root
db_passwd=[htygjl,thtim!
db_name=traffpro
time_in=15
time_out=360
control_eth_addr=true
net_number=0
ports_detail=true
ss_enabled=false
eth_out=eth0
url_detail=true
out_ip=94.242.6.254
listen_addr=127.0.0.1
listen_port=9999
ip_queue_maxlen=2048000
squid_connect=true
squid_log_file=/var/log/squid/access.log
и правила траффпро:
iptables -A INPUT -m tcp -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -m tcp -p tcp --sport 22 -j ACCEPT
iptables -t mangle -A PREROUTING -p tcp --dport 80 -d 192.168.0.0/255.255.255.0 -j ACCEPT
iptables -t mangle -A PREROUTING -s 192.168.0.0/255.255.255.0 -p tcp --dport 80 -j QUEUE
iptables -t mangle -A PREROUTING -s 192.168.0.0/255.255.255.0 -p tcp --dport 3128 -j QUEUE
iptables -t nat -A PREROUTING -m tcp -p tcp -s 192.168.0.0/255.255.255.0 -d ! 192.168.0.0/255.255.255.0 --dport 80 -j REDIRECT --to-ports 3128
iptables -A INPUT -s 192.168.0.0/255.255.255.0 -m tcp -p tcp --dport 3128 -j ACCEPT
iptables -A OUTPUT -p tcp -d 192.168.0.0/255.255.255.0 --sport 3128 -j QUEUE
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
на боксе адреса получаю автоматически(192.168.0.16),добавил в трафпро пользователя с таким ип,какзалось инет должен на нем появиться,а нет,через iptraf посмотрел что с бокса идут запросы на какой-то адрес по порту 80(сквид настроен разрешать у пускать на этом порту)но инета нет.
при этом если я просто пропишу iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE то на боксе он есть!
что делать?подозреваю что на реальном серваке с компами будет такое же
p.s.eth0-94.242.6.254 инет
eth1-192.168.0.1 локалка
адреса раздаються от 192.168.0.16 до 192.168.0.254