D
D
Denis Sechin2017-09-01 16:36:05
linux
Denis Sechin, 2017-09-01 16:36:05

Why doesn't the url blocking rule work?

You need to block the youtube url, there is an ubuntu 16 gateway, there is a rule on it in iptables:


iptables -A FORWARD -m string --string "youtube.com" --algo kmp --to 65535 -j DROP

It doesn't work, why? Thank you

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
athacker, 2017-09-01
@athacker

Probably because you need to block youtube, and the rule says --string "vkontakte.ru" ? :-)

A
Alexander Bushmanov, 2017-09-02
@assanti

So?
iptables -A INPUT -m string --string "youtube.com" --algo kmp --to 65535 -p tcp --dport 80 -j DROP
iptables -A OUTPUT -m string --string "youtube.com" -- algo kmp --to 65535 -p tcp --dport 80 -j DROP
AND for https
iptables -A INPUT -m string --string "youtube.com" --algo kmp --to 65535 -p tcp --dport 443 - j DROP
iptables -A OUTPUT -m string --string "youtube.com" --algo kmp --to 65535 -p tcp --dport 443 -j DROP
UPD: I checked, it always goes to https, the last two rules are enough :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question