Score:0

Why iptables rule has no effect or doesn't get applied on Ubuntu 20.04?

cr flag

I applied the following rule:

sudo iptables -t nat -I OUTPUT -p tcp -o lo --dport 443 -j REDIRECT --to-port 3000

And the command ran without errors.

However, it is not doing what it is supposed to (redirect 443 to 3000 on localhost), and when I check the rules in place, I get nothing:

>> sudo iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

I'm on Ubuntu 20.04. What am I missing?

Doug Smythies avatar
gn flag
You have applied the rule to the nat table, so to see it do `sudo iptables -t nat -xvnL`. I am not certain, but maybe the rule should have been applied to the regular OUTPUT chain.
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.