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
    See https://askubuntu.com/a/1168249/1004020 . Namely, please screenshot systemd-analyze plot > test.svg; open test.svg, and you are free to sudo systemctl disable NetworkManager-wait-online. I doubt your ISP is slowing down your boot, but in doubt, unplug your ethernet as unconnected computers should boot with the same speed. Are you sure your game did not fill up your disk space? – Daniel T Jan 28 '24 at 10:25
  • Thank you for your quick response! I'll upload the screenshot once I have it copied on my laptop, because the dekstop can not access internet at all. I still have 1.7gb free out of 2gb on my ssd. Also I don't know what disabling the NetworkManager should do? – Vasile Mironica Jan 28 '24 at 10:38
  • Please unprivate your Google Drive link, or use the proper image upload. Do not disable NetworkManager. I said NetworkManager *-wait-online* .service can be disabled, as that service only delays the boot process until a network is found. 1.7GB is tiny, but if it was like that before the problem, then I suppose it is fine. Or even better, please upload the contents of the svg to pastebin instead of screenshotting it. – Daniel T Jan 28 '24 at 10:43
  • Unprivated the image, and I cannot upload it direectly to the message because it's a svg. My bad about the NetworkManager, I ran the exact command you wrote, but the boot time seems to have stayed the same. Also I meant TB, not GB – Vasile Mironica Jan 28 '24 at 10:49
  • You have both ufw and firewalld installed. Those are both firewalls, so they are conflicting. Try uninstalling one of them. I personally just use ufw because it's simpler. Googling this problem, I found Fedora/RHEL users say that firewalld greatly slows down boot times. – Daniel T Jan 28 '24 at 10:55
  • I've uninstalled firewalld, and also reset ufw following this link, I seem to be connected to the internet now! thank you so much, but reboot still takes ~2mins. – Vasile Mironica Jan 28 '24 at 11:01
  • systemd-analyze critical-chain; systemd-analyze blame | head? – Daniel T Jan 28 '24 at 11:09
  • Nevermind! the boot time is back to normal, the two firewalls fighting seems to have been the problem, I'll update the post with the solution! Thank you very much! – Vasile Mironica Jan 28 '24 at 11:10
  • I will move my comments into an answer, so that this question can be answered properly – Daniel T Jan 28 '24 at 11:11

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
  • 4,594