Whitelisting internet on computer with ufw

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
futanari

Whitelisting internet on computer with ufw

Post by futanari »

Hi,

I try to whitelist my computer but I don't know what I do wrong.

I use the following commands to black off the internet completely

Code: Select all

ufw deny out https
ufw deny out http
ufw deny https
ufw deny http
Next I whitelist the IPs I want, and I put them above the deny

sudo ufw status gives this:

Code: Select all

To                         Action      From
--                         ------      ----
Anywhere                   ALLOW       censored IP/24          
Anywhere                   ALLOW       censored IP/24           
Anywhere                   ALLOW       censored IP/24         
80/tcp                     DENY        Anywhere                  
443/tcp                    DENY        Anywhere                  
80/tcp (v6)                DENY        Anywhere (v6)             
443/tcp (v6)               DENY        Anywhere (v6) 

Code: Select all

Status: active

     To                         Action      From
     --                         ------      ----
[ 1] Anywhere                   ALLOW OUT   censored IP/24           (out)
[ 2] Anywhere                   ALLOW IN    censored IP/24          
[ 3] Anywhere                   ALLOW OUT   censored IP/24           (out)
[ 4] Anywhere                   ALLOW OUT   censored IP/24            (out)
[ 5] Anywhere                   ALLOW IN    censored IP/24           
[ 6] Anywhere                   ALLOW IN    censored IP/24          
[ 7] 80/tcp                     DENY IN     Anywhere                  
[ 8] 443/tcp                    DENY IN     Anywhere                  
[ 9] 443/tcp                    DENY OUT   Anywhere                   (out)
[10] 80/tcp                     DENY OUT   Anywhere                   (out)
[11] 80/tcp (v6)                DENY IN     Anywhere (v6)             
[12] 443/tcp (v6)               DENY IN     Anywhere (v6)             
[13] 443/tcp (v6)               DENY OUT   Anywhere (v6)              (out)
[14] 80/tcp (v6)                DENY OUT   Anywhere (v6)              (out)
All internet is blocked, but the sites I whitelisted are still not accessible. What do I do wrong?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
DAMIEN1307

Re: Whitelisting internet on computer with ufw

Post by DAMIEN1307 »

it seems that you have denied all outgoing http and https...really, unless you are doing very secret confidential government work, why did you just not use the actual ufw interface and just simply select either home or public profile,... incoming, deny...outgoing, allow...for 99% of users, that really should be all you need to do...and if your behind a router with built in firewall, its not necessary to even use the ufw at all since by default it is off meaning when off linux is built not to even "listen" at the ports...DAMIEN
Locked

Return to “Networking”