Как правильно задать переменную чтобы iptables читал список ip адресов ?
В конфиге есть строка
# Кого перенаправлять на SQUID
SQUID="/etc/sysconfig/network/squid"
################################
#Само правило
iptables -t nat -A PREROUTING -s $SQUID -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
В ответ ругань
./iptables
iptables v1.4.16.3: invalid mask `squid' specified
Try `iptables -h' or 'iptables --help' for more information.
В самом файле squid пробовал писать
192.168.10.3
и так
192.168.10.3/255.255.255.0
и так
192.168.10.3 255.255.255.0
Все равно в ответ
В ответ ругань
./iptables
iptables v1.4.16.3: invalid mask `squid' specified
Try `iptables -h' or 'iptables --help' for more information.
Перенаправление прозрачный squid (Списка ip адресов)
Модераторы: SLEDopit, Модераторы разделов
-
Bizdelnick
- Модератор
- Сообщения: 21498
- Статус: nulla salus bello
- ОС: Debian GNU/Linux
Re: Перенаправление прозрачный squid
man iptables
[!] -s, --source address[mask][,...]
Source specification. Address can be either a network name, a hostname,
a network IP address (with /mask), or a plain IP address. Hostnames
will be resolved once only, before the rule is submitted to the kernel.
Please note that specifying any name to be resolved with a remote query
such as DNS is a really bad idea. The mask can be either a network
mask or a plain number, specifying the number of 1's at the left side
of the network mask. Thus, a mask of 24 is equivalent to
255.255.255.0. A "!" argument before the address specification inverts
the sense of the address. The flag --src is an alias for this option.
Multiple addresses can be specified, but this will expand to multiple
rules (when adding with -A), or will cause multiple rules to be deleted
(with -D).Пишите правильно:
| в консоли вку́пе (с чем-либо) в общем вообще | в течение (часа) новичок нюанс по умолчанию | приемлемо проблема пробовать трафик |
-
liaonau
- Сообщения: 390
- ОС: gentoo
-
drBatty
- Сообщения: 8735
- Статус: GPG ID: 4DFBD1D6 дом горит, козёл не видит...
- ОС: Slackware-current