Line 1... |
Line 1... |
1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
2 |
#
|
2 |
#
|
3 |
# $Id: alcasar-iptables-local.sh 2989 2022-02-08 21:26:45Z rexy $
|
3 |
# $Id: alcasar-iptables-local.sh 2993 2022-03-06 23:02:08Z rexy $
|
4 |
#
|
4 |
#
|
5 |
# Custom rules for ALCASAR firewall
|
5 |
# Custom rules for ALCASAR firewall
|
6 |
#
|
6 |
#
|
7 |
# Examples:
|
7 |
# Examples:
|
8 |
# - Local MAC addresses filtering (MAC are in '/usr/local/etc/alcasar-iptables-local-mac-filtered'. Format : aa:09:23:2f:4d:ee)
|
8 |
# - Local MAC addresses filtering (MAC are in '/usr/local/etc/alcasar-iptables-local-mac-filtered'. Format : aa:09:23:2f:4d:ee)
|
9 |
# - allow ICMP from an Internet IP address (Admin_from) to EXTIF
|
9 |
# - allow ICMP from an Internet IP address (Admin_from) to EXTIF
|
10 |
# - Deny access to protected networks from internal LAN
|
10 |
# - Deny access to protected networks from internal LAN
|
11 |
# - allow SMTP from ALCASAR to an Internet server (SMTP_IP)
|
11 |
# - allow SMTP from ALCASAR to an Internet server
|
12 |
# - Allow managers to access ACC from the external network
|
12 |
# - Allow managers to access ACC from the external network
|
13 |
# - Ports Address Translation (PAT) from Internet (one & multiple)
|
13 |
# - Ports Address Translation (PAT) from Internet (one & multiple)
|
14 |
# This script inherit of alcasar-iptables.sh variables : $INTIF, $EXTIF, $IPTABLES, etc
|
14 |
# This script inherit of alcasar-iptables.sh variables : $INTIF, $EXTIF, $IPTABLES, etc
|
15 |
# !!Beware, run the script "alcasar-iptables.sh" after changing this file.
|
15 |
# !!Beware, run the script "alcasar-iptables.sh" after changing this file.
|
16 |
|
16 |
|
Line 41... |
Line 41... |
41 |
#protectedNetworks='10.0.0.0/8,172.16.0.0/12,192.168.0.0/16' # (RFC 1918)
|
41 |
#protectedNetworks='10.0.0.0/8,172.16.0.0/12,192.168.0.0/16' # (RFC 1918)
|
42 |
#[ -n "$TUNIF" ] && consultationIF=$TUNIF || consultationIF=$INTIF
|
42 |
#[ -n "$TUNIF" ] && consultationIF=$TUNIF || consultationIF=$INTIF
|
43 |
#$IPTABLES -A FORWARD -i $consultationIF -d $protectedNetworks -j DROP
|
43 |
#$IPTABLES -A FORWARD -i $consultationIF -d $protectedNetworks -j DROP
|
44 |
#$IPTABLES -A FORWARD -o $consultationIF -s $protectedNetworks -j DROP
|
44 |
#$IPTABLES -A FORWARD -o $consultationIF -s $protectedNetworks -j DROP
|
45 |
|
45 |
|
46 |
# On autorise ALCASAR a accéder à un serveur MAIL local (envoie de rapports, alertes, etc.)
|
46 |
# On autorise ALCASAR a accéder à un serveur MAIL (envoie de rapports, alertes, inscription d'utilisateurs, etc.)
|
47 |
# Allow ALCASAR to conect to a local mail server (send reports, alerts, etc.)
|
47 |
# Allow ALCASAR to connect to a mail server (send reports, alerts, users registration, etc.)
|
48 |
#SMTP_IP='192.168.111.5' # IP of mail server
|
48 |
#SMTP_IP='192.168.111.5'
|
49 |
#SMTP_PORT=587 # port of mail server (25 for SMTP ; 587 for STARTTLS ; 465 for SMTPS)
|
49 |
#SMTP_PORT=25
|
50 |
#$IPTABLES -A OUTPUT -p tcp -d $SMTP_IP --dport $SMTP_PORT -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
50 |
#$IPTABLES -A OUTPUT -p tcp -d $SMTP_IP --dport $SMTP_PORT -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
|
51 |
#$IPTABLES -A INPUT -p tcp -s $SMTP_IP --sport $SMTP_PORT -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
51 |
#$IPTABLES -A INPUT -p tcp -s $SMTP_IP --sport $SMTP_PORT -m conntrack --ctstate ESTABLISHED -j ACCEPT
|
52 |
|
52 |
|
53 |
# On autorise un admin à accéder à l'ACC depuis l'extérieur (Internet ou le LAN entre ALCASAR et la BOX)
|
53 |
# On autorise un admin à accéder à l'ACC depuis l'extérieur (Internet ou le LAN entre ALCASAR et la BOX)
|
54 |
# Allow managerIP to access ACC from the external network (Internet or LAN between ALCASAR and the broadband router)
|
54 |
# Allow managerIP to access ACC from the external network (Internet or LAN between ALCASAR and the broadband router)
|