#!/bin/bash

## REDIRECT
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 40000:49999 -j REDIRECT --to-ports 50002
ip6tables -t nat -A PREROUTING -i eth0 -p udp --dport 40000:49999 -j REDIRECT --to-ports 50002

## DNAT
# iptables -t nat -A PREROUTING -i eth0 -p udp --dport 40000:49999 -j DNAT --to-destination localhost:50002
# ip6tables -t nat -A PREROUTING -i eth0 -p udp --dport 40000:49999 -j DNAT --to-destination localhost:50002
