Firewall rules export option for UFW

Asked by Frank

Is it possible to build an export function in UFW?
It would be really simple then to edit one server(maybe raspberry pi) and import the settings on another server.
or the export can serve as a backup of the settings in the case that a normal backup of the server is corrupt.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu ufw Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1
Revision history for this message
Frank (f2b-owesome) said :
#2

Yes that I know,it just would make it easier and also for people that are less knowledgable with linux.
Plus if the files change we don't need to go to searching for an answer online on sites like serverfault or stackoverflow.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

I don't use ufw and found that link with the simplest of searching.

What would make it easier? What is "it"?

Revision history for this message
Frank (f2b-owesome) said :
#4

A use case would be, user install ufw and adds rules(e.g. 80, 8080, 443, 22, 3306), user exports the firewall configuration to a desired folder (ufw export ./firewall rules/export 28-01-2020), user logs in to second device with ufw and runs ufw import /firewall rules/export 28-01-2020.

the "Export" feature is simply a command that copies the correct configuration files(even if ufw changes the location of the file) to a desired location, that way users don't have to dig into the filesystem to find the configuration files of ufw.

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#5

Then I suggest you report a bug. Mark it as a feature request

Revision history for this message
Frank (f2b-owesome) said :
#6

Thanks actionparsnip, that solved my question.