Bläddra i källkod

input rather than forward

Bob Mottram 8 år sedan
förälder
incheckning
5630f6eed1
1 ändrade filer med 4 tillägg och 4 borttagningar
  1. 4
    4
      src/freedombone-utils-firewall

+ 4
- 4
src/freedombone-utils-firewall Visa fil

@@ -405,8 +405,8 @@ function firewall_block_domain {
405 405
     blocked_domain="$1"
406 406
     if ! grep "$blocked_domain" $FIREWALL_DOMAINS; then
407 407
         hexstr=$(domain_to_hex_string $blocked_domain)
408
-        iptables -I FORWARD -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
409
-        iptables -I FORWARD -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
408
+        iptables -A INPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
409
+        iptables -A INPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
410 410
         echo "${blocked_domain}" >> $FIREWALL_DOMAINS
411 411
         save_firewall_settings
412 412
     fi
@@ -416,8 +416,8 @@ function firewall_unblock_domain {
416 416
     unblocked_domain="$1"
417 417
     if grep "${unblocked_domain}" $FIREWALL_DOMAINS; then
418 418
         hexstr=$(domain_to_hex_string $unblocked_domain)
419
-        iptables -D FORWARD -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
420
-        iptables -D FORWARD -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
419
+        iptables -D INPUT -p udp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
420
+        iptables -D INPUT -p tcp --dport 53 -m string --hex-string "$hexstr" --algo bm -j DROP
421 421
         sed -i "/${unblocked_domain}/d" $FIREWALL_DOMAINS
422 422
         save_firewall_settings
423 423
     fi