Browse Source

Added /etc/network/firewall/trustedips.conf,trustedips6.conf

main
Ricardo Leite 4 years ago
parent
commit
c9c815b3b8
2 changed files with 15 additions and 1 deletions
  1. +1
    -1
      README.md
  2. +14
    -0
      install.sh

+ 1
- 1
README.md View File

@ -1,3 +1,3 @@
# firewall # firewall
Scripts de firewall iptables compatíveis com docker e com fail2log.
Scripts de firewall iptables compatíveis com docker e com fail2ban.

+ 14
- 0
install.sh View File

@ -5,6 +5,7 @@ if [ "$USER" != "root" ] ; then
exit 1 exit 1
fi fi
#if [ "X$(which dialog)" == "X" ]; then #if [ "X$(which dialog)" == "X" ]; then
# apt -y install dialog # apt -y install dialog
#fi #fi
@ -17,6 +18,19 @@ if [ ! -d /etc/network/firewall ] ; then
mkdir -p /etc/network/firewall mkdir -p /etc/network/firewall
fi fi
trusted=/etc/network/firewall/trustedips.conf
trusted6=/etc/network/firewall/trustedips6.conf
if [ ! -f $trusted ]; then
# Include all local ipv4 ips (but commented), and open localhost ipv4.
ip a | grep " inet " | sed -e 's|^.*inet |#|g' -e 's|\/.*$||g' -e 's|^#127.0.0.1$|127.0.0.1|g' >> $trusted
fi
if [ ! -f $trusted6 ]; then
# Include all local ipv6 ips (but commented) and open the localhost ipv6.
ip a | grep " inet6 " | sed -e 's|^.*inet6 |#|g' -e 's|\/.*$||g' -e 's|^#::1$|::1|g' >> $trusted6
fi
cp -v firewall.service /etc/systemd/system/ cp -v firewall.service /etc/systemd/system/
cp -v firewall-init.service /etc/systemd/system/ cp -v firewall-init.service /etc/systemd/system/


Loading…
Cancel
Save