1 |
On 1/24/2011 10:59 AM, 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 |
> |
25 |
> Maybe a cron job that no matter what reloads the old rules 1 hour later? |
26 |
> |
27 |
> - Mark |
28 |
> |
29 |
|
30 |
Yep, that's the way I do it. I'd test that the cron works correctly |
31 |
beforehand. Nothing worse than locking yourself out *and* realizing your |
32 |
cron has a path issue. |
33 |
|
34 |
kashani |