Score:0

how to get internet while your default policy is DROP in iptables

mx flag

how to get internet while your default policy is DROP in iptables

basically I want to block all unauthorized traffic with iptables I set my default policy to drop (INPUT) and that caused me to not have internet which is understandable , I know I have to set a rule to get internet which rule would that be?

pLumo avatar
in flag
This is not answerable. Not sure what you want. "Internet" is the whole thing, and services can use any port they like. If you mean websites (HTTP) you need ports 80 and 443, sometimes 8080, but any other port is also allowed. Or do you mean SSH (22) or FTP (21), SMTP , Pop3, IMAP .... also don't forget DNS queries (53) and many more ... all have different **default** ports. Please tell us your goal. The default setup that outgoing traffic is allowed per default is good for general purpose. You may rather want to use an application-based firewall like opensnitch or douane?
Nate T avatar
it flag
I doubt he or she will be accepting DNS queries, but I get your point. XD
Score:2
sa flag

The default firewall configuration tool for Ubuntu is ufw (uncomplicated firewall). If you want to reset ufw, you need to run the sudo ufw reset command. This command will basically set the ufw firewall back to its default settings. Open the terminal and type:

sudo apt update
sudo apt install ufw
sudo ufw reset  
sudo ufw enable # type y at the [Y/n] prompt

After running these commands run sudo ufw status verbose to check the status of UFW. The output should be like this:

$ sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.