DEV Community

Discussion on: How To Serve Node.js Applications with Nginx on a Raspberry

Collapse
 
timmachinelogic profile image
tim-machine-logic

First, this was super helpful so thank you. I'm stuck on the following command:

iptables -A INPUT -p tcp -s localhost --dport 3000 -j ACCEPT

I get the following error:

iptables v1.8.2 (nf_tables): unknown option "--dport"

I tried going to the iptables documentation and they have similar commands like the following so not sure why the first one doesn't work:

iptables -A INPUT -p tcp -s 15.15.15.0/24 --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT

Collapse
 
jxboi profile image
Jia Xing

iptables-legacy -A INPUT -p tcp -s localhost --dport 3000 -j ACCEPT
iptables-legacy -A INPUT -p tcp --dport 3000 -j DROP

this works for me