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 -p tcp --dport 8291 -j DNAT --to-destination

-eth2 is the Internet interface with ip address
-mikrotik ip address is listening on port 8291


No comments:

Post a Comment