LINUX.ORG.RU
ФорумAdmin

iptables пропускает правила.


0

0

Стоит ubunbtu кот. является шлюзом в сети,dns раздает win2003.Необходимо закрыть любую активность с ip адрессом xx.xxx.xx.xxx.Устанваливаю правило : iptables -A OUTPUT -d xx.xxx.xx.xxx -j DROP iptables -A INPUT -d xx.xxx.xx.xxx -j DROP с самой ubuntu доступа к xx.xxx.xx.xxx НЕТ,НО все кто.находятся в сети имеют доступ к xx.xxx.xx.xxx.Подскажите как закрыть доступ к этому адрессу всем в сети.Так же на ubuntu поднят squid кот.раздет инет.может в нем проблема?

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

добавил в forward. iptables -A FORWARD -d xx.xxx.xx.xxx -j DROP все равно пингуется из сети и терь с самой ubuntu... может дело не в правилах?

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

Chain FORWARD (policy DROP)

target prot opt source destination

TCPMSS tcp  — anywhere anywhere tcp flags:SYN,RST/SYN tcpmss match 1400:1536 TCPMSS clamp to PMTU

DROP tcp  — anywhere anywhere multiport sports loc-srv:netbios-ssn,microsoft-ds

DROP tcp  — anywhere anywhere multiport dports loc-srv:netbios-ssn,microsoft-ds

DROP udp  — anywhere anywhere multiport sports loc-srv:netbios-ssn,microsoft-ds

DROP udp  — anywhere anywhere multiport dports loc-srv:netbios-ssn,microsoft-ds

ACCEPT all  — anywhere anywhere

ACCEPT all  — anywhere anywhere

ACCEPT all  — 192.168.10.0/24 anywhere state NEW,RELATED,ESTABLISHED

ACCEPT all  — anywhere 192.168.10.0/24 state RELATED,ESTABLISHED

DROP all  — anywhere xx.xxx.xx.xxx

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

все равно пингуется из сети и терь с самой ubuntu... может дело не в правилах?

в «форвард» - попадают пакеты которые идут транзитом - в данном случае (если это роутер) из интернета в локалку.

male66
()
Ответ на: комментарий от zayaroslava

так как мне сделать чтобы из локальной сети этот адресс был недоступен ?

в цепочку FORWARD надо добавлять. INPUT и OUTPUT это локальные соединения.

pavel38
()

iptables -N NEWBIE
iptables -I INPUT -j NEWBIE
iptables -I OUPUT -j NEWBIE
iptables -I FORWARD -j NEWBIE
iptables -A NEWBIE -s xx.xxx.xx.xxx -j DROP
iptables -A NEWBIE -d xx.xxx.xx.xxx -j DROP

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

либо на шлюзе forward -d ip -j drop
либо на самой неугодной машинке input -s 192.168.1.0/24(внутрення сеть в общем) -j drop
если между всей сетью и машинкой нет шлюза - то только на самой машине.

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

Если у вас «policy DROP» то добавлять правила -j DROP в конец цепочки нет смысла, нужно в начало.

xx.xxx.xx.xxx случаем не из той же локалки 192.168.10.0/24?

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

нет...это внешний адресс... между всей сетью настроен общий шлюз где все и настраиваю... iptables -L

Chain INPUT (policy DROP)

target prot opt source destination

REJECT all  — anywhere anywhere MARK match 0x1 reject-with icmp-port-unreachable

ACCEPT all  — anywhere anywhere

ACCEPT all  — anywhere anywhere

ACCEPT all  — anywhere anywhere

ACCEPT udp  — anywhere anywhere udp dpt:openvpn state NEW,ESTABLISHED

ACCEPT tcp  — anywhere anywhere tcp dpt:ssh state NEW,ESTABLISHED

ACCEPT icmp — anywhere anywhere state NEW,RELATED,ESTABLISHED

ACCEPT all  — anywhere anywhere state RELATED,ESTABLISHED

DROP all  — anywhere xx.xxx.xx.xxx

Chain FORWARD (policy DROP)

target prot opt source destination

TCPMSS tcp  — anywhere anywhere tcp flags:SYN,RST/SYN tcpmss match 1400:1536 TCPMSS clamp to PMTU

DROP tcp  — anywhere anywhere multiport sports loc-srv:netbios-ssn,microsoft-ds

DROP tcp  — anywhere anywhere multiport dports loc-srv:netbios-ssn,microsoft-ds

DROP udp  — anywhere anywhere multiport sports loc-srv:netbios-ssn,microsoft-ds

DROP udp  — anywhere anywhere multiport dports loc-srv:netbios-ssn,microsoft-ds

ACCEPT all  — anywhere anywhere

ACCEPT all  — anywhere anywhere

ACCEPT all  — 192.168.10.0/24 anywhere state NEW,RELATED,ESTABLISHED

ACCEPT all  — anywhere 192.168.10.0/24 state RELATED,ESTABLISHED

DROP all  — anywhere xx.xxx.xx.xxx

Chain OUTPUT (policy ACCEPT)

target prot opt source destination

DROP all  — anywhere xx.xxx.xx.xxx ......

Все равно из сети пингуется этот xx.xxx.xx.xxx/ В чем может быть проблема?

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

Chain FORWARD (policy DROP)

target prot opt source destination

TCPMSS tcp — anywhere anywhere tcp flags:SYN,RST/SYN tcpmss match 1400:1536 TCPMSS clamp to PMTU

...

ACCEPT all — anywhere anywhere

ACCEPT all — anywhere anywhere

...

DROP all — anywhere xx.xxx.xx.xxx

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