Browse Source

Update iptables.sh

merge-requests/31/head
Sebastian Werner 6 years ago
parent
commit
c1ee5061a0
  1. 8
      scripts/subinstallers/iptables.sh

8
scripts/subinstallers/iptables.sh

@ -94,7 +94,7 @@ sudo ip6tables -P FORWARD DROP @@ -94,7 +94,7 @@ sudo ip6tables -P FORWARD DROP
sudo ip6tables -P OUTPUT ACCEPT
# iptables-persistent
if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then
if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then
if [ ! "$(dpkg-query -l iptables-persistent)" ]; then
echo "Installing iptables-persistent"
@ -110,7 +110,7 @@ if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "ras @@ -110,7 +110,7 @@ if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "ras
echo "Saving ip6tables rules"
sudo bash -c "ip6tables-save > /etc/iptables/rules.v6"
fi
else
elif [ "$DISTRO" == "arch" ]; then
echo "Saving iptables rules"
sudo bash -c "iptables-save > /etc/iptables/rules.v4"
echo "Saving ip6tables rules"
@ -118,7 +118,7 @@ else @@ -118,7 +118,7 @@ else
fi
# IP forwarding
if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then
if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then
sudo sed -i 's/.*net.ipv4.ip_forward.*/net.ipv4.ip_forward=1/' /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf
elif [ "$DISTRO" == "arch" ]; then
@ -127,7 +127,7 @@ elif [ "$DISTRO" == "arch" ]; then @@ -127,7 +127,7 @@ elif [ "$DISTRO" == "arch" ]; then
fi
# rsyslog to create /var/log/iptables.log
if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ] ; then
if [ "$DISTRO" == "ubuntu" ] || [ "$DISTRO" == "debian" ] || [ "$DISTRO" == "raspbian" ]; then
sudo cp ./scripts/conf/15-iptables.conf /etc/rsyslog.d/
sudo chown root:root /etc/rsyslog.d/15-iptables.conf
sudo systemctl restart rsyslog

Loading…
Cancel
Save