浏览代码

Include outputs and forwards in domain blocks

Bob Mottram 8 年前
父节点
当前提交
da18dc225e
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8
    0
      src/freedombone-utils-firewall

+ 8
- 0
src/freedombone-utils-firewall 查看文件

@@ -408,6 +408,10 @@ function firewall_block_domain {
408 408
         hexstr=$(domain_to_hex_string $blocked_domain)
409 409
         iptables -A INPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
410 410
         iptables -A INPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
411
+        iptables -A OUTPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
412
+        iptables -A OUTPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
413
+        iptables -I FORWARD -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
414
+        iptables -I FORWARD -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
411 415
         echo "${blocked_domain}" >> $FIREWALL_DOMAINS
412 416
         save_firewall_settings
413 417
     fi
@@ -419,6 +423,10 @@ function firewall_unblock_domain {
419 423
         hexstr=$(domain_to_hex_string $unblocked_domain)
420 424
         iptables -D INPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
421 425
         iptables -D INPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
426
+        iptables -D OUTPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
427
+        iptables -D OUTPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
428
+        iptables -D FORWARD -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
429
+        iptables -D FORWARD -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
422 430
         sed -i "/${unblocked_domain}/d" $FIREWALL_DOMAINS
423 431
         save_firewall_settings
424 432
     fi