Answer the question
In order to leave comments, you need to log in
How to forward a packet from IP:PORT to localhost:PORT?
External IP: 3.95.56.211
Local IP: 127.0.0.1
A process is started on 127.0.0.1 occupying UDP port 27884. It is necessary to redirect packets going to 3.95.56.211:27884 to 127.0.0.1:27884.
I have tried the following:
iptables -t nat -A PREROUTING --dst 3.95.56.211 -p udp --dport 27884 -j DNAT --to-destination 127.0.0.1
iptables -t nat -A PREROUTING --dst 3.95.56.211 -p udp --dport 27884 -j DNAT --to-destination 127.0.0.1
iptables -I FORWARD 1 -i eno1 -o lo -d 127.0.0.1 -p udp -m udp --dport 27884 -j ACCEPT
iptables -t nat -A POSTROUTING --dst 127.0.0.1 -p udp --dport 27884 -j SNAT --to-source 3.95.56.211
iptables -t nat -A OUTPUT --dst 3.95.56.211 -p udp --dport 27884 -j DNAT --to-destination 127.0.0.1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question