On Wed 01/Jul/2020 20:11:38 +0200 Roberto Carna wrote:
Hi people, I have a log server with iptables, the IP is 10.10.100.1. I have several network devices sending logs to my log server 10.10.100.1 on UDP/514 port. In the log server, I wanna filter incoming traffic only from IP 10.10.100.20 to UDP/514 destination port and change to UDP/9000 destination port. How are the iptables rules to achieve what I said?
I have this stuff on "man iptables-extensions": REDIRECT This target is only valid in the nat table, in the PREROUT‐ ING and OUTPUT chains, and user-defined chains which are only called from those chains. It redirects the packet to the machine itself by changing the destination IP to the primary address of the incoming interface (locally-generated packets are mapped to the localhost address, 127.0.0.1 for IPv4 and ::1 for IPv6). --to-ports port[-port] This specifies a destination port or range of ports to use: without this, the destination port is never altered. This is only valid if the rule also speci‐ fies one of the following protocols: tcp, udp, dccp or sctp. hth Ale --