Question

Could someone help me open TCP 44158 ? (Wireguard Installed)

Hi,

I have created a “Ubuntu” droplet and have installed “Wireguard” I have it working fine where I can connect to it from my PC and the tunnel works.

I have a small “Gli Net” router where you can load the VPN details onto it and connect to the “Droplet” this also works.

I have one device that is connected to the LAN port of this router and it’s issued an IP address (VPN) but the port is “restricted” when I run Nmap from a Raspberry Pi on my network.

pi@raspberrypi:~ $ nmap -Pn -p 44158 178.128.167.230 --reason
Starting Nmap 7.70 ( https://nmap.org ) at 2022-04-09 12:43 BST
Nmap scan report for 178.128.167.230
Host is up, received user-set.

PORT      STATE    SERVICE REASON
44158/tcp filtered unknown no-response

I’m a little new to hosted VPS servers, it’s good fun learning, I know there are “IPTables” and also “UFW” and I also notice that you can do “Firewall” settings via the Digital Ocean dashboard.

This is my UFW status

Last login: Sun Apr 10 10:19:20 2022 from 162.243.188.66
root@ubuntu-s-1vcpu-1gb-lon1-01:~# sudo ufw statusStatus: active

To                         Action      From
--                         ------      ----
51820/udp                  ALLOW       Anywhere                  
OpenSSH                    ALLOW       Anywhere                  
51820/udp (v6)             ALLOW       Anywhere (v6)             
OpenSSH (v6)               ALLOW       Anywhere (v6)             

Anywhere on eth0           ALLOW FWD   Anywhere on wg0           
Anywhere (v6) on eth0      ALLOW FWD   Anywhere (v6) on wg0  

and this below is my wg0.conf

[Interface]
Address = 10.0.0.1/24
ListenPort = 51820
PrivateKey = xxxxxxx
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
PostUp = ufw route allow in on wg0 out on eth0
PostUp = iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
PostUp = ip6tables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
PreDown = ufw route delete allow in on wg0 out on eth0
PreDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
PreDown = ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
PublicKey = xxxxxx
AllowedIPs = 10.0.0.2/32

I’m just kind of stuck on how to open the Port and not sure where to add it?

I was thinking of using something like the following to then add it to “IPtables”

https://www.perturb.org/content/iptables-rules.html

Would any one be able to help?

Many Thanks :)


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer