F
F
fr0zen2017-08-16 12:41:56
iptables
fr0zen, 2017-08-16 12:41:56

How to fix open port on ubuntu?

There is a server on ubuntu. I launched an Express backend on it. It's not available. Opened ports:

iptables -A OUTPUT -p tcp --dport 3000 -j ACCEPT
iptables -A INPUT -p tcp --dport 3000 -j ACCEPT

Now everything works.
I restart the server. Everything doesn't work again. nestat shows that port 3000 is not open. I open it again - everything works again.
How can I make sure that the specified port is always open, even after the server is rebooted?
PS on trying to do:
service iptables save
iptables: unrecognized service

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pfg21, 2017-08-16
@pfg21

iptables does not save its rules when the system is shut down.
for this Wexter advised me to install the iptables rule saver on reboot.
option 2: write the rules in the executable script in the dir /etc/network/if-up.d/ they are executed when the network is turned on and fill the new (after reboot) life of iptables with meaning :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question