0

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

I tried to forward packets with these commands:

route add -net 10.0.0.0/16 dev m0

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

iptables -t nat -A POSTROUTING -s 10.0.0.0/16 -j SNAT --to-source 10.0.0.20

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

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

0

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.