D
D
Dmitry I2019-01-02 19:23:04
linux
Dmitry I, 2019-01-02 19:23:04

How to convert iptables rules to Mikrotik rules?

Good afternoon.
I ask for help, there are rules for iptables, but I don’t understand how to stuff them into Mikrotik, for the life of me.
Tried it this way and that ... hands down already.
I would be very grateful for any hint.

iptables -t nat -A PREROUTING -p tcp -d 10.0.0.0/8 -j REDIRECT --to-port 9040
iptables -t nat -A OUTPUT -p tcp -d 10.0.0.0/8 -j REDIRECT --to-port 9040
#### Переадресация по домену ".onion" ####<code></code>
iptables -t nat -A PREROUTING -p udp --dport 53 -m string \ --hex-string "|056f6e696f6e00|" --algo bm -j REDIRECT --to-ports 5300
iptables -t nat -A OUTPUT -p udp --dport 53 -m string \ --hex-string "|056f6e696f6e00|" --algo bm -j REDIRECT --to-ports 5300

mikrotik
/ip firewall nat
add action=redirect chain=dstnat comment="TOR redir. DNS" disabled=no \
    dst-port=53 layer7-protocol=Onion port=53 protocol=udp to-ports=5300
add action=redirect chain=dstnat comment="TOR Connections redir." disabled=no \
    dst-address=10.0.0.0/8 protocol=tcp to-ports=9040
add action=masquerade chain=srcnat comment="Def. Masq" disabled=no \
    out-interface=ether2-wan

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question