Line 1... |
Line 1... |
1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
2 |
#
|
2 |
#
|
3 |
# $Id: alcasar-iptables-local.sh 2993 2022-03-06 23:02:08Z rexy $
|
3 |
# $Id: alcasar-iptables-local.sh 2994 2022-03-08 23:02:14Z 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)
|
Line 65... |
Line 65... |
65 |
#$IPTABLES -A FORWARD -p tcp -d 192.168.182.10 --dport 22 -j ACCEPT
|
65 |
#$IPTABLES -A FORWARD -p tcp -d 192.168.182.10 --dport 22 -j ACCEPT
|
66 |
#$IPTABLES -A FORWARD -p udp -d 192.168.182.10 --dport 22 -j ACCEPT
|
66 |
#$IPTABLES -A FORWARD -p udp -d 192.168.182.10 --dport 22 -j ACCEPT
|
67 |
|
67 |
|
68 |
# On autorise l'accès depuis Internet (multiports) vers un équipement du LAN (qui doit être en IP fixe)
|
68 |
# On autorise l'accès depuis Internet (multiports) vers un équipement du LAN (qui doit être en IP fixe)
|
69 |
# Access is allowed from Internet (multiports) to a LAN equipment (which must be in static IP)
|
69 |
# Access is allowed from Internet (multiports) to a LAN equipment (which must be in static IP)
|
70 |
#ext_ports=11223:11323; int_ports=11223:11323
|
70 |
#ext_ports=11223:11323; int_ports=12000:12100
|
71 |
#to_ip=192.168.182.7
|
71 |
#to_ip=192.168.182.7
|
72 |
#int_ports_dnat=`echo $int_ports|tr : -`
|
72 |
#int_ports_dnat=`echo $int_ports|tr : -`
|
- |
|
73 |
#ext_ports_dnat=`echo $ext_ports|tr : -`
|
73 |
#$IPTABLES -A PREROUTING -i $EXTIF -t nat -p tcp -d $PUBLIC_IP -m multiport --dports $ext_ports -j DNAT --to $to_ip:$int_ports_dnat
|
74 |
#$IPTABLES -A PREROUTING -i $EXTIF -t nat -p tcp -d $PUBLIC_IP -m multiport --dports $ext_ports -j DNAT --to $to_ip:$int_ports_dnat
|
74 |
#$IPTABLES -A FORWARD -i $EXTIF -p tcp -d $to_ip -m multiport --dports $ext_ports -j ACCEPT
|
75 |
#$IPTABLES -A FORWARD -i $EXTIF -p tcp -d $to_ip -m multiport --dports $int_ports -j ACCEPT
|
75 |
#$IPTABLES -A FORWARD -o $EXTIF -p tcp -s $to_ip -m multiport --sports $int_ports -j ACCEPT
|
76 |
#$IPTABLES -A PREROUTING -i $INTIF -t nat -p tcp -s $to_ip -m multiport --sports $int_ports -j DNAT --to :$ext_ports_dnat
|
76 |
#$IPTABLES -A PREROUTING -i $EXTIF -t nat -p udp -d $PUBLIC_IP -m multiport --dports $ext_ports -j DNAT --to $to_ip:$int_ports_dnat
|
77 |
#$IPTABLES -A PREROUTING -i $EXTIF -t nat -p udp -d $PUBLIC_IP -m multiport --dports $ext_ports -j DNAT --to $to_ip:$int_ports_dnat
|
77 |
#$IPTABLES -A FORWARD -i $EXTIF -p udp -d $to_ip -m multiport --dports $ext_ports -j ACCEPT
|
78 |
#$IPTABLES -A FORWARD -i $EXTIF -p udp -d $to_ip -m multiport --dports $int_ports -j ACCEPT
|
78 |
#$IPTABLES -A FORWARD -o $EXTIF -p udp -s $to_ip -m multiport --sports $int_ports -j ACCEPT
|
79 |
#$IPTABLES -A PREROUTING -i $INTIF -t nat -p udp -s $to_ip -m multiport --sports $int_ports -j DNAT --to :$ext_ports_dnat
|
79 |
|
80 |
|