Answer the question
In order to leave comments, you need to log in
How to adapt a rule from the MikroTik firewall to the Linux iptables syntax?
There are such rules:
/ip firewall nat
add place-before=0 chain=srcnat src-address=192.168.0.0/24 dst-address=172.16.0.0/24
Answer the question
In order to leave comments, you need to log in
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -d 172.16.0.0/24 -j MASQUERADE
well, write down
iptables -t nat -A -s 192.168.0.0/24 -d 172.16.0.0/24 -j SNAT
only you have some unfinished rule - action is missing. So I can't tell which address SNAT is running from
Alexander Karabanov : iptables writes to you correctly.
iptables v1.4.21: SNAT: option "--to-source" must be specified
Because
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -d 172.16.0.0/24 -j SNAT --to -source %ip address of the interface through which the connection goes up to 172.16.0.0/24%
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question