iptables 규칙으로 특정 문자열 차단

iptables 규칙으로 특정 문자열 차단

iptables 규칙으로 문자열을 차단하고 싶지만 가장 좋은 방법을 알고 싶습니다.

예를 들어 다음과 같은 4가지 규칙이 있습니다.

/sbin/iptables -t mangle -A PREROUTING -p all -m string --hex-string "|some_string|" --algo kmp -j DROP
/sbin/iptables -I INPUT -p all -m string --hex-string "|some_string|" --algo kmp -j DROP
/sbin/iptables -I FORWARD -p all -m string --hex-string "|some_string|" --algo kmp -j DROP
/sbin/iptables -I OUTPUT -p all -m string --hex-string "|some_string|" --algo kmp -j DROP

참고: "|some_string|" 실제 문자열로 대체됩니다.

질문:

MANGLE 규칙을 사용하면 충분합니까? (다른 규칙을 사용할 필요가 없거나 모두 사용해야 함)

미리 감사드립니다

관련 정보