I've been attempting to forward a port range (or even a single port) from my server's WAN -> a remote client.
I've tried a few combinations of command lines I've seen while looking up the issue, but none seem to work.
Code: Select all
#iptables -t nat -A PREROUTING -p udp --dport 27015 -j DNAT --to-dest 10.8.1.2:27015
#iptables -t nat -A POSTROUTING -d 10.8.1.2 -p udp --dport 27015 -j SNAT --to-source 10.8.1.1
iptables -t nat -A PREROUTING -p udp -i eth0 --dport 27015 -j DNAT --to-destination 10.8.1.2:27015
iptables -A FORWARD -p udp -d 10.8.1.2 --dport 27015 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
Edit: To specify, I ran command 1a on the host, 1b on the client. I'm assuming that's how it's supposed to be. I also tried 2a&c on the host, and 1b on the client.. I've tried all sorts of combinations.
A little extra info: The host is running CSF (locked down iptables) and the client is simply running a default iptables install. The issue may be as easy as adding another rule, I'm not sure.
Host: 10.8.1.1
Client: 10.8.1.2
Port: 27015
Desired port range: 27000-27050
I will appreciate any help. I've been at this for hours trying to make it work.