Автор Тема: Squid.conf  (Прочитано 1573 раз)

Оффлайн DarkStar

  • Sr. Member
  • ****
  • Сообщений: 374
    • Просмотр профиля
Squid.conf
« : Июнь 11, 2009, 02:04:56 »
Ребят кто-нибудь может дать готовый конфиг для сквида,никак не могу осилить по факам может по готовому пойму.Нужны только базовые настройки



Оффлайн muzungu

  • Moderator
  • Full Member
  • *****
  • Сообщений: 128
    • ICQ клиент - 222557959
    • Просмотр профиля
    • Email
Re: Squid.conf
« Ответ #1 : Июнь 11, 2009, 08:09:09 »
А что за задача? В конфиге  милион опций и все зависит от того - что надо сделать. Просто конф он и при инсталяции нормальный. Пиши поконкретней
Ничто не Вечно!

Оффлайн DarkStar

  • Sr. Member
  • ****
  • Сообщений: 374
    • Просмотр профиля
Re: Squid.conf
« Ответ #2 : Июнь 12, 2009, 10:19:16 »
У меня даже элементарно не получилось разделить интернет 2 машинам.

eth:0                                 
(мой ip)                       
(моя маска)                 
(мой шлюз)                 
(мой днс)                   
еще у меня интернет через
прокси допустим а это (мой прокси) значение моего прокси сервера провайдера

куда в конфиге прописывать значения от eth:0

eth:1

192.168.0.1
255.255.255.0
192.1.1.1
192.1.1.1

а теперь куда прописывать значения eth:1




Оффлайн muzungu

  • Moderator
  • Full Member
  • *****
  • Сообщений: 128
    • ICQ клиент - 222557959
    • Просмотр профиля
    • Email
Re: Squid.conf
« Ответ #3 : Июнь 12, 2009, 04:12:23 »
По дефолту прокси стартует на всех интерфейсах (посмотри: netstat -am| grep 3128). В настройках надо добавить лишь (красным)
===squid.conf===
...
acl all 0.0.0.0/0.0.0.0
acl mynet 192.168.0.0/255.255.255.0
http_access allow mynet

http_access deny all
...
============
***Имеется ввиду, что ты будешь пускать 192.168.0.0 сетку через Прокси***
Все! перезапусти squid: /etc/init.d/squid restart. Пропиши настройки Proxy в твоем броузере и открой какой-нибудь сайт.
« Последнее редактирование: Июнь 12, 2009, 04:14:41 от muzungu »
Ничто не Вечно!

Оффлайн DarkStar

  • Sr. Member
  • ****
  • Сообщений: 374
    • Просмотр профиля
Re: Squid.conf
« Ответ #4 : Июнь 12, 2009, 04:53:57 »
в дефолтном конфиге прописал эти два значения
вот что получилось при рестарте

debian:/home/tigran# /etc/init.d/squid3 restart
Restarting Squid HTTP Proxy 3.0: squid3 Waiting.....................done.
2009/06/13 01:49:57| WARNING: '0.0.0.0/0.0.0.0' is a subnetwork of '0.0.0.0/0.0.0.0'
2009/06/13 01:49:57| WARNING: because of this '0.0.0.0/0.0.0.0' is ignored to keep splay tree searching predictable
2009/06/13 01:49:57| WARNING: You should probably remove '0.0.0.0/0.0.0.0' from the ACL named 'all'
2009/06/13 01:49:57| aclParseAclLine: Invalid ACL type '192.168.0.0/255.255.255.0'
FATAL: Bungled squid.conf line 579: acl mynet 192.168.0.0/255.255.255.0
Squid Cache (Version 3.0.STABLE8): Terminated abnormally.
CPU Usage: 0.004 seconds = 0.000 user + 0.004 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
 failed!




Оффлайн muzungu

  • Moderator
  • Full Member
  • *****
  • Сообщений: 128
    • ICQ клиент - 222557959
    • Просмотр профиля
    • Email
Re: Squid.conf
« Ответ #5 : Июнь 12, 2009, 09:43:48 »
:)
правильно, там я упустил src:
===squid.conf===
...
acl all src 0.0.0.0/0.0.0.0
acl mynet src 192.168.0.0/255.255.255.0
http_access allow mynet
http_access deny all
...
============
« Последнее редактирование: Июнь 12, 2009, 09:49:49 от muzungu »
Ничто не Вечно!

Оффлайн DarkStar

  • Sr. Member
  • ****
  • Сообщений: 374
    • Просмотр профиля
Re: Squid.conf
« Ответ #6 : Июнь 13, 2009, 01:54:20 »
сделал все как ты писал,но почему то у меня нечего не получилось может мне отправить мой squid.conf :(



Оффлайн DarkStar

  • Sr. Member
  • ****
  • Сообщений: 374
    • Просмотр профиля
Re: Squid.conf
« Ответ #7 : Июнь 15, 2009, 02:26:15 »
и еще у меня доступ к интернету через прокси сервер порт 8080,нужно ли указывать в squid.conf порт 8080 или это не обязательно



Оффлайн muzungu

  • Moderator
  • Full Member
  • *****
  • Сообщений: 128
    • ICQ клиент - 222557959
    • Просмотр профиля
    • Email
Re: Squid.conf
« Ответ #8 : Июнь 16, 2009, 04:51:46 »
vi пользуешься? зайди в squid.conf и посмотри какой порт (дефолтный 3128) также acl-ы, там порядок определяет пускать или не пускать.
Ничто не Вечно!

Оффлайн DarkStar

  • Sr. Member
  • ****
  • Сообщений: 374
    • Просмотр профиля
Re: Squid.conf
« Ответ #9 : Июнь 16, 2009, 08:28:45 »
много чего перепробовал по разным факам настраивал,но таки элементарно не получилось дать допуск в интернет
вот тот кусок конфига где я заполнял как ты писал

#Default:
acl all src 0.0.0.0/0.0.0.0
#Recommended minimum configuration:
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
#
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
#acl localnet src 10.0.0.0/8   # RFC1918 possible internal network
#acl localnet src 172.16.0.0/12   # RFC1918 possible internal network
acl localnet src 192.168.0.0/24   # RFC1918 possible internal network
#
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

#  TAG: http_access
#   Allowing or Denying access based on defined access lists
#
#   Access to the HTTP port:
#   http_access allow|deny [!]aclname ...
#
#   NOTE on default values:
#
#   If there are no "access" lines present, the default is to deny
#   the request.
#
#   If none of the "access" lines cause a match, the default is the
#   opposite of the last line in the list.  If the last line was
#   deny, the default is allow.  Conversely, if the last line
#   is allow, the default will be deny.  For these reasons, it is a
#   good idea to have an "deny all" or "allow all" entry at the end
#   of your access lists to avoid potential confusion.
#
#Default:
# http_access deny all
#
#Recommended minimum configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
#
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
#http_access allow localnet
http_access allow localhost

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



Оффлайн muzungu

  • Moderator
  • Full Member
  • *****
  • Сообщений: 128
    • ICQ клиент - 222557959
    • Просмотр профиля
    • Email
Re: Squid.conf
« Ответ #10 : Июнь 18, 2009, 08:37:36 »
...
#http_access allow localnet
...
Почему закаментированно? Убери # и перезапусти squid
Ничто не Вечно!

Оффлайн DarkStar

  • Sr. Member
  • ****
  • Сообщений: 374
    • Просмотр профиля
Re: Squid.conf
« Ответ #11 : Июнь 19, 2009, 12:23:52 »
спасибо тебе большое  :) помогло