I have a machine A
with local ip 192.168.0.199
- I want to clone all udp packets recieved on a local machine and forward to machine A
i tried the below in IP tables
sudo iptables -A OUTPUT -t nat -p udp -s 127.0.0.1 --dport 32000 -j TEE --gateway 192.168.0.199
on machine A
- i start listening for UDP packets with netcat -l -u -p 32000
and on my local machine - i send a test udp packet
echo 'ved' | nc -u 127.0.0.1 32000
the packet seems to reach my local instance port but i cant seem to recieve the cloned packet on machine A
-
Is there something else i need to be doing?
EDIT - so if i do a tcpdump
on machine A
- packets do seem to be arriving on the port - but not sure why this isnt captured by netcat - i tried listening on all interfaces as well
sudo tcpdump -n udp port 32000 -e
does seem to show incoming packets - but why isnt this captured by netcat
Could this have something to do with the source IP not being changed? tcpdump still shows 127.0.0.1 as the source IP