#!/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 ;rtsp ;root/root" #local clients="$clients|TCP ;rtsp ;root/root" # -- SERVER -- local servers="$servers|UDP ;10000:20000 ;root/root" local servers="$servers|UDP ;20001:30000 ;root/root" local servers="$servers|UDP ;30001:40000 ;root/root" #local servers="$servers|TCP ;rtsp ;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"" # 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"