From d17940bf4d2f7502d78b18eac380865c77e0444d Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Mon, 20 Dec 2021 14:56:53 +0100 Subject: Add an (optional) basic firewall configuration to setup2hd The firewall will be configured and installed only when you use setup2hd to install the Live OS to your hard drive. The scripts are not particular to Slackware Live; you can easily copy the resulting files /usr/sbin/myfwconfig, /etc/rc.d/rc.firewall and /var/lib/pkgtools/setup/setup.firewall out of the installed system and use them anywhere on a Slackware-compatible OS. - The 'myfwconfig' script will ask a few simple questions and generate the ipv4 and ipv6 configuration in /etc/firewall/. - The 'rc.firewall' script will load/save its iptables/ip6tables configuration from /etc/firewall/ files. - The 'setup.firewall' script is a convenient way to call the firewall configurator from pkgtools or during Slackware's installation to harddisk. --- setup2hd/setup.liveslak.tpl | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'setup2hd/setup.liveslak.tpl') diff --git a/setup2hd/setup.liveslak.tpl b/setup2hd/setup.liveslak.tpl index ccbc8d7..789b81f 100644 --- a/setup2hd/setup.liveslak.tpl +++ b/setup2hd/setup.liveslak.tpl @@ -125,6 +125,18 @@ EOT unset UPASS fi + # Add a rc.firewall script: + install -D -m0775 -t ${T_PX}/etc/rc.d/ /usr/share/@LIVEMAIN@/rc.firewall + # Install a firewall configuration script: + install -D -m755 /usr/share/@LIVEMAIN@/SeTfirewall ${T_PX}/usr/sbin/myfwconf + # Add a Slackware setup script invoking that 'myfwconf' script: + cat <${T_PX}/var/log/setup/setup.firewall +#!/bin/sh +#BLURB="Configure a basic firewall." +chroot . usr/sbin/myfwconf +EOT + chmod 0775 ${T_PX}/var/log/setup/setup.firewall + # Re-use some of the custom configuration from 0099-@DISTRO@_zzzconf-*.sxz # (some of these may not be present but the command will not fail): ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ -- cgit v1.2.3