Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [ufw]

ufw is the default firewall application for Ubuntu Linux.

Filter by
Sorted by
Tagged with
1 vote
0 answers
64 views

ufw forward rule isn't working: connection refused

I'm running a Raspberry Pi and I'm trying to get Pi-hole working. I'm running the container from Podman from a newly created pi-hole user (non root). I published the ports as follows: - 127.0.0.1:5053:...
Thomas Kleinendorst's user avatar
0 votes
1 answer
39 views

Is it possible to use ufw when kernel.modules_disabled=1

I am following Mastering Linux Security and Hardening 3rd ed. by Donald a. Tevault on Ubuntu 22.04 VPS. I have accepted suggested by lynis value 1 for kernel parameter kernel.modules_disabled, as ...
legeyda's user avatar
0 votes
1 answer
125 views

UFW: allow all but restrict only one port

I have an application running on port 1111. Is there any way to set up UFW so that it allows anything, but if the port is 1111, then it allows access only from certain IP to this port? Any other ports ...
Gooman's user avatar
  • 3
0 votes
1 answer
71 views

UFW settings for a VPN on a Rasperry Pi

I have recently set up a headless Rasperry Pi, using Raspberry Pi OS Lite. I set up Wireguard and some UFW rules. The outcome that I would like to have: all network traffic is blocked except for ...
ivsterr's user avatar
0 votes
1 answer
33 views

ufw temporarily reject port on localhost for local testing

I don't understand why those two commands don't block Port 8391 locally. sudo ufw reject from 127.0.0.1 to 127.0.0.1 port 8391 telnet 127.0.0.1 8391 Trying 127.0.0.1... Connected to 127.0.0.1. Escape ...
Wör Du Schnaffzig's user avatar
1 vote
0 answers
15 views

How to configure ufw firewall for Mastodon bot

I have made this bot for Mastodon with mastodon.py: https://github.com/aitormendez/loro/blob/main/loro.py The bot listens to mentions and responds to them. I have it running at home on a raspberry pi ...
aitor's user avatar
  • 111
0 votes
1 answer
110 views

docker container reachable despite firewall denying incoming traffic

I am in the process of setting up a VPS to run a few docker packages. The firewall set up to block any incoming traffic (default) just allowing anything that comes in via Wireguard VPN. Still the ...
Christian Herzyk's user avatar
0 votes
0 answers
61 views

UFW not filtering FORWARD traffic on same (tun0) interface

I have an Ubuntu 22.04 server with OpenVPN running and I want to filter access between clients on the tun0 interface with UFW. As far as I know this all has to do with the FORWARDING chain within UFW. ...
Erres's user avatar
  • 1
0 votes
2 answers
122 views

Is my home network being attacked?

I started to learn about network security and firewalls. My network is very simple, I have a router (MikroTik) and my laptop is connected to it via WLAN. The router has following (default) firewall ...
networknoob's user avatar
0 votes
1 answer
397 views

Trying to allow a device access to the Internet through ufw using a shared ethernet port on Raspberry Pi while on Wi-Fi

I'm attempting to share my Raspberry Pi's ethernet port so I can connect an ethernet device (indirectly) to Wi-Fi while still protecting the device (and Pi) with a firewall (in this case ufw with gufw ...
Geoff's user avatar
  • 101
0 votes
0 answers
223 views

ufw firewall blocking / logging too much, syslog is getting spammed

I set up ufw firewall on a Debian 12.1 sever. This is my configuration: sudo ufw status verbose Status: active Logging: on (low) Default: allow (incoming), allow (outgoing), deny (routed) New profiles:...
merlin's user avatar
  • 1
0 votes
1 answer
514 views

Port connection to docker container within Ubuntu UFW

Please help clarify why the connection below is allowed. I've set a Windows Server (IP 192.168.10.10) with Hyper-V running Ubuntu (IP 10.0.0.9). Within Ubuntu I've installed Docker, then some ...
rd1218's user avatar
  • 101
1 vote
0 answers
633 views

ufw blocks KVM guest from getting ip address and accessing network

I need help getting ufw on a host computer to allow traffic to a virtual machine that it hosts. More specifically, I am running Ubuntu 23.04 Server with a KVM virtual machine on a bridged network. My ...
Cold-Lemonade's user avatar
0 votes
0 answers
254 views

UFW SSH deny rule not working

TLDR: I'm trying to block SSH connections to a server; the server itself is connected to a ubuntu router with UFW on it, but external SSH connections to the server aren't getting denied, UFW doesn't ...
rob_qwerty's user avatar
0 votes
0 answers
33 views

how to publish a ganache client in Ubuntu 22.04 to local network

I have ganache client installed on my Ubuntu 2204. I want to publish the client for other local computers via port 8545. I run the ganache client via the command: $ ganache-cli --secure -a 10 -e 1000 -...
GrailsBeginner98's user avatar
0 votes
0 answers
54 views

Forwarded packet seemingly, skipping POSTROUTING rules

I have a very simple Wireguard configuration. Client are assigned 10.7.0.0/24 addressed, traffic is forwarded out the primary interface, finally the packets are SNAT'd out of the primary interface on '...
Liam Kelly's user avatar
4 votes
2 answers
5k views

enabling ufw failed with Ubuntu from WSL2

It is a fresh install of Ubuntu 20.4 or Ubuntu 22.04 but they all failed when I tried to enable ufw with errors as below from a Ubuntu console. sudo ufw enable Traceback (most recent call last): ...
zung nguyen's user avatar
5 votes
1 answer
5k views

Allow a list of IP addresses to access ports with UFW

I want to allow a list of (around 100) IP addresses to access a website on an ubuntu server. I'd like to be able to refresh the list via cron. I'm trying to do it with UFW. I thought this might be ...
Will's user avatar
  • 161
1 vote
1 answer
6k views

Ubuntu UFW: how to add ipv6 tcp/udp rule?

For example, what is the ipv6 only equivalence of ufw allow 22/tcp? UFW documentation does not list valid protocol names, and I could not figure out the protocol name for tcpv6.
user2771324's user avatar
0 votes
0 answers
1k views

How to edit ufw .rules files?

Where can I learn the syntax and options available in ufw configuration files such as /etc/ufw/before.rules? I have searched the ufw manual, ufw wiki, and on DuckDuckGo and nowhere have I been able to ...
hawk's user avatar
  • 285
0 votes
2 answers
5k views

Wireguard isn't working, 'wg0' doesn't exist

I've got an issue with wireguard. I have a debian-based VPS, and a Manjaro client. Here is my /etc/wireguard/wg0.conf of a server: [Interface] Address = 10.0.0.1/24 ListenPort = 194 PrivateKey = <...
stereophonicSound's user avatar
1 vote
0 answers
628 views

How to configure ufw to limit only failed ssh connections, not successful ones?

My OS is Ubuntu 20.04 LTS. Is it possible to configure ufw limit -rule for remote ssh so that it limits only failed ssh connection attempts? Now it limits also successful ssh connections, which is ...
user4955663's user avatar
0 votes
0 answers
269 views

What is the analogue of iptables' exclamation mark in UFW?

What would be the analogue of this iptables commad in ufw? iptables -A OUTPUT ! -d 5.5.5.5 -j DROP What is the analogue of exclamation mark in ufw? In other words, how to match all IP addresses ...
g00dds's user avatar
  • 143
0 votes
0 answers
2k views

How to allow specific program through Linux firewall?

I have ufw/gufw with the following rules: Deny all incoming and also deny all outgoing. Now I want to add an exception to these rules: Let's say I have a custom web browser named MyBrowser and I want ...
YoYoYo's user avatar
  • 113
1 vote
0 answers
90 views

Disable software inserting firewall rules

I'm using Ubuntu 20.04 with Postfix, Dovecot and UFW, when installing both Postfix and Dovecot I immediately noticed they're adding their own rules into iptables, however using the UFW commands I can'...
Nacio's user avatar
  • 11
2 votes
0 answers
903 views

How to allow an app on a specific interface?

I have a network interface my_very_important_vpn and a ufw app tensorboard: $ sudo ufw app info tensorboard Profile: tensorboard Title: Tensorboard Description: Tensorboard - a web application for ...
CrabMan's user avatar
  • 238
0 votes
0 answers
656 views

Debian with VPN and firewall blocking web traffic

I have a VPN (IKEv2) set up on a Debian VM. I'm trying create a kill switch to stop all traffic when the VPN goes down. I've followed the guidance of this post. It seems to work fairly well (torrent ...
furnaceX's user avatar
  • 111
0 votes
0 answers
352 views

Can't clone a remote repo when ufw is enabled

I have a cloud VM running alpine3.15 [disk mode enabled] and I am able to clone/push/pull to github when ufw is off. However when it is on, all git commands that talk to github get stuck (no output) I ...
Blank's user avatar
  • 101
0 votes
1 answer
2k views

Ansible UFW allow outgoing, deny incoming

try to roll out UFW via Ansible. - name: Install UFW Firwall hosts: all tasks: - name: UFW enabled community.general.ufw: state: "enabled" policy: "deny&...
beli3ver's user avatar
  • 171
8 votes
1 answer
8k views

Enable access to host service with ubuntu firewall from docker container

I have a service running on a host at port 8545. I have several docker containers which need access to this service on the host. The host is running ubuntu. I've successfully configured extra_hosts: - ...
Paymahn Moghadasian's user avatar
0 votes
0 answers
957 views

can't connect remotely to ftp server

after installing and configuring vsftpd on my Ubuntu 20.04, I'm unable to connect to my ftp server remotely. It works fine inside my LAN. I'm behind a NAT, but have all the necessary ports forwarded, ...
Zajdacak's user avatar
2 votes
1 answer
838 views

How to allow IPIP (IP encap, proto 4) with ufw?

I have tried: # ufw allow proto ip-encap from 198.51.100.3 ERROR: Unsupported protocol 'ip-encap' # ufw allow proto ipip from 198.51.100.3 ERROR: Unsupported protocol 'ipip' # ufw allow proto 4 from ...
divB's user avatar
  • 587
0 votes
0 answers
78 views

Can't start openvpn server..? Does anybody have an idea where issue lies?

root@debian:/etc/openvpn/server# systemctl status openvpn@server ● [email protected] - OpenVPN connection to server Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset:...
As_Aidas's user avatar
0 votes
0 answers
429 views

My HUAWEI router does not seem to open all the ports that is set to open without giving me any relevant output. Why so?

Some of my ports that I reckon I did my best to open them do not appear to be open for canyouseeme. For example, I get this from the website (I replaced my public IP with wildcard characters for ...
John Smith's user avatar
0 votes
1 answer
1k views

Using ufw to block established telnet connection

I'm trying to learn ufw and I'm wondering if I can block established connections with it. I've made connection between my 2 computers using telnet and I'm trying to use ufw to block it. Tried many ...
Kankarollo's user avatar
0 votes
0 answers
2k views

How to block outgoing connection to external website with ufw?

I'm using debian10 ufw, command as next: ufw deny out to 10.192.225.199 port 80 And the status as next: # ufw status Status: active To Action From -- ...
atline's user avatar
  • 123
5 votes
1 answer
3k views

What are the advantages of ufw, is it really needed?

I am quite enough familiar with iptables and I find iptables -L -v easy enough to read. Backuping is easy and I am happy with that. However in recent versions of Ubuntu there is ufw that quite pollute ...
nowox's user avatar
  • 2,869
1 vote
0 answers
56 views

How to explain UFW firewall LAN packet from external source on non-forwarded port?

I have a small home server with hostname mango running Debian, with UFW firewall and logcheck installed. For years, my (NAT) router has a very limited number of port forwards to this mango server. ...
Rabarberski's user avatar
  • 8,572
1 vote
2 answers
5k views

Can I use WSL's ufw as a firewall for Windows 10?

I recently found out Linux is shipped with ufw as a firewall, so I thought if I can use WSL, it will be constantly running as a firewall; I know Windows already has a firewall, but having two wouldn't ...
toothsy's user avatar
  • 13
0 votes
1 answer
242 views

Debian 10 UFW Blocking allowed return traffic even after reload, reset, restart

Been dealing with this problem for a while. UFW seems to only block most of the traffic, as responses to get accepted according to the PCAPs I've done. In the example below the traffic is originating ...
user avatar
0 votes
1 answer
510 views

Unable to delete a ufw rule that has a space in it

After installing ufw on several servers, I see the following rules: To Action From -- ------ ---- 224.0.0.251 mDNS ALLOW ...
learningtech's user avatar
  • 1,181
1 vote
1 answer
10k views

What is the equivalent of ufw in Windows?

Trying to connect to Digital Ocean from a Windows 10 computer and getting Connection timed out on port 22. I learned it is because the port is blocked and needs to be opened. This command sudo ufw ...
Abdellah Ramadan's user avatar
0 votes
0 answers
26 views

ufw blocks secured ftp transfer when ports are opened [duplicate]

After forcing strict firewall rules (deny everything) and creating following exceptions with ufw: To Action From -- ------ ---- OpenSSH ...
Jakub Maly's user avatar
5 votes
5 answers
14k views

Ubuntu: Delete several ufw rules

How can several ufw rules be deleted at once? By using $ ufw status numbered Status: Aktiv Zu Aktion Von -- ------ --- ...
bobbolous's user avatar
  • 335
1 vote
0 answers
124 views

UFW white list ip address and domaines?

is it possible to have some sort of white list of IPs addresses and domains name allowed for incoming traffic and block all the rest? or is it better to enable incoming traffic whenever I want to ...
David Shapero's user avatar
1 vote
0 answers
16 views

few questions regarding ufw firewall

I recently notice some increase on my raspberry and since I am on a limited data cap. I thought using UFW to block incoming traffic can help alleviate this problem while I figure out the reason for ...
David Shapero's user avatar
0 votes
1 answer
171 views

UFW firewall does not allow any ports (Debian 9)

I'm facing a really incredible problem, I don't understand how it is possible elsewhere. I use ufw to manage my ports. I have an FTP server to install on my Linux server. When ufw is enable, I can no ...
Benjamin Peuple's user avatar
1 vote
2 answers
2k views

Ubuntu docker image /bin/sh: 1: ufw: not found

Trying to open a port on an ubuntu 18.04 image and no luck Running RUN ufw allow 8080 returns /bin/sh: 1: ufw: not found Any ideas as to how I can open this port or run ufw commands?
K41F4r's user avatar
  • 135
2 votes
1 answer
2k views

Debian 10 stopped on reboot after "Reached target system time synchronized"

I have a Debian 10 virtual server and I have removed ufw and iptables and rebooted the machine. Upon start, the system pauses at the Reached target system time synchronized line. After few minutes ...
KingsInnerSoul's user avatar
1 vote
2 answers
2k views

(UFW) allow incoming and outgoing connections to specific IP, deny everything else

I'm trying to set up an UFW firewall on Ubuntu like this: Allow all incoming and outgoing connections to IP 1.1.1.1 (all ports); Deny all other connections (incoming and outgoing); For the first ...
Bluuee's user avatar
  • 11