#!/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 .... | # forward : PROTO ; PORT | local network="${net}" # -- CLIENT -- #local clients="$clients|UDP ;domain ;root/root" # -- SERVER -- #local servers="$servers|TCP ;ssh ;root/root" # 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"" #local ruleEthIn="$ruleEthIn ;ipip_in | -s 176.188.42.89 -d "$ip" -p ipip" #local ruleEthOut="$ruleEthOut;ipip_out | -d 176.188.42.89 -s "$ip" -p ipip" #local ruleEthIn="$ruleEthIn ;ipip_in | -s 92.135.152.249 -d "$ip" -p ipip" #local ruleEthOut="$ruleEthOut;ipip_out | -d 92.135.152.249 -s "$ip" -p ipip" local ruleEthIn="$ruleEthIn ;ipip_in | -s "${net}" -d "$ip" -p 4" local ruleEthOut="$ruleEthOut;ipip_out | -d "${net}" -s "$ip" -p 4" #local icmpEthOut="$icmpEthOut ;icmp | -d "$net" -s "$ip" -p icmp --icmp-type 0/0" #local icmpEthIn="$icmpEthIn ;icmp | -s "$net" -d "$ip" -p icmp --icmp-type 0/0" # DROP # client dhcp (bootps : 67, bootpc : 68) #local dropEthIn="$dropIn ;drop_dhcp | -d 255.255.255.255 -s 0.0.0.0 -p udp --sport ${bootpcPort} --dport ${bootpsPort} -m state --state NEW" #local dropEthIn="$dropIn ;drop_igmp | -d 224.0.0.1 -s 0.0.0.0 -p igmp"