ufw blocking apt and dns
You need to add the following into iptables
, as ufw
just interfaces with it.
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
Related videos on Youtube
Fleshgrinder
Currently working at HelloFresh as staff engineer. See some of my projects over at GitHub.
Updated on September 18, 2022Comments
-
Fleshgrinder over 1 year
I installed ufw on my Debian system like the following:
# aptitude install ufw # ufw limit 22 # ufw allow 80 # ufw allow 443 # ufw enable # ufw status verbose Status: active Logging: on (low) Default: deny (incoming), allow (outgoing) New profiles: skip To Action From -- ------ ---- 20 LIMIT Anywhere 80 ALLOW Anywhere 443 ALLOW Anywhere
A simple
ping google.com
fails, also anyaptitude install
will fail. I searched serverfault for answers. One solution was to allow port 53 for DNS - didn't help. Orufw allow out 1024:65535/udp
together with port 53 - didn't help.What worked was to allow my DNS server like
ufw allow from [DNS IP]
; but that's no solution if you ask me.apt-get and aptitude are all blocked by ufw. Couldn't find anything on how to allow installing new things. A ufw log entry example:
Aug 12 17:31:08 host kernel: [535454.665168] [UFW BLOCK] IN=eth0 OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:00:00 SRC=0.0.0.0 DST=0.0.0.0 LEN=60 TOS=0x00 PREC=0x00 TTL=52 ID=0 DF PROTO=TCP SPT=80 DPT=41343 WINDOW=14480 RES=0x00 ACK SYN URGP=0
Any ideas?
-
Fleshgrinder almost 12 yearsIs it voted down because the person who voted my question down doesn't know the answer?
-
tacotuesday almost 12 yearsI'd look for something like this, since it just interfaces with iptables:
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-
Fleshgrinder over 11 years@nojak Post it as an answer and I accept it as the correct one. This works like a charm!
-
tacotuesday over 11 yearsGlad to hear it!
-
rugk about 7 yearsAs for DNS, also see UFW is blocking DNS. It might help.
-
-
Razick about 10 yearsThis is the first answer after hours of searching to fix the issue. Thanks.