Debian / Ubuntu Linux: Install and Configure Shoreline Firewall (Shorewall)

Here’s an overview of the steps to install and configure Shoreline Firewall (Shorewall) on Debian or Ubuntu Linux:

  1. Install Shorewall:
 
sudo apt-get update
sudo apt-get install shorewall
  1. Configure the network interfaces:

Create a file “/etc/network/interfaces” with the following content, replacing “eth0” and “eth1” with your actual interface names:

 
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0

  1. Configure Shorewall:

Create a file “/etc/shorewall/shorewall.conf” with the following content:

 
STARTUP_ENABLED=Yes
IP_FORWARDING=On

Create a file “/etc/shorewall/interfaces” with the following content:

 
#ZONE INTERFACE OPTIONS
net eth0 dhcp,tcpflags,nosmurfs
loc eth1 detectnets,broadcast,routefilter,nosmurfs

Create a file “/etc/shorewall/policy” with the following content:

 
#SOURCE DEST POLICY LOG LEVEL
loc all ACCEPT
net all DROP info
all all REJECT info

Create a file “/etc/shorewall/rules” with the following content:

 
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL
# PORT PORT(S)
ACCEPT net loc tcp 22 -
ACCEPT net loc tcp 80 -
  1. Start Shorewall:
 
sudo shorewall start

After completing these steps, Shorewall should be installed and configured on your Debian or Ubuntu Linux system. You can verify its functionality by attempting to access the internet from the local network, and by checking the firewall logs.

Leave a Comment