ソースを参照

cjdns firewall

Bob Mottram 10 年 前
コミット
12746ce140
共有1 個のファイルを変更した16 個の追加1 個の削除を含む
  1. 16
    1
      install-freedombone.sh

+ 16
- 1
install-freedombone.sh ファイルの表示

687
   sed -i 's/net.ipv6.conf.all.disable_ipv6.*/net.ipv6.conf.all.disable_ipv6 = 0/g' /etc/sysctl.conf
687
   sed -i 's/net.ipv6.conf.all.disable_ipv6.*/net.ipv6.conf.all.disable_ipv6 = 0/g' /etc/sysctl.conf
688
   #sed -i "s/net.ipv6.conf.all.accept_redirects.*/net.ipv6.conf.all.accept_redirects = 1/g" /etc/sysctl.conf
688
   #sed -i "s/net.ipv6.conf.all.accept_redirects.*/net.ipv6.conf.all.accept_redirects = 1/g" /etc/sysctl.conf
689
   #sed -i "s/net.ipv6.conf.all.accept_source_route.*/net.ipv6.conf.all.accept_source_route = 1/g" /etc/sysctl.conf
689
   #sed -i "s/net.ipv6.conf.all.accept_source_route.*/net.ipv6.conf.all.accept_source_route = 1/g" /etc/sysctl.conf
690
-  #sed -i "s/net.ipv6.conf.all.forwarding.*/net.ipv6.conf.all.forwarding=1/g" /etc/sysctl.conf
690
+  sed -i "s/net.ipv6.conf.all.forwarding.*/net.ipv6.conf.all.forwarding=1/g" /etc/sysctl.conf
691
+  echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
691
 
692
 
692
   echo '#!/bin/sh -e' > /etc/init.d/cjdns
693
   echo '#!/bin/sh -e' > /etc/init.d/cjdns
693
   echo '### BEGIN INIT INFO' >> /etc/init.d/cjdns
694
   echo '### BEGIN INIT INFO' >> /etc/init.d/cjdns
3747
   chmod +x /etc/network/if-up.d/iptables
3748
   chmod +x /etc/network/if-up.d/iptables
3748
 }
3749
 }
3749
 
3750
 
3751
+function configure_firewall_for_cjdns {
3752
+  if grep -Fxq "configure_firewall_for_cjdns" $COMPLETION_FILE; then
3753
+      return
3754
+  fi
3755
+  if [[ $ENABLE_CJDNS != "yes" ]]; then
3756
+      return
3757
+  fi
3758
+  ip6tables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
3759
+  ip6tables -A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
3760
+  save_firewall_settings
3761
+  echo 'configure_firewall_for_cjdns' >> $COMPLETION_FILE
3762
+}
3763
+
3750
 function configure_firewall_for_dlna {
3764
 function configure_firewall_for_dlna {
3751
   if grep -Fxq "configure_firewall_for_dlna" $COMPLETION_FILE; then
3765
   if grep -Fxq "configure_firewall_for_dlna" $COMPLETION_FILE; then
3752
       return
3766
       return
7459
 configure_firewall_for_dns
7473
 configure_firewall_for_dns
7460
 configure_firewall_for_ftp
7474
 configure_firewall_for_ftp
7461
 configure_firewall_for_web_access
7475
 configure_firewall_for_web_access
7476
+configure_firewall_for_cjdns
7462
 remove_proprietary_repos
7477
 remove_proprietary_repos
7463
 change_debian_repos
7478
 change_debian_repos
7464
 enable_backports
7479
 enable_backports