I set up a transparent proxy with iptables on a gateway to intercept UDP messages from devices within a subnet. After setting the rules, the devices no longer receive the messages, but the gateway does not forward them to the port specified in my commands. What could be the reason?Below are the specific commands I set up
iptables -t mangle -A PREROUTING -p udp -d 10.13.173.10 –dport 50003 -j TPROXY –on-port 10006 –on-ip 127.0.0.1 –tproxy-mark 0x7/0x7
ip rule add fwmark 7 lookup 199
ip route add local 0.0.0.0/0 dev lo table 199
After these commands did not work, I tried the following commands
iptables -t nat -A PREROUTING -p udp -d 10.13.173.10 –dport 50003 -j REDIRECT –to-port 10006
I enabled network forwarding and turned on promiscuous mode for the corresponding network card, but it still did not take effect
user24588010 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.