dront78 24.05.2012 00:31
Есть вопрос! — [РЕШЕНО] - conntrack не обрывает tcp соединения
Из FAQCan I use conntrack to "cut" established TCP connections?
In short, yes.
РЕШЕНИЕ: волшебное слово - это "ctstate INVALID"
You can use conntrack to delete the state-entry that represents an established TCP connection without adding an iptables rule. With the appropriate rule-set, the packets of that TCP connections would be blocked and the client will experience a connection hang. Moreover, since conntrack is not dependent of the layer 4 protocol, you can use it to remove other non-TCP entries to obtain the similar described behaviour.
Вопрос
Что это за "appropriate rule-set"? сколько я не настраивал iptables, удаление из таблицы conntrack -D ни к чему не приводит
ЗЫ
Не надо предлагать tcp cutter. Я про него знаю ;)
------------------------------------------------
Рабочий пример
------------------------------------------------
например чтобы рвать исходящее соединение руками
echo 0 > /proc/sys/net/netfilter/nf_conntrack_tcp_loose
iptables -A OUTPUT -p tcp -m conntrack --ctstate INVALID -j REJECT --reject-with icmp-port-unreachable
после этого tcp соединение можно порвать руками, используя таблицу conntrack например так
conntrack -D -p tcp -d 77.88.21.3
рвет соединения мгновенно