Copying Rules from one system to another one

Asked by jean-christophe manciot on 2015-05-05

Hello,

My source system is Ubuntu desktop 14.10.
The target system is Ubuntu Server 15.04.

If I need to keep the same configuration & rules on both systems, which files must be copied from the source to the destination?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gui-ufw Edit question
Assignee:
No assignee Edit question
Solved by:
jean-christophe manciot
Solved:
2015-05-05
Last query:
2015-05-05
Last reply:
2015-05-05
Manfred Hampl (m-hampl) said : #1

AFAIK gufw is just a graphical frontend for maintaining the settings for ufw.
So I assume that your question would correctly be formulated "how can I copy the ufw rules from one system to another.
And for that question I found this link: https://wiki.ubuntu.com/UncomplicatedFirewall?action=show#Advanced_Functionality
(You have to be aware of potential incompatibilities between different versions.)

Unfortunately, it did not work out; I copied all the following files:

-/etc/default/ufw
-/etc/gufw/*
-/etc/ufw/*

Rebooted.
No rules are available in ufw nor in gufw:

ufw status verbose
Status: active
Logging: on (medium)
Default: deny (incoming), allow (outgoing), allow (routed)
New profiles: skip

Manfred Hampl (m-hampl) said : #3

If you start gufw on the target machine, do you see the copied rules?

According to the link that I gave the real rules are in /lib/ufw/* Have you also copied these files?

Some leftovers are available in:
- lib/ufw/user.rules
- lib/ufw/user6.rules
Now, all the rules are set.

As a simple summary, the files that need to be copied are:

-/etc/default/ufw
-/etc/gufw/*
-/etc/ufw/*
-/lib/ufw/user*