Browse Source

More ip rules

Bob Mottram 8 years ago
parent
commit
b399c50c26
1 changed files with 18 additions and 0 deletions
  1. 18
    0
      src/freedombone-utils-firewall

+ 18
- 0
src/freedombone-utils-firewall View File

@@ -160,6 +160,24 @@ function configure_internet_protocol {
160 160
         echo 'net.ipv4.tcp_keepalive_intvl = 75' >> /etc/sysctl.conf
161 161
         echo 'net.ipv4.tcp_keepalive_time = 7200' >> /etc/sysctl.conf
162 162
     fi
163
+    if ! grep -q "net.ipv4.conf.default.send_redirects" /etc/sysctl.conf; then
164
+        echo "net.ipv4.conf.default.send_redirects = 0" >> /etc/sysctl.conf
165
+    else
166
+        sed -i "s|#net.ipv4.conf.default.send_redirects.*|net.ipv4.conf.default.send_redirects = 0|g" /etc/sysctl.conf
167
+        sed -i "s|net.ipv4.conf.default.send_redirects.*|net.ipv4.conf.default.send_redirects = 0|g" /etc/sysctl.conf
168
+    fi
169
+    if ! grep -q "net.ipv4.conf.all.secure_redirects" /etc/sysctl.conf; then
170
+        echo "net.ipv4.conf.all.secure_redirects = 0" >> /etc/sysctl.conf
171
+    else
172
+        sed -i "s|#net.ipv4.conf.all.secure_redirects.*|net.ipv4.conf.all.secure_redirects = 0|g" /etc/sysctl.conf
173
+        sed -i "s|net.ipv4.conf.all.secure_redirects.*|net.ipv4.conf.all.secure_redirects = 0|g" /etc/sysctl.conf
174
+    fi
175
+    if ! grep -q "net.ipv4.conf.default.accept_source_route" /etc/sysctl.conf; then
176
+        echo "net.ipv4.conf.default.accept_source_route = 0" >> /etc/sysctl.conf
177
+    else
178
+        sed -i "s|#net.ipv4.conf.default.accept_source_route.*|net.ipv4.conf.default.accept_source_route = 0|g" /etc/sysctl.conf
179
+        sed -i "s|net.ipv4.conf.default.accept_source_route.*|net.ipv4.conf.default.accept_source_route = 0|g" /etc/sysctl.conf
180
+    fi
163 181
     mark_completed $FUNCNAME
164 182
 }
165 183