Answer the question
In order to leave comments, you need to log in
How to forward to the same port in linux?
Guys! I'm talking about port forwarding.
The daemon is running on port 5984. This is a database.
I want to open it from another PC inside the network 192.168.0.102:5984
sudo iptables -t nat -A PREROUTING -p tcp --dport 5984 -j REDIRECT --to-ports 5984
sudo iptables -t nat -A PREROUTING -p tcp --dport 5983 -j REDIRECT --to-ports 5984
Answer the question
In order to leave comments, you need to log in
sudo iptables -A INPUT -p tcp --dport 5984 -s 192.168.0.0/24 -j ACCEPT
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question