Friday, September 23, 2011

port forwarding to mikrotik

I use linux as my gateways, use mikrotik only for bandwidth management,
So to remote to my mikrotik from Internet I have to add iptables rules as below:

#echo 1 > /pro/sys/net/ipv4/ip_forward  (enable routing on linux box)
#iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE  (enable nat)
#iptables -t nat -A PREROUTING -i eth2 -d 203.189.148.71 -p tcp --dport 8291 -j DNAT --to-destination 192.168.11.210:8291

NOTE:
-eth2 is the Internet interface with ip address 203.189.148.71
-mikrotik ip address is 192.168.11.210 listening on port 8291

---------------------------------------------------------------------------------------------------------------

No comments:

Post a Comment