Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Help with script for iptables
Date: Wed, 15 Nov 2006 20:34:05
Message-Id: 200611152029.35737.michaelkintzios@gmail.com
1 Hi All,
2
3 I have been using Daniel Robbins' basic script for years but now on a laptop I
4 have more than one ways of connecting to the Internet. The script uses the
5 variable UPLINK to define the incoming interface like so:
6 ==============================================
7 #change this to the name of the interface that provides your "uplink"
8 #(connection to the Internet)
9
10 UPLINK="eth0"
11
12 if [ "$1" = "start" ]
13 then
14 echo "Starting firewall..."
15 iptables -P INPUT DROP
16 iptables -A INPUT -i ! ${UPLINK} -j ACCEPT
17 iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
18 [snip...]
19 ==============================================
20
21 I would like to define more than one iface in UPLINK, e.g. eth0, wlan0, ppp0.
22 How am I supposed to do this? I've tried space, comma and colon as
23 delimiters, but all fail. I've also tried entering UPLINK="iface_name" one
24 on each line, but the last line seems to be the one that is always used.
25
26 I'd very much appreciate your script savvy guidance here, because I couldn't
27 fight my way out of a paper bag when it comes to scripting . . . :)
28 --
29 Regards,
30 Mick

Replies

Subject Author
Re: [gentoo-user] Help with script for iptables Flophouse Joe <flophousejoe-gentoo-user-xdzvne@××××××××××××.org>
Re: [gentoo-user] Help with script for iptables Iain Buchanan <iaindb@××××××××××××.au>