I have an embeded system with 2 interfaces e0 and m0, whose ips are and, respectively. Incoming packets into e0 have an ip of and should be forwarded to m0 interface to external server whose ip is Also, the returning traffic into m0 should be returned to e0.

I tried to forward packets with these commands:

route add -net dev m0

iptables -t nat -A PREROUTING -d -j DNAT --to-destination

iptables -t nat -A POSTROUTING -s -j SNAT --to-source

I did tcpdump at m0 but don't see anyting going out.

Can you tell me what I am missing? Thank you in advance.


Perhaps you need to turn on forwarding in the kernel with:

sysctl -w net.ipv4.ip_forward=1
  • hi ken, yes i've done that also. do you have any more suggestions? – mark Feb 24 '15 at 20:19
  • hi mark, can you post the output of "ip address" and "ip route" please? – Martin Feb 25 '15 at 7:46
  • hi martin, i hope this is appropriate that i include a link to another website where i posted the same quesiton. on this website i have the info that you as well as others have requested: unix.stackexchange.com/questions/186636/… – mark Feb 26 '15 at 4:45

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.