ipp2p filtering

by jeffkyjin
2 deployments · 1 still active · last rev. 4 years ago

ipp2p filtering for Ubuntu 10.04 with stock kernel 2.6.32.16-linode28

Compatible with: No distros currently supported
						#!/bin/bash
## Install the standard build tools ## 
apt-get install build-essential 

## For Linode - download the kernel & generate headers## 
cd /usr/src 
wget http://linode.com/src/$(uname -r).tar.bz2 
tar xjvf $(uname -r).tar.bz2 
ln -sf $(uname -r) linux 
cd linux 
make prepare 

## Install xtables addons ## 
apt-get install xtables-addons-common 
apt-get install module-assistant 
module-assistant auto-install xtables-addons-source 
depmod -a 

## Add rejection rules to iptables ## 

iptables -t mangle -A PREROUTING -j CONNMARK --restore-mark 
iptables -t mangle -A PREROUTING -m mark ! --mark 0 -j ACCEPT 
iptables -t mangle -A PREROUTING -m ipp2p --edk -j MARK --set-mark 1 
iptables -t mangle -A PREROUTING -m ipp2p --bit -j MARK --set-mark 1 
iptables -t mangle -A PREROUTING -m mark --mark 1 -j CONNMARK --save-mark 
iptables -A FORWARD -m mark --mark 1 -j REJECT 

## then add iptabls rules to /etc/rc.locale