1 |
On Monday 24 January 2011 19:59:16 Mark Knecht wrote: |
2 |
> On Mon, Jan 24, 2011 at 10:47 AM, Jarry <mr.jarry@×××××.com> wrote: |
3 |
> > Hi, |
4 |
> > |
5 |
> > I have to change rather complex iptables rules on server |
6 |
> > and I do not want to lock me out as this server is about |
7 |
> > 50 miles away. So how should I do it? |
8 |
> > |
9 |
> > I can back up the old rules by running: |
10 |
> > /etc/init.d/iptables save |
11 |
> > and it will be saved to /var/lib/iptables/rules-save |
12 |
> > (some strange format starting with number like [536:119208]) |
13 |
> > |
14 |
> > I prepared a script with new (modified) iptables-rules, |
15 |
> > which I will run in bash. But in case I screw something, |
16 |
> > how could I force netfilter to load old saved rules, |
17 |
> > if I for whatever reason do not connect to server (ssh)? |
18 |
> > |
19 |
> > Or can I load new iptables-rules for certain time, and |
20 |
> > then force netfilter to load back the old rules again? |
21 |
> > |
22 |
> > Jarry |
23 |
> |
24 |
> Maybe a cron job that no matter what reloads the old rules 1 hour later? |
25 |
> |
26 |
> - Mark |
27 |
|
28 |
another option woud be to setup and run a knock deamon (net-misc/knock), if |
29 |
that's an option for you. You'd have the advantage not being forced to wait |
30 |
for an hour (worst case). On the other hand you must make sure, that none of |
31 |
the configured knocking ports are blocked in the infrastructure between you and |
32 |
the server. |
33 |
|
34 |
-- |
35 |
Cheers, |
36 |
Manuel Klemenz |