I have the following network topology: N devices in the network, one is a gateway. All of them are in the same network. My goal is to use one device as a proxy for UDP packets.

for example i will have in the network the following devices:


GW - Runs a DHCP Server assigning every device an address.

D1 - Runs a tftp client

D2...N - All run tftp servers

My goal is to route the D1 requests to one of the D2...N devices though the GW. For example let's say i want to connect the tftp client D1 to the tftp server D4 but D1 should not know which device it connects to, i want to send the tftp connection request to the gateway, and then the gateway should route the request to D4 in this case.

Something like D1 -> GW -> D4 and back.

Now i've tried with the following rules on the gateway but i can't seem to get the connection working.

sudo iptables -t nat -A PREROUTING -s -p udp --dport 69 -j DNAT --to-destination
sudo iptables -t nat -A POSTROUTING -p udp -d --dport 69 -j SNAT --to-source       
iptables -A FORWARD -d -p tcp --dport 69 -j ACCEPT                                               

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.