Question: I need to redirect all traffic incoming on port 9750 (the port chat server) to another machine on the same subnet. Ports clients - dynamic. 

```
iptables -t nat -A PREROUTING -p tcp -d x.x.x.a --dport 9750 -j DNAT --to-destination x.x.x.b:9750
iptables -t nat -A POSTROUTING -p tcp --dport 9750 -j MASQUERADE

```

However, the `host x.x.x.a` does not open port 9750. Clients do not connect to the server.

```
cat /etc/sysctl.conf |grep forward
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1
# Uncomment the next line to enable packet forwarding for IPv6
#net.ipv6.conf.all.forwarding=1

```

Answer: 
I'm not sure what your intentions were with `x.x.x.a` and `x.x.x.b`. For the PREROUTING rule you need to specify the external interface and the internal machine's IP:Port.

For port forwarding you don't need a MASQUERADE rule. However, you do need a rule to allow the traffic on the FORWARD chain.

```
iptables -A PREROUTING -t nat -i [external_iface] -p [proto] --dport [external_port] -j DNAT --to [internal_ip]:[internal_port]
iptables -A FORWARD -p [proto] -d [internal_ip] --dport [internal_port] -j ACCEPT

```
You did not provide packet forwarding configuration, so I hope you missed it. Temporarily you can enable it by:-

```
 echo 1 >/proc/sys/net/ipv4/ip_forward

```

To make it permanent open /etc/sysctl.conf and provide this parameter:-

```
net.ipv4.ip_forward=1

```