#!/bin/sh # network : ipv4.ipv4.ipv4.ipv4/mask || dns/mask # clients : PROTO ; PORT ; UID/GID ; UID/GID ; UID/GID .... | # servers : PROTO ; PORT ; UID/GID ; UID/GID ; UID/GID .... | local network="0.0.0.0/0" # [ NTP ] local clients="$clients|UDP ;ntp ;root/root;systemd-timesync/systemd-timesync" #local clients="$clients|TCP ;ntp ;" # ruleOut : iptables -t filter -A OUTPUT -o ""$eth"" -j ""$rulesOut"" # ruleIn : iptables -t filter -A INPUT -i ""$eth"" -j ""$rulesIn"" # dropOut : iptables -t filter -A OUTPUT -o ""$eth"" -j ""$rulesOut"" # dropIn : iptables -t filter -A INPUT -i ""$eth"" -j ""$rulesIn"" # DROP # client dhcp (bootps : 67, bootpc : 68) #local dropIn="$dropIn ;drop_dhcp | -d 255.255.255.255 -s 0.0.0.0 -p udp --sport bootpc --dport bootps -m state --state NEW" #local dropIn="$dropIn ;drop_dhcp | -d 255.255.255.255 ! -s "$gw" -p udp --sport bootpc --dport bootps -m state --state NEW" # drop samba protocole (netbios-dgm:138) #local dropIn="$dropIn ;drop_dhcp | -d "$net" -s "$net" -p udp --sport netbios-dgm --dport netbios-dgm -m state --state NEW" #local dropIn="$dropIn ;drop_dhcp | -d "$net" -s "$net" -p udp --sport netbios-ns --dport netbios-ns -m state --state NEW"