#!/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 ;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"" # SRC=192.168.1.108 DST=192.168.1.143 LEN=117 TOS=0x00 PREC=0x00 TTL=64 ID=250 DF PROTO=TCP SPT=554 DPT=45202 WINDOW=7240 RES=0x00 ACK PSH FIN URGP=0 OPT (0101080AFFFFFDC0C808F89C) MARK=0xe local ruleIn="$ruleIn ;rtsp | -p tcp --sport rtsp -m state --state NEW --tcp-flags ACK,PSH,FIN ACK,PSH,FIN" # SRC=192.168.1.143 DST=192.168.1.108 LEN=40 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=TCP SPT=45202 DPT=554 WINDOW=0 RES=0x00 RST URGP=0 MARK=0xe local ruleOut="$ruleOut ;rtsp | -p tcp --dport rtsp -m state --state NEW --tcp-flags RST RST" # 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"