- Posts: 3
- Thank you received: 0
Custom egress filter for IPCop
- registered
- Offline
- New Member
i am using IPCOP 1.4.0..(i can't use older version due to tightened security as there's a lot of viruses at ma internal network n i can't remove them every 1's Pc bt i want to block p2p softwares)..dats why i joined this forum..i had tried this.in my rc.local file.
#!/bin/sh
# shorthand helper
# $IPT="/sbin/iptables"
# variables defined therein
# . /var/ipcop/ethernet/settings
# Flush CUSTOMINPUT and CUSTOMFORWARD rules
/sbin/iptables -F CUSTOMINPUT
/sbin/iptables -F CUSTOMFORWARD
# Allow full access to the RED interface for specific IP addresses
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.1 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.2 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.3 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.4 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.5 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.11 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.18 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.13 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.14 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.15 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.16 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.17 -o $RED_DEV -j ACCEPT
# Drop all other outbound traffic to the RED interface
/sbin/iptables -A CUSTOMINPUT -i $GREEN_DEV -s 0/0 -o $RED_DEV -j DROP[/code]
but all in vain...please tell me some thing how i can do this.... please help me to do so.....i'll be very thankful to you..i am using 1MBPS ADSL connection on IPCOP machine.[/code]
- registered
- Offline
- New Member
- Posts: 3
- Thank you received: 0
i am using IPCOP 1.4.0..(i can't use older version due to tightened security as there's a lot of viruses at ma internal network n i can't remove them every 1's Pc bt i want to block p2p softwares)..dats why i joined this forum..i had tried this.in my rc.local file.
#!/bin/sh
# shorthand helper
# $IPT="/sbin/iptables"
# variables defined therein
# . /var/ipcop/ethernet/settings
# Flush CUSTOMINPUT and CUSTOMFORWARD rules
/sbin/iptables -F CUSTOMINPUT
/sbin/iptables -F CUSTOMFORWARD
# Allow full access to the RED interface for specific IP addresses
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.1 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.2 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.3 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.4 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.5 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.11 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.18 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.13 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.14 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.15 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.16 -o $RED_DEV -j ACCEPT
/sbin/iptables -A CUSTOMFORWARD -i $GREEN_DEV -s 192.168.0.17 -o $RED_DEV -j ACCEPT
# Drop all other outbound traffic to the RED interface
/sbin/iptables -A CUSTOMINPUT -i $GREEN_DEV -s 0/0 -o $RED_DEV -j DROP
but all in vain...please tell me some thing how i can do this.... please help me to do so.....i'll be very thankful to you..i am using 1MBPS ADSL connection on IPCOP machine.