Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] modifying iptables: how can I prevent locking me out?
Date: Mon, 24 Jan 2011 21:42:11
Message-Id: 201101242240.35818.joost@antarean.org
In Reply to: [gentoo-user] modifying iptables: how can I prevent locking me out? by Jarry
1 On Monday 24 January 2011 19:47:43 Jarry wrote:
2 > Hi,
3 >
4 > I have to change rather complex iptables rules on server
5 > and I do not want to lock me out as this server is about
6 > 50 miles away. So how should I do it?
7 >
8 > I can back up the old rules by running:
9 > /etc/init.d/iptables save
10 > and it will be saved to /var/lib/iptables/rules-save
11 > (some strange format starting with number like [536:119208])
12 >
13 > I prepared a script with new (modified) iptables-rules,
14 > which I will run in bash. But in case I screw something,
15 > how could I force netfilter to load old saved rules,
16 > if I for whatever reason do not connect to server (ssh)?
17 >
18 > Or can I load new iptables-rules for certain time, and
19 > then force netfilter to load back the old rules again?
20 >
21 > Jarry
22
23 You could add the necessary rule(s) to ensure existing connections stay
24 active.
25 That way you can enable the new rules and test by openening a new SSH-
26 connection to the server.
27 If that works, you're ok.
28 If not, you can use the existing SSH-connection to go back to the old rules.
29
30 --
31 Joost

Replies

Subject Author
Re: [gentoo-user] modifying iptables: how can I prevent locking me out? Alan McKinnon <alan.mckinnon@×××××.com>