Discussion:
[arch-general] How to autostart ufw on system startup?
Francis Gerund
2015-04-16 02:39:50 UTC
Permalink
Hello!

How do I get ufw to start automatically upon Arch system startup?

The Arch wiki Uncomplicated Firewall pages says:
"Start ufw as systemd service to have it running and enable it to make it
available after boot. "

How do I do that?

Then it shows an example configuration (can't I just keep the default: deny
all incoming, allow all outgoing)?

Then it says:
"The next line is only needed *once* the first time you install the
package:

# ufw enable"

That does not seem to be true - I have to do "sudo ufw enable" every
time I restart the system.

Then, it says:
"Then enable the ufw service with systemctl."

How?

Bottom line: ufw works okay, I just want it to start automatically
when the system starts up.
Sebastian M.
2015-04-16 02:50:22 UTC
Permalink
You can enable services (and thus autostart them at boot) withthis
command:

# systemctl enable service

This means, you will need to type: # systemctl enable ufw

Also, I recommend reading the wiki.
https://wiki.archlinux.org/index.php/Systemd

Best regards,
Sebastian M.
Post by Francis Gerund
Hello!
How do I get ufw to start automatically upon Arch system startup?
"Start ufw as systemd service to have it running and enable it to make it
available after boot. "
How do I do that?
Then it shows an example configuration (can't I just keep the default: deny
all incoming, allow all outgoing)?
"The next line is only needed *once* the first time you install the
# ufw enable"
That does not seem to be true - I have to do "sudo ufw enable" every
time I restart the system.
"Then enable the ufw service with systemctl."
How?
Bottom line: ufw works okay, I just want it to start automatically
when the system starts up.
Chi Hsuan Yen
2015-04-16 02:50:14 UTC
Permalink
Hello Francis,

Just simply run the following command as root or with sudo:

systemctl enable ufw.service

Yen Chi Hsuan
Post by Francis Gerund
Hello!
How do I get ufw to start automatically upon Arch system startup?
"Start ufw as systemd service to have it running and enable it to make it
available after boot. "
How do I do that?
Then it shows an example configuration (can't I just keep the default: deny
all incoming, allow all outgoing)?
"The next line is only needed *once* the first time you install the
# ufw enable"
That does not seem to be true - I have to do "sudo ufw enable" every
time I restart the system.
"Then enable the ufw service with systemctl."
How?
Bottom line: ufw works okay, I just want it to start automatically
when the system starts up.
Francis Gerund
2015-04-16 03:35:42 UTC
Permalink
Okay, so do I do

1) sudo systemctl enable ufw

or,

2) sudo systemctl enable ufw.service

or, both?
Post by Chi Hsuan Yen
Hello Francis,
systemctl enable ufw.service
Yen Chi Hsuan
Post by Francis Gerund
Hello!
How do I get ufw to start automatically upon Arch system startup?
"Start ufw as systemd service to have it running and enable it to make it
available after boot. "
How do I do that?
deny
Post by Francis Gerund
all incoming, allow all outgoing)?
"The next line is only needed *once* the first time you install the
# ufw enable"
That does not seem to be true - I have to do "sudo ufw enable" every
time I restart the system.
"Then enable the ufw service with systemctl."
How?
Bottom line: ufw works okay, I just want it to start automatically
when the system starts up.
Chi Hsuan Yen
2015-04-16 03:46:02 UTC
Permalink
Hello Francis,

Both commands are equivalent. systemctl automatically adds the .service
suffix is not specified. Just pick one.

Yen Chi Hsuan
Post by Francis Gerund
Okay, so do I do
1) sudo systemctl enable ufw
or,
2) sudo systemctl enable ufw.service
or, both?
Post by Chi Hsuan Yen
Hello Francis,
systemctl enable ufw.service
Yen Chi Hsuan
Post by Francis Gerund
Hello!
How do I get ufw to start automatically upon Arch system startup?
"Start ufw as systemd service to have it running and enable it to make
it
Post by Chi Hsuan Yen
Post by Francis Gerund
available after boot. "
How do I do that?
deny
Post by Francis Gerund
all incoming, allow all outgoing)?
"The next line is only needed *once* the first time you install the
# ufw enable"
That does not seem to be true - I have to do "sudo ufw enable" every
time I restart the system.
"Then enable the ufw service with systemctl."
How?
Bottom line: ufw works okay, I just want it to start automatically
when the system starts up.
Sebastian M.
2015-04-16 03:49:08 UTC
Permalink
It does the same. Please read the wiki.

Regards,
Sebastian M.
Post by Francis Gerund
Okay, so do I do
1) sudo systemctl enable ufw
or,
2) sudo systemctl enable ufw.service
or, both?
Post by Chi Hsuan Yen
Hello Francis,
systemctl enable ufw.service
Yen Chi Hsuan
Post by Francis Gerund
Hello!
How do I get ufw to start automatically upon Arch system startup?
"Start ufw as systemd service to have it running and enable it to make it
available after boot. "
How do I do that?
deny
Post by Francis Gerund
all incoming, allow all outgoing)?
"The next line is only needed *once* the first time you install the
# ufw enable"
That does not seem to be true - I have to do "sudo ufw enable" every
time I restart the system.
"Then enable the ufw service with systemctl."
How?
Bottom line: ufw works okay, I just want it to start automatically
when the system starts up.
Francis Gerund
2015-04-16 04:25:54 UTC
Permalink
Okay, that seems to work. Thank you!

Strange that the ufw install routine didn't do that automatically.

And yes, I do read the wiki articles, whenever I have the time, patience
and
intelligence to do so. Which isn't easy after a very long, difficult day
of learning to install and set up Arch.

But I did want to get a firewall up and running, quicky. There are lots of
bad guys out there these days.

Thanks again.
Post by Sebastian M.
It does the same. Please read the wiki.
Regards,
Sebastian M.
Post by Francis Gerund
Okay, so do I do
1) sudo systemctl enable ufw
or,
2) sudo systemctl enable ufw.service
or, both?
Post by Chi Hsuan Yen
Hello Francis,
systemctl enable ufw.service
Yen Chi Hsuan
Post by Francis Gerund
Hello!
How do I get ufw to start automatically upon Arch system startup?
"Start ufw as systemd service to have it running and enable it to
make it
Post by Francis Gerund
Post by Chi Hsuan Yen
Post by Francis Gerund
available after boot. "
How do I do that?
Then it shows an example configuration (can't I just keep the
deny
Post by Francis Gerund
all incoming, allow all outgoing)?
"The next line is only needed *once* the first time you install the
# ufw enable"
That does not seem to be true - I have to do "sudo ufw enable" every
time I restart the system.
"Then enable the ufw service with systemctl."
How?
Bottom line: ufw works okay, I just want it to start automatically
when the system starts up.
LoneVVolf
2015-04-16 10:22:59 UTC
Permalink
Post by Francis Gerund
Strange that the ufw install routine didn't do that automatically.
Nope, that's standard practice for arch pacakges.

Deciding what is or isn't started at boot is up to the user to decide.

LVV
G. Schlisio
2015-04-16 10:52:21 UTC
Permalink
This post might be inappropriate. Click to display it.
Ralf Mardorf
2015-04-16 10:48:14 UTC
Permalink
Post by Francis Gerund
Okay, so do I do
1) sudo systemctl enable ufw
or,
2) sudo systemctl enable ufw.service
or, both?
Post by Sebastian M.
It does the same. Please read the wiki.
Post by Francis Gerund
And yes, I do read the wiki articles, whenever I have the time,
patience and intelligence to do so. Which isn't easy after a very
long, difficult day of learning to install and set up Arch.
But I did want to get a firewall up and running, quicky. There are
lots of bad guys out there these days.
Hi,

a few seconds of trail and error would have answered this question
quick as lightning ;), but to mention this isn't the reason for my
reply. My concern is off-topic. Anyway, it fits to this thread. It
became a fashion to drop interleaved reply style and bottom posting.
Please, if you don't want to use interleaved reply style or bottom
posting, then _don't_ quote text below your reply.

TIA,
Ralf
Ralf Mardorf
2015-04-16 10:59:04 UTC
Permalink
Post by Ralf Mardorf
Post by Francis Gerund
Okay, so do I do
1) sudo systemctl enable ufw
or,
2) sudo systemctl enable ufw.service
or, both?
Post by Sebastian M.
It does the same. Please read the wiki.
Post by Francis Gerund
And yes, I do read the wiki articles, whenever I have the time,
patience and intelligence to do so. Which isn't easy after a very
long, difficult day of learning to install and set up Arch.
But I did want to get a firewall up and running, quicky. There are
lots of bad guys out there these days.
Hi,
a few seconds of trail and error would have answered this question
quick as lightning ;), but to mention this isn't the reason for my
reply. My concern is off-topic. Anyway, it fits to this thread. It
became a fashion to drop interleaved reply style and bottom posting.
Please, if you don't want to use interleaved reply style or bottom
posting, then _don't_ quote text below your reply.
TIA,
Ralf
By accident I edited the top posting mail(s) with the quotation signs
the wrong way up, but this easily happens when there is the need to
edit wrong posting style replies :(.

Loading...