Shorewall Setting on Nodus

Network Topology

network_topology.png

^ This final is the current, and the current means previous.

The firewall setting plan and status are shown in the figure above. In an ideal setting, the NAT router on the firewall should filter the packets while allowing the necessary ports open (Figure left). At the 40m, currently, the half of nodus is exposed to the net and handling the web/elog/rsync requests, while other access to the intranet ("local") is blocked (Figure right). So nodus needs to have the function of the firewall.-

(On June 27th, 2018, the new NAT router was installed between the GC net and martian. This made the nodus hidden in the firewall.)

The command (and settings) iptables are supposed to handle this filtering of the packets by the ports. However, iptables configuration is complicated. A mistake in iptables may cause security issue or malfunction of the network which the cause could be tricky to track down. Therefore shorewall is introduced as the configuration tool for iptables, which is simpler and user-friendly.

Once we switch to the firewall only by a NAT router, shorewall will become unnecessary. Just simply stop the service. We still need to use shorewall to keep the ports open.

Requirement

Shorewall settings

#ZONE           TYPE
fw              firewall
net             ipv4
loc             ipv4

#ZONE           INTERFACE               OPTIONS
net             enp1s0f1                -
loc             enp1s0f0                -

#SOURCE         DEST            POLICY  LOGLEVEL        RATE    CONNLIMIT
loc             net             DROP    info

$FW             net             ACCEPT
net             $FW             REJECT  info

$FW             loc             ACCEPT
loc             $FW             ACCEPT

all             all             DROP    info

?SECTION ALL

SSH(ACCEPT)     net             $FW
# elog
ACCEPT          net             $FW             tcp     8080
ACCEPT          net             $FW             tcp     8081
# apache
ACCEPT          net             $FW             tcp     30889
# rsync
Rsync(ACCEPT)   net             $FW

# Ping
Ping(ACCEPT)    net             $FW

?SECTION ESTABLISHED

ACCEPT          net             $FW             tcp
ACCEPT          net             $FW             icmp

?SECTION RELATED

ACCEPT          net             $FW             tcp
ACCEPT          net             $FW             icmp

?SECTION INVALID
?SECTION UNTRACKED
?SECTION NEW

#DNAT           net             loc:192.168.113.209:31200       tcp     31200

Deploying iptables via shorewall

sudo systemctl enable shorewall

Therefore, the current commands to control shorewall is

sudo systemctl start|stop|restart|reload shorewall

Note that stopping shorewall may cause isolation of nodus from the terminal which you are working on. Just be careful.

NodusShorewallSetting (last edited 2019-12-09 20:42:07 by KojiaraiATligoDOTorg)