Gentoo Archives: gentoo-user

From: Nangus Garba <code.affe.dev@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Help with script for iptables
Date: Thu, 16 Nov 2006 15:29:06
Message-Id: 5fc5c49d0611160719w7d9a8d69w908a82412be877ea@mail.gmail.com
In Reply to: Re: [gentoo-user] Help with script for iptables by Mick
1 # I think that a set of rules that looks something like this would be easier
2 to maintain
3 # there are 500 little tricks that I could add if I was home and had my
4 notes
5
6 iptables -P INPUT DROP
7 iptables -A INPUT -i lo -j ACCEPT
8
9 #this will take care of all interfaces by default
10 iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
11
12 # maybe you should just use one interface for portage to connect through
13 such as eth0
14 # might also be a good plan to use the mac address instead of the ip it is a
15 little harder to spoof
16
17 #Allow rsync connections from study1 to update portage
18 iptables -A INPUT -i eth0 -p tcp -s 192.168.0.2 -m tcp --dport 873 -d
19 192.168.0.5 -j ACCEPT
20 #Allow tcp connections from study1 to download distfiles
21 iptables -A INPUT -i eth0 -p tcp -s 192.168.0.2 -m tcp --dport 1024 -d
22 192.168.0.5 -j ACCEPT
23 # these rules are kinda taken car of by: iptables -P INPUT DROP
24 # iptables -A INPUT -p tcp -i ${x} -j DROP
25 # iptables -A INPUT -p udp -i ${x} -j DROP

Replies

Subject Author
Re: [gentoo-user] Help with script for iptables Mick <michaelkintzios@×××××.com>