특정 웹사이트를 차단하기 위한 Iptables 규칙

특정 웹사이트를 차단하기 위한 Iptables 규칙

다음과 같이 특정 웹사이트(이 경우 facebook.com)를 차단하는 규칙을 만들었습니다.

iptables -A OUTPUT -p tcp -d www.facebook.com -j LOG --log-prefix "Accessing Facebook:"
iptables -A OUTPUT -p tcp -d www.facebook.com -j DROP

이제 이 후 웹사이트가 차단됩니다. 하지만 나는 로그를 이해하려고 노력하고 있습니다.

[root@localhost centos]# cat /var/log/messages | grep Facebook
Nov  4 16:00:22 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=16774 DF PROTO=TCP SPT=59020 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 16:00:22 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=16774 DF PROTO=TCP SPT=59020 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 16:00:22 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=52984 DF PROTO=TCP SPT=59021 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 16:00:22 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=52984 DF PROTO=TCP SPT=59021 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 16:00:38 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.81.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=51020 DF PROTO=TCP SPT=55776 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 16:00:38 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.81.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=51020 DF PROTO=TCP SPT=55776 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 16:00:38 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=16775 DF PROTO=TCP SPT=59020 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 16:00:38 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=16775 DF PROTO=TCP SPT=59020 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 16:00:38 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.81.36 LEN=40 TOS=0x00 PREC=0x00 TTL=64 ID=51021 DF PROTO=TCP SPT=55776 DPT=443 WINDOW=14600 RES=0x00 ACK URGP=0
Nov  4 16:00:38 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.81.36 LEN=40 TOS=0x00 PREC=0x00 TTL=64 ID=51021 DF PROTO=TCP SPT=55776 DPT=443 WINDOW=14600 RES=0x00 ACK URGP=0
Nov  4 16:00:38 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.81.36 LEN=557 TOS=0x00 PREC=0x00 TTL=64 ID=51022 DF PROTO=TCP SPT=55776 DPT=443 WINDOW=14600 RES=0x00 ACK PSH URGP=0
Nov  4 16:00:38 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.81.36 LEN=557 TOS=0x00 PREC=0x00 TTL=64 ID=51022 DF PROTO=TCP SPT=55776 DPT=443 WINDOW=14600 RES=0x00 ACK PSH URGP=0
Nov  4 16:00:38 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.81.36 LEN=40 TOS=0x00 PREC=0x00 TTL=64 ID=51023 DF PROTO=TCP SPT=55776 DPT=443 WINDOW=15544 RES=0x00 ACK URGP=0
Nov  4 16:00:38 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.81.36 LEN=40 TOS=0x00 PREC=0x00 TTL=64 ID=51023 DF PROTO=TCP SPT=55776 DPT=443 WINDOW=15544 RES=0x00 ACK URGP=0
Nov  4 16:00:38 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.81.36 LEN=91 TOS=0x00 PREC=0x00 TTL=64 ID=51024 DF PROTO=TCP SPT=55776 DPT=443 WINDOW=15544 RES=0x00 ACK PSH URGP=0
Nov  4 17:42:25 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=52568 DF PROTO=TCP SPT=59091 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:42:25 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=52568 DF PROTO=TCP SPT=59091 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:42:41 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=43251 DF PROTO=TCP SPT=59090 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:42:41 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=43251 DF PROTO=TCP SPT=59090 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:42:41 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=52569 DF PROTO=TCP SPT=59090 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:42:41 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=52569 DF PROTO=TCP SPT=59091 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:43:13 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=53725 DF PROTO=TCP SPT=59091 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:43:13 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=53725 DF PROTO=TCP SPT=59092 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:43:14 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=53726 DF PROTO=TCP SPT=59092 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:43:14 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=53726 DF PROTO=TCP SPT=59092 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:43:16 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=53727 DF PROTO=TCP SPT=59092 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:43:16 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=53727 DF PROTO=TCP SPT=59092 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:43:20 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=53728 DF PROTO=TCP SPT=59092 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:43:20 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=53728 DF PROTO=TCP SPT=59092 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:43:28 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=53729 DF PROTO=TCP SPT=59092 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0
Nov  4 17:43:28 localhost kernel: Accessing Facebook:IN= OUT=eth0 SRC=10.0.2.15 DST=31.13.71.36 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=53729 DF PROTO=TCP SPT=59092 DPT=443 WINDOW=14600 RES=0x00 SYN URGP=0

로그를 보고 해당 사이트가 차단되었는지 알 수 있는 방법이 있나요? 그렇다면 정확히 무엇을 찾아야 합니까? (혹은 제가 추가한 '페이스북 방문' 메시지가 로그에 나오니 사이트가 차단된 게 당연합니다)

출력의 라인 9~15에서 ACK 패킷을 받는 이유는 무엇입니까?

관련 정보