LINUX.ORG.RU
ФорумAdmin

squid DNS и консоль


0

0

Всем здрям, есть прокся squid с опцией:
dns_nameservers xx.xx.xx.182
и настроенным iptables:
-A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,ACK SYN -j REJECT --reject-with icmp-port-unreachable
-A INPUT -s xx.xx.xx.182 -i eth0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -s xx.xx.xx.184 -i eth0 -p tcp -m tcp --dport 53 -j ACCEPT
-A FORWARD -o eth0 -p tcp -j DROP

С браузера клиенты ходят прекрасно и нормально, но если я попробую с консоли набрать slackpkg upgrade packages то получаю ошибку при резольвинге адреса. export http_proxy=my_proxy:port и ftp_proxy=my_proxy:port добавлено.

★★★★★

Ответ на: комментарий от sdio

-A INPUT -s xx.xx.xx.182 -i eth0 -p udp -m udp --dport 53 -j ACCEPT не помогло, грабли и костыли доустанавливать не охото.

splinter ★★★★★
() автор топика

> -A INPUT -s xx.xx.xx.182 -i eth0 -p tcp -m tcp --dport 53 -j ACCEPT
> -A INPUT -s xx.xx.xx.184 -i eth0 -p tcp -m tcp --dport 53 -j ACCEPT


Это ты пускаешь 182 и 184 к своей проксе на tcp-порт 53

> -A INPUT -s xx.xx.xx.182 -i eth0 -p udp -m udp --dport 53 -j ACCEPT


Это ты пускаешь 182 к своей проксе на udp-порт 53

На самой проксе есть DNS-сервер?

То, что браузера нормально ходят в инет - это понятно. Когда устанавливается прокси-сервер в настройках, то браузера перестают распознавать DNS-имена и просто шлют на проксик запросы. А сам проксик уже и распознаёт DNS->IP. То есть, с самого проксика можно обращаться по именам. А вот транзит DNS-запросов сквозь проксик у тебя запрещён. Попробуй:

-A FORWARD -s xx.xx.xx.182 -i eth0 -p udp -m udp --dport 53 -j ACCEPT

Slavaz ★★★★★
()
Ответ на: комментарий от Slavaz

-A FORWARD -s xx.xx.xx.182 -i eth0 -p udp -m udp --dport 53 -j ACCEPT
не помогло:
@bastilie:~# slackpkg update

Updating the package lists...
Downloading...
Downloading ChangeLog.txt...
--17:22:46-- ftp://slackware.su29.ru/slackware-current/ChangeLog.txt
=> `/tmp/slackpkg.hNd3dT/ChangeLog.txt'
Connecting to 172.24.119.223:8080... connected.
Proxy request sent, awaiting response... 404 Not Found
17:22:57 ERROR 404: Not Found.

>А сам проксик уже и распознаёт DNS->IP

Да с него по именам инет хосты пингуются.

splinter ★★★★★
() автор топика
Ответ на: комментарий от chocholl

это все происходит на машине со сквидом?
что прописано в /etc/resolv.conf?
что говорит nslookup kernel.org?

на машине со сквидом все прекрасно, я не могу в сделать slackpkg и прочее за сквидом.

splinter ★★★★★
() автор топика
Ответ на: комментарий от Slavaz

да включенно, все равно такая же ошибка.
@bastilie:~# slackpkg update

Updating the package lists...
Downloading...
Downloading ChangeLog.txt...
--19:01:33-- ftp://slackware.su29.ru/slackware-current/ChangeLog.txt
=> `/tmp/slackpkg.GM900e/ChangeLog.txt'
Connecting to 172.24.119.223:8080... connected.
Proxy request sent, awaiting response... 404 Not Found
19:01:40 ERROR 404: Not Found.

splinter ★★★★★
() автор топика
Ответ на: комментарий от splinter

Давай определимся с исходными условиями.

Есть комп в локальной сети xx.xx.xx.182
Есть проксик (он же роутер) из локалки в инет, его адрес пусть будет xx.xx.xx.1.

Что известно по поводу роутера:
- На роутере разрешён форвард пакетов (sysctl net.ipv4.ip_forward говорит "1")
- на самом роутере в /etc/resolv.conf прописаны правильные адреса DNS
- на роутере команда "traceroute -p 53 192.36.125.2" работает (должна работать :).
- с самого роутера команда "host google.com" работает.

Что известно по поводу xx.xx.xx.182:
- команда "host google.com" не работает

Что неизвестно по поводу роутера:
- полный вывод "iptables -L -n" Вдруг что блокирует из непоказанного?

Что неизвестно по поводу xx.xx.xx.182:
- работает ли команда "traceroute -p 53 192.36.125.2"
- Содержимое /etc/resolv.conf
- роутинг по умолчанию (иногда при работающем проксике дефолтный роут не прописывают)

Что неизвестно - озвучь, плиз. тогда будет проще сказать, что случилось.

P.S. Кстати, проверь ещё раз настройки проксика в slackpkg. Он тоже, по идее, не должен самостоятельно распознавать имена...

Slavaz ★★★★★
()
Ответ на: комментарий от chocholl

> у тебя прозрачный прокси чтоли?
нет

splinter ★★★★★
() автор топика
Ответ на: комментарий от Slavaz

> Есть комп в локальной сети xx.xx.xx.182
Есть проксик (он же роутер) из локалки в инет, его адрес пусть будет xx.xx.xx.1.

да

> На роутере разрешён форвард пакетов (sysctl net.ipv4.ip_forward говорит "1")
- на самом роутере в /etc/resolv.conf прописаны правильные адреса DNS

да

>на роутере команда "traceroute -p 53 192.36.125.2" работает (должна работать :).
- с самого роутера команда "host google.com" работает.

root@proxynok:~# traceroute -p 53 192.36.125.2
traceroute to 192.36.125.2 (192.36.125.2), 30 hops max, 38 byte packets
1 80.67.210.norcom.ru (80.67.210.153) 24.759 ms 1.407 ms 0.691 ms
2 80.67.223.norcom.ru (80.67.223.150) 1.222 ms 1.207 ms 1.235 ms
3 80.67.208.norcom.ru (80.67.208.62) 1.240 ms 1.689 ms 1.736 ms
4 80.67.208.norcom.ru (80.67.208.150) 551.177 ms 551.132 ms 553.381 ms
5 msk-dsr6-vl232.rt-comm.ru (217.106.3.45) 551.642 ms 551.606 ms 553.630 ms
6 195.69.145.203 (195.69.145.203) 627.846 ms 628.547 ms 628.590 ms
7 dk-ore.nordu.net (193.10.68.49) 628.088 ms 628.322 ms 628.585 ms
8 se-fre.nordu.net (193.10.68.117) 637.575 ms 637.805 ms 638.585 ms
9 c1sth-so-6-0-0.sunet.se (193.10.252.162) 638.087 ms 638.560 ms 656.072 ms
10 sunic.sunet.se (192.36.125.2) 640.341 ms 638.580 ms 638.336 ms

root@proxynok:~# host google.com
google.com has address 74.125.67.100
google.com has address 209.85.171.100
google.com has address 74.125.45.100
google.com mail is handled by 10 smtp1.google.com.
google.com mail is handled by 10 smtp2.google.com.
google.com mail is handled by 10 smtp3.google.com.
google.com mail is handled by 10 smtp4.google.com.

#cat /etc/resolv.conf
nameserver 80.67.208.182
nameserver 80.67.208.184

>- роутинг по умолчанию (иногда при работающем проксике дефолтный роут не прописывают)

root@proxynok:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
80.67.210.152 * 255.255.255.248 U 0 0 0 eth0
localnet * 255.255.254.0 U 0 0 0 eth1
172.0.0.0 172.24.118.1 255.0.0.0 UG 0 0 0 eth1
loopback * 255.0.0.0 U 0 0 0 lo
default 80.67.210.norco 0.0.0.0 UG 0 0 0 eth0


# Downloaded files will be in directory below:
TEMP=/var/cache/packages

# Package lists, file lists and others will be at WORKDIR:
WORKDIR=/var/lib/slackpkg

# Special options for wget (default is WGETFLAGS="--passive-ftp")
WGETFLAGS="--passive-ftp"

# If DELALL is "on", all downloaded files will be removed after install.
DELALL=on

# If CHECKPKG is "on", the system will check the md5sums of all packages before
# install/upgrade/reinstall is performed.
CHECKPKG=on

# If CHECKGPG is "on", the system will verify the GPG signature of each package
# before install/upgrade/reinstall is performed.
CHECKGPG=on

# The lines below will set the download priority.
# Default values: /patches /slackware /extra /pasture /testing
FIRST=patches
SECOND=slackware
THIRD=extra
FOURTH=pasture
FIFTH=testing

# The default MAIN is "slackware", but some derived distros uses other
# names as the main directory. Of course, MAIN needs to be listed in
# the download priority directories
MAIN=slackware

# Enables (on) or disables (off) slackpkg's post-installation features, such
# as checking for new (*.new) configuration files and new kernel images, and
# prompts you for what it should do. Default=on
POSTINST=on

# The ONOFF variable sets the initial behavior of the dialog interface.
# If you set this to "on" then all packages will be selected by default.
# If you prefer the opposite option (all unchecked), then set this to "off".
ONOFF=on

# If this variable is set to "on", all files will be downloaded before the
# requested operation (install or upgrade) is performed. If set to "off",
# then the files will be downloaded and the operation (install/upgrade)
# performed one by one. Default=off
DOWNLOAD_ALL=off

# Enables (on) or disables (off) the dialog interface in slackpkg. Default=on
DIALOG=on

splinter ★★★★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.