Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
UFW port forwarding trouble [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jerol
n00b
n00b


Joined: 12 Feb 2022
Posts: 61

PostPosted: Fri Feb 14, 2025 4:34 pm    Post subject: UFW port forwarding trouble [solved] Reply with quote

Hey, I'm no longer on gentoo, but since you guys are always so useful and knowledgeable, I thought I might aswell give it a try. Networking has been something I've always struggled with and I'd like to learn more but it sometimes makes my head hurt :S

Been battling with this for a bit and would like some insight.

Forwarded a port on my VPN, now that's all good and I thought I was pretty much set but I was wrong. I followed the ufw gentoo wiki page and created a very simple configuration:

Code:

sudo ufw default deny incoming
sudo ufw allow from 192.168.0.0/24
sudo ufw allow qbittorrent

And by doing:

Code:
sudo ufw status verbose


I could indeed see that it doesn't have the right port, so I went and changed it in: /etc/ufw/applications.d/ufw/ufw-bittorent

Afterwards I did:

Code:
sudo ufw reload

and
Code:
sudo ufw status verbose


Then it didn't change when I checked the status, was confused until I decided to delete the qbittorrent rule and add it back, then it changed.

Then I thought I was good, but then I put my VPN on and checked in https://canyouseeme.org/ and it still did not show the port being open.

Am I missing something here?


Also it has come to my knowledge that I should indeed forward UDP and TCP for qbittorrent. Now I only have UDP forwarded because I thought wireguard couldn't utilize TCP that well, but I guess I was wrong?


Last edited by jerol on Fri Feb 14, 2025 8:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54856
Location: 56N 3W

PostPosted: Fri Feb 14, 2025 4:56 pm    Post subject: Reply with quote

jerol,

We need t understand your network topology together with the location in that topology of your VPN and firewall.
A little bit of ASCII art goes a long way, or a picture is worth 1k words :)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
jerol
n00b
n00b


Joined: 12 Feb 2022
Posts: 61

PostPosted: Fri Feb 14, 2025 5:08 pm    Post subject: Reply with quote

Sorry, for not providing :) I hope these help.

UFW Status: https://bpa.st/N5CQ

UFW Config: https://bpa.st/4VBQ (Also I have no idea as to why the file is named: "ufw-bittorent", but it seems to work. I think it was previously named "ufw-bittorrent", but I don't remember renaming it at all.)

AirVPN Port: https://imgur.com/a/WD7oHM8

I'm also willing to configure this all in iptables if it doesn't work out this way, but first I need to do a bit of studying on it :p
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54856
Location: 56N 3W

PostPosted: Fri Feb 14, 2025 5:31 pm    Post subject: Reply with quote

jerol,

By topology' I mean describe how the various systems are interconnected.

e.g. I have a boundary firewall on one system that looks after my entire home network..
I have a DMZ, a protected and untrusted zones.
The DMZ is for servers. Any permitted uninvited incoming traffic is DNATed there.
Untrusted is anything not Gentoo. TV, Mobile Phones and so on, that cannot be trusted.

DMZ can make permitted connections to the internet.
Untrusted can make permitted connections to DMZ and internet but not to trusted.
Trusted can make permitted connections anywhere.

My firewall is paranoid.
By default, incoming is DROPed and outgoing is REJECTed.

You need not be doing it all on one system. That matters.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
jerol
n00b
n00b


Joined: 12 Feb 2022
Posts: 61

PostPosted: Fri Feb 14, 2025 5:46 pm    Post subject: Reply with quote

I'll try to explain it however I can, but I can just say that mine isn't complex. I only have my gateway (with a somewhat configured firewall on it), this pc (with ufw on it) and the VPN.

But I think I figured it out, the port showed as closed because nothing was listening to it apparently? As soon as I opened qBittorrent it showed as open in https://canyouseeme.org/, I also changed the UFW config file to include both 3997/tcp & 3997/udp after forwarding it for both protocols in the VPN.

Edit: Still not able to seed for some reason, even though there are plenty of peers and almost no seeds. I'm a bit conflicted on if the port number matters, some say it's better to be in the 50-60k range. I think I'm wrong since there seems to be no "perfect" port, as long as I can open it to the world, and I indeed can when https://canyouseeme.org/ shows me that it can see the service.

I think it was down to peers, the good thing is that it works now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum