6

Yesterday I(newbie on linux) port forwarded the port 42420 to play Vintage Story with some friends. After enabling it on the router and telling firewall-cmd what port to allow, we played without any issues.

But today - after a shutdown over night, I find that the machine boots up a lot slower than before (used to take ~10s, now takes 2 minutes, consistently), and on top of that no ethernet connection works, neither does the cable that worked yesterday, nor does usb tethering with my phone.

Using Ubuntu 22.04, on bare metal, linux version 6.5.0-15-generic.

Output of systemd-analyze blame tells me that

  • plymouth-quit-wait.service takes 21s
  • NetworkManager-wait-online.service takes 3s
  • any other is 1s or less.

The firwall-cmd command was firewall-cmd --permanent --zone=public --add-port=42420/tcp, which (I think) allows absolutely everyone to connect, but I assume it's safe because no application uses that port for anything, apart from Vintage Story.

I know I still have access to internet because wifi still works (on my phone, machine doesn't have a wifi adapter).

Maybe the ISP blocked every connection on my device to stop "potential attackers", I doubt that because not even usb tethering works.

Does anybody know what the problem could be? any help is greatly appreciated.

Photo of systemd-analyze plot > test.svg:

Solution to both problems, thanks to @Daniel T: Apparently I had both ufw and firewalld insatalled are they were conflicting, uninstalling firewalld seems to have solved both problems - internet and boot time are back to normal.

1 Answers1

7

In your systemd-analyze plot, you have both ufw.service (1.246s) and firewalld.service (140ms). Those are both firewalls, so they are conflicting. Try uninstalling firewalld with sudo apt remove firewalld.

ufw is preferred in this situation because:

  • Your needs of allowing just port 42420 is extremely simple
  • firewalld is known to slow down boot (1 2 3 4)

You should also reset ufw to defaults. (From @VasileMironica 's comment):

sudo ufw --force disable
sudo ufw --force reset
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw --force enable

Now system boot time should return what it was like before.

Daniel T
  • 5,339