Go to file
2019-02-27 03:52:01 +01:00
.gitignore Add some comments for DNS rules. 2017-06-02 11:34:43 +02:00
ban_ipv4.list.sample Support banning IPs/Network reading from file 'ban_ipv4.list'. 2018-04-19 17:59:17 +02:00
ban_ipv6.list.sample Add support for IPv6 ban list. 2018-10-20 02:33:46 +02:00
ip6t-firewall-server Add rules for extern services, extern networks and local (non-standard) services. 2019-02-25 15:24:51 +01:00
ip6t-firewall-server.conf.sample Adjust comments for using '0/0' or '::/0' to match all IPv4/IPv6 networks. 2019-02-27 03:52:01 +01:00
ipt-firewall-server Add rules for extern services, extern networks and local (non-standard) services. 2019-02-25 15:24:51 +01:00
ipt-firewall-server.conf.sample Adjust comments for using '0/0' or '::/0' to match all IPv4/IPv6 networks. 2019-02-27 03:52:01 +01:00
README.bridge Initial import 2017-02-12 16:07:07 +01:00
README.systemd.server README.systemd.server: add copy-commands for ipv4/ipv6 ban lists. 2019-02-05 14:13:01 +01:00

## - Create a systemd service
## -

# - Copy firewall scripts to /usr/local/sbin
# -
cp -a /usr/local/src/ipt-server/ipt-firewall-server /usr/local/sbin/
cp -a /usr/local/src/ipt-server/ip6t-firewall-server /usr/local/sbin/

# - Copy Configuration files to /etc/ipt-firewall
# -
mkdir /etc/ipt-firewall
cp -a /usr/local/src/ipt-server/ipt-firewall-server.conf.sample /etc/ipt-firewall/ipt-firewall-server.conf
cp -a /usr/local/src/ipt-server/ip6t-firewall-server.conf.sample /etc/ipt-firewall/ip6t-firewall-server.conf

cp -a /usr/local/src/ipt-server/ban_ipv4.list.sample /etc/ipt-firewall/ban_ipv4.list
cp -a /usr/local/src/ipt-server/ban_ipv6.list.sample /etc/ipt-firewall/ban_ipv6.list


# - Adjust Configuration files
# -
vim /etc/ipt-firewall/ipt-firewall-server.conf
vim /etc/ipt-firewall/ip6t-firewall-server.conf


# IPv4
#
cat <<EOF > /etc/systemd/system/ipt-firewall.service
[Unit]
Description=IPv4 Firewall with iptables
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/sbin/ipt-firewall-server start
ExecStop=/usr/local/sbin/ipt-firewall-server stop
User=root

[Install]
WantedBy=multi-user.target
EOF

# IPv6
#
cat <<EOF > /etc/systemd/system/ip6t-firewall.service
[Unit]
Description=IPv6 Firewall with ip6tables
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/sbin/ip6t-firewall-server start
ExecStop=/usr/local/sbin/ip6t-firewall-server stop
User=root

[Install]
WantedBy=multi-user.target
EOF


## - Eanable script (for autostart at boot time)
## -
systemctl enable ipt-firewall.service
systemctl enable ip6t-firewall.service

## - Reload systemd configuration
## -
systemctl daemon-reload


## - Start Services
## -
systemctl start ipt-firewall
systemctl start ip6t-firewall


## - Add to /etc/rc.local
## -
## -    sleep 2
## -    systemctl restart ipt-firewall || /bin/true
## -    systemctl restart ip6t-firewall || /bin/true