CentOS port forwarding not working

To redirect packets to the loopback interface you need to use the REDIRECT target.

iptables -A PREROUTING -t nat -p udp --dport 8088 -i eth0 -j REDIRECT --to-ports 4569

Otherwise, you will change the destination address before the routing decision is taken to 127.0.0.1. This means that it will be considered a martian packet by the kernel and dropped by your reverse path filtering policy.

The two kernel parameters responsible for this behaviour are :

  • net.ipv4.conf.eth0.route_localnet

route_localnet - BOOLEAN

Do not consider loopback addresses as martian source or destination while routing. This enables the use of 127/8 for local routing purposes.

default FALSE

  • net.ipv4.conf.eth0.rp_filter

rp_filter - INTEGER

0 - No source validation.
1 - Strict mode as defined in RFC3704 Strict Reverse Path Each incoming packet is tested against the FIB and if the interface is not the best reverse path the packet check will fail. By default failed packets are discarded.
2 - Loose mode as defined in RFC3704 Loose Reverse Path Each incoming packet's source address is also tested against the FIB and if the source address is not reachable via any interface the packet check will fail.

Current recommended practice in RFC3704 is to enable strict mode to prevent IP spoofing from DDos attacks. If using asymmetric routing or other complicated routing, then loose mode is recommended.

The max value from conf/{all,interface}/rp_filter is used when doing source validation on the {interface}.

Default value is 0. Note that some distributions enable it in startup scripts.

As you totally want to keep this legitimate behaviour, the REDIRECT chain must be used to bypass this condition for a certain rule.