#!/bin/sh # network : ipv4.ipv4.ipv4.ipv4/mask || dns/mask local network="${net}" # clients : PROTO ; PORT ; UID/GID ; UID/GID ; UID/GID .... | # servers : PROTO ; PORT ; UID/GID ; UID/GID ; UID/GID .... | # forward : PROTO ; PORT | # -- CLIENT -- #local clients="$clients|UDP ;domain ;1000/1000" #local clients="$clients|TCP ;domain ;1000/1000" # -- SERVER -- local servers="$servers|UDP ;domain ;1000/1000" local servers="$servers|TCP ;domain ;1000/1000" # ruleOut : iptables -t filter -A OUTPUT -o ""$eth"" -s ${ip}/32 -j ""$rulesOut"" # ruleIn : iptables -t filter -A INPUT -i ""$eth"" -d ${ip}/32 -j ""$rulesIn"" # dropOut : iptables -t filter -A OUTPUT -o ""$eth"" -s ${ip}/32 -j ""$rulesOut"" # dropIn : iptables -t filter -A INPUT -i ""$eth"" -d ${ip}/32 -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 ${bootpcPort} --dport ${bootpsPort} -m state --state NEW" #local dropIn="$dropIn ;drop_igmp | -d 224.0.0.1 -s 0.0.0.0 -p igmp"