#!/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" # [ DOMAIN ] # bind/bind => 1000 for name-ext/named-int local clients="$clients|UDP ;domain ;root/root;1000/1000;root/Debian-exim;systemd-timesync/systemd-timesync;_apt/nogroup" local clients="$clients|TCP ;domain ;root/root;1000/1000;_apt/nogroup" # 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"