> For the complete documentation index, see [llms.txt](https://mabna-cloud.gitbook.io/mabnatechtips/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mabna-cloud.gitbook.io/mabnatechtips/linux-ip-tables-port-forward.md).

# Linux IP Tables Port Forward

```
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport $srcPortNumber -j REDIRECT --to-port $dstPortNumber

```

The following example redirects TCP port 25 to port 2525:

```
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j REDIRECT --to-port 2525
```
