gateway: /etc/openvpn #cd ../shorewall
gateway: /etc/shorewall # nano interfaces

#ZONE   INTERFACE       OPTIONS
 net     NET_IF          tcpflags,nosmurfs,routefilter,logmartians,sourceroute=0,physical=eth0
 loc     LOC_IF          tcpflags,dhcp,nosmurfs,routefilter,logmartians,routeback,physical=eth1
 cid     CID_IF          tcpflags,dhcp,nosmurfs,routefilter,logmartians,physical=eth2
 udp     UDP_IF          tcpflags,dhcp,nosmurfs,routefilter,logmartians,routeback,physical=tun0
 tcp     TCP_IF          tcpflags,dhcp,nosmurfs,routefilter,logmartians,routeback,physical=tun1

OpenVPN verteilt die IP-Adressen an seine Clients ohne zutun vom DHCP, übernimmt quasi dessen Aufgabe nur für die VPN-Netze. Die Option routeback ist nicht für alles nötig, aber voller Zugriff ins Heimnetz ist nur so machbar.

gateway: /etc/shorewall # nano zones

#ZONE   TYPE    OPTIONS                 IN                      OUT
 #                                       OPTIONS                 OPTIONS
 fw      firewall
 net     ipv4
 loc     ipv4
 cid     ipv4
 udp     ipv4
 tcp     ipv4

gateway: /etc/shorewall # nano policy

#SOURCE DEST            POLICY          LOGLEVEL        RATE    CONNLIMIT
 

 loc     net             DROP            info
 cid     net             DROP
 loc     cid             ACCEPT
 cid     loc             DROP
 udp     all             DROP
 tcp     all             DROP
 net     all             DROP            $LOG_LEVEL
 # THE FOLLOWING POLICY MUST BE LAST
 all     all             REJECT          $LOG_LEVEL

Jaja, war ja klar, immer erstmal alles verbieten, wa?
Nö, Deine Entscheidung!

Und noch die rules:

gateway: /etc/shorewall #rules

#       open VPN from net
#
ACCEPT          net             $FW             udp     1196
ACCEPT          net             $FW             tcp     1196
#
#       allow upd to loc for NAS and tcp to cid for Zoneminder & Cams Webpages
#
ACCEPT          udp             loc:10.0.0.12   tcp     2049
ACCEPT          tcp             cid             tcp     80,443

Ob das jetzt so schlau war, die Zonen udp und tcp zu nennen, bin ich mir nicht so sicher….es geht, man könnte aber auch die Zone mit dem Protokoll verwechseln. Vielleicht besser ios, lap oder so…Deine Entscheidung.
Kontrolle!

gateway: /etc/shorewall # systemctl status shorewall

 shorewall.service - Shorewall IPv4 firewall
    Loaded: loaded (/lib/systemd/system/shorewall.service; enabled; vendor preset: enabled)
    Active: active (exited) since Mon 2019-11-11 18:38:19 CET; 14s ago
   Process: 2975 ExecStart=/sbin/shorewall $OPTIONS start $STARTOPTIONS (code=exited, status=0/SUCCESS)
  Main PID: 2975 (code=exited, status=0/SUCCESS)
 

 Nov 11 18:38:19 gateway shorewall[2975]: Shorewall configuration compiled to /var/lib/shorewall/.start
 Nov 11 18:38:19 gateway shorewall[2975]: Starting Shorewall....
 Nov 11 18:38:19 gateway shorewall[2975]: Initializing...
 Nov 11 18:38:19 gateway shorewall[2975]: Setting up Route Filtering...
 Nov 11 18:38:19 gateway shorewall[2975]: Setting up Martian Logging...
 Nov 11 18:38:19 gateway shorewall[2975]: Setting up Accept Source Routing...
 Nov 11 18:38:19 gateway shorewall[2975]: Preparing iptables-restore input...
 Nov 11 18:38:19 gateway shorewall[2975]: Running /sbin/iptables-restore --wait 60...
 Nov 11 18:38:19 gateway shorewall[2975]: done.
 Nov 11 18:38:19 gateway systemd[1]: Started Shorewall IPv4 firewall.

Dein DynDNS meldet sich an? Jetzt musst Du Deinem Plasterouter noch zwei Portweiterleitungen beibringen:
Geh wieder mit einem Browser in die Weboberfläche des Plasterouters, such den Reiter „Portweiterleiten“ und trage ein:
Vom Internet Port udp 1196 zu gateway udp 1196
Vom Internet Port tcp 1196 zu gateway tcp 1196

Damit ist der Server fertig eingerichtet und lauffähig.

Grundsätzlich würde ich jetzt einen Reboot von gateway vornehmen um sicher zu sein, daß Shorewall und openVPN brav starten.

next > Clients einrichten