Перейти к содержанию

Cartmans

Members
  • Постов

    5
  • Зарегистрирован

  • Посещение

    Никогда

Достижения Cartmans

  1. Попробовал настроить как показано в http://itdoc.com.ua/2009/01/ustanovka-debian-marshrutizatora -s-vozmozhnostyami-prozrachnogo-proxy-servera-debian-linux-p roxy-transparent-iptables/ но ничего не получилось , сейчас у меня следующее скрипт /etc/network/if-up.d/00-firewall следующего содержания: #!/bin/sh PATH=/usr/sbin:/sbin:/bin:/usr/bin # # удалить все действующие правила # iptables -F iptables -t nat -F iptables -t mangle -F iptables -X # Всегда принимать трафик на loopback-интерфейсе iptables -A INPUT -i lo -j ACCEPT # Разрешить соединения, которые инициированы изнутри (eth1) iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT # Разрешить доступ из LAN-сети к внешним сетям iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT # Masquerade. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # Запретить forward извне во внутреннюю сеть iptables -A FORWARD -i eth0 -o eth0 -j REJECT iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128 iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 8080 -j REDIRECT --to-port 3128 конфигурационный файл squid'а — /etc/squid/squid.conf http_port 127.0.0.1:3128 http_port 192.168.1.35:3128 transparent dns_nameservers 192.168.1.1 acl all src all acl manager proto cache_object acl office src 192.168.1.35 192.168.2.0/24 acl localhost src 127.0.0.1/255.255.255.255 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 CONNECT method CONNECT http_access allow localhost http_access allow manager localhost http_access allow office http_access deny CONNECT !SSL_ports
  2. В общем сейчас мой конфиг выглядит так http_port 3128 transparent dns_nameservers 192.168.1.1 acl all src all acl manager proto cache_object acl lan src 192.168.1.35 192.168.2.0/24 acl localhost src 127.0.0.1/255.255.255.255 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 CONNECT method CONNECT http_access allow localhost http_access allow manager localhost http_access allow lan http_access deny CONNECT !SSL_ports http_access deny all пытаюсь теперь настроить брандмауэр добавив для этого правила пересылки http-запросов, приходящих на порт 80, на порт прокси-сервера Squid iptables -t nat -A PREROUTING -i eth1 -p tcp –dport 80 -j DNAT –to 192.168.1.35:3128 iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 3128 но при попытки добавить первое правило получаю ошибку «Bad argument `–dport'»
  3. хочу настроить Squid как прозрачный прокси. На компе 2 сетевухи: eth0 192.168.1.35 для выхода в интернет eth1 192.168.2.1 для подключения к локальной сети в одном посте было описания конфига Squid такого содержания eth0 192.168.1.111 для выхода в интернет eth1 10.0.0.1 для подключения к локальной сети http_port 3128 acl lan src 192.168.1.111 10.0.0.0/24 http_access allow localhost http_access allow lan http_access deny all httpd_accel_host virtual httpd_accel_port 80 httpd_accel_with_proxy on httpd_accel_uses_host_header on так вот мене не совсем понятно что значит строка 10.0.0.0/24 это что краткая форма записи диапазона ip адресов типа (10.0.0.0 ; 10.0.0.1; 10.0.0.2 …. 10.0.0.24 ) или что то другое ?
  4. у меня просто выше приведенного куска конфига стояла строка http_port 3128 я ее удалил и в результате сообщение о том что уже использует порт 3128 исчезло но сайты так и не открываются. Я думал что если настройки прописать внизу конфига то они затрут те что прописаны выше. сейчас cache.log выглядит так CPU Usage: 0.016 seconds = 0.012 user + 0.004 sys Maximum Resident Size: 0 KB Page faults with physical i/o: 0 Memory usage for squid via mallinfo(): total space in arena: 2444 KB Ordinary blocks: 2299 KB 4 blks Small blocks: 0 KB 5 blks Holding blocks: 396 KB 1 blks Free Small blocks: 0 KB Free Ordinary blocks: 144 KB Total in use: 2695 KB 95% Total free: 144 KB 5% 2009/04/30 13:14:53| logfileClose: closing log /var/log/squid/store.log 2009/04/30 13:14:53| logfileClose: closing log /var/log/squid/access.log 2009/04/30 13:14:53| Squid Cache (Version 2.7.STABLE3): Exiting normally. 2009/04/30 13:15:45| Starting Squid Cache version 2.7.STABLE3 for amd64-debian-linux-gnu... 2009/04/30 13:15:45| Process ID 4102 2009/04/30 13:15:45| With 1024 file descriptors available 2009/04/30 13:15:45| Using epoll for the IO loop 2009/04/30 13:15:45| DNS Socket created at 0.0.0.0, port 38106, FD 6 2009/04/30 13:15:45| Adding nameserver 192.168.1.1 from squid.conf 2009/04/30 13:15:45| User-Agent logging is disabled. 2009/04/30 13:15:45| Referer logging is disabled. 2009/04/30 13:15:45| logfileOpen: opening log /var/log/squid/access.log 2009/04/30 13:15:45| Unlinkd pipe opened on FD 11 2009/04/30 13:15:45| Swap maxSize 1048576 KB, estimated 80659 objects 2009/04/30 13:15:45| Target number of buckets: 4032 2009/04/30 13:15:45| Using 8192 Store buckets 2009/04/30 13:15:45| Max Mem size: 204800 KB 2009/04/30 13:15:45| Max Swap size: 1048576 KB 2009/04/30 13:15:45| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec 2009/04/30 13:15:45| logfileOpen: opening log /var/log/squid/store.log 2009/04/30 13:15:45| Rebuilding storage in /var/spool/squid (CLEAN) 2009/04/30 13:15:45| Using Least Load store dir selection 2009/04/30 13:15:45| Set Current Directory to /var/spool/squid 2009/04/30 13:15:45| Loaded Icons. 2009/04/30 13:15:45| Accepting proxy HTTP connections at 192.168.1.33, port 3128, FD 13. 2009/04/30 13:15:45| Accepting ICP messages at 0.0.0.0, port 3130, FD 14. 2009/04/30 13:15:45| HTCP Disabled. 2009/04/30 13:15:45| WCCP Disabled. 2009/04/30 13:15:45| Ready to serve requests. 2009/04/30 13:15:45| Done reading /var/spool/squid swaplog (0 entries) 2009/04/30 13:15:45| Finished rebuilding storage from disk. 2009/04/30 13:15:45| 0 Entries scanned 2009/04/30 13:15:45| 0 Invalid entries. 2009/04/30 13:15:45| 0 With invalid flags. 2009/04/30 13:15:45| 0 Objects loaded. 2009/04/30 13:15:45| 0 Objects expired. 2009/04/30 13:15:45| 0 Objects cancelled. 2009/04/30 13:15:45| 0 Duplicate URLs purged. 2009/04/30 13:15:45| 0 Swapfile clashes avoided. 2009/04/30 13:15:45| Took 0.3 seconds ( 0.0 objects/sec). 2009/04/30 13:15:45| Beginning Validation Procedure 2009/04/30 13:15:45| Completed Validation Procedure 2009/04/30 13:15:45| Validated 0 Entries 2009/04/30 13:15:45| store_swap_size = 0k 2009/04/30 13:15:46| storeLateRelease: released 0 objects
  5. Нужна помощь в настройки squid. В общем проблема в следующем, установил SQUID 2.7.STABLE3 на один из компьютеров локальной сети (IP-192.168.1.33) с доступом в интернет через ADSL модем → роутер, прописал в файле /etc/squid/squid.conf следующие настройки: cache_mem 200 MB cache_dir ufs /var/spool/squid 1024 16 256 http_port 192.168.1.33:3128 dns_nameservers 192.168.1.1 acl manager proto cache_object acl allowed_hosts src 192.168.1.2-192.168.1.255 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 CONNECT method CONNECT http_access allow manager localhost http_access allow allowed_hosts http_access deny CONNECT !SSL_ports http_access deny all icp_access deny all В настройках браузера прописал: IP- 192.168.1.33 порт прокси — 3128 при попытки открыть в браузере какой либо адрес выдает сообщение «ERROR The requested URL could not be retrieved» Файл /var/log/squid/access.log содержит след. инфу 1241075198.883 0 192.168.1.33 TCP_DENIED/403 1372 GET http://ya.ru/ - NONE/- text/html 1241075201.895 0 192.168.1.33 TCP_DENIED/403 1394 GET http://ya.ru/favicon.ico - NONE/- text/html 1241075201.897 0 192.168.1.33 TCP_DENIED/403 1394 GET http://ya.ru/favicon.ico - NONE/- text/html /var/log/squid/cache.log CPU Usage: 0.020 seconds = 0.012 user + 0.008 sys Maximum Resident Size: 0 KB Page faults with physical i/o: 0 Memory usage for squid via mallinfo(): total space in arena: 2444 KB Ordinary blocks: 2299 KB 7 blks Small blocks: 0 KB 5 blks Holding blocks: 396 KB 1 blks Free Small blocks: 0 KB Free Ordinary blocks: 144 KB Total in use: 2695 KB 95% Total free: 144 KB 5% 2009/04/30 10:06:13| logfileClose: closing log /var/log/squid/store.log 2009/04/30 10:06:13| logfileClose: closing log /var/log/squid/access.log 2009/04/30 10:06:13| Squid Cache (Version 2.7.STABLE3): Exiting normally. 2009/04/30 10:06:22| Starting Squid Cache version 2.7.STABLE3 for amd64-debian-linux-gnu... 2009/04/30 10:06:22| Process ID 4706 2009/04/30 10:06:22| With 1024 file descriptors available 2009/04/30 10:06:22| Using epoll for the IO loop 2009/04/30 10:06:22| DNS Socket created at 0.0.0.0, port 40902, FD 6 2009/04/30 10:06:22| Adding nameserver 192.168.1.1 from squid.conf 2009/04/30 10:06:22| User-Agent logging is disabled. 2009/04/30 10:06:22| Referer logging is disabled. 2009/04/30 10:06:22| logfileOpen: opening log /var/log/squid/access.log 2009/04/30 10:06:22| Unlinkd pipe opened on FD 11 2009/04/30 10:06:22| Swap maxSize 1048576 KB, estimated 80659 objects 2009/04/30 10:06:22| Target number of buckets: 4032 2009/04/30 10:06:22| Using 8192 Store buckets 2009/04/30 10:06:22| Max Mem size: 204800 KB 2009/04/30 10:06:22| Max Swap size: 1048576 KB 2009/04/30 10:06:22| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec 2009/04/30 10:06:22| logfileOpen: opening log /var/log/squid/store.log 2009/04/30 10:06:22| Rebuilding storage in /var/spool/squid (CLEAN) 2009/04/30 10:06:22| Using Least Load store dir selection 2009/04/30 10:06:22| Set Current Directory to /var/spool/squid 2009/04/30 10:06:22| Loaded Icons. 2009/04/30 10:06:23| Accepting proxy HTTP connections at 0.0.0.0, port 3128, FD 13. 2009/04/30 10:06:23| commBind: Cannot bind socket FD 14 to 192.168.1.33:3128: (98) Address already in use 2009/04/30 10:06:23| Accepting ICP messages at 0.0.0.0, port 3130, FD 14. 2009/04/30 10:06:23| HTCP Disabled. 2009/04/30 10:06:23| WCCP Disabled. 2009/04/30 10:06:23| Ready to serve requests. 2009/04/30 10:06:23| Done reading /var/spool/squid swaplog (0 entries) 2009/04/30 10:06:23| Finished rebuilding storage from disk. 2009/04/30 10:06:23| 0 Entries scanned 2009/04/30 10:06:23| 0 Invalid entries. 2009/04/30 10:06:23| 0 With invalid flags. 2009/04/30 10:06:23| 0 Objects loaded. 2009/04/30 10:06:23| 0 Objects expired. 2009/04/30 10:06:23| 0 Objects cancelled. 2009/04/30 10:06:23| 0 Duplicate URLs purged. 2009/04/30 10:06:23| 0 Swapfile clashes avoided. 2009/04/30 10:06:23| Took 0.3 seconds ( 0.0 objects/sec). 2009/04/30 10:06:23| Beginning Validation Procedure 2009/04/30 10:06:23| Completed Validation Procedure 2009/04/30 10:06:23| Validated 0 Entries 2009/04/30 10:06:23| store_swap_size = 0k 2009/04/30 10:06:24| storeLateRelease: released 0 objects как это лечить ??
×
×
  • Создать...