Community discussions

MikroTik App
 
BassTeQ
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Fri Jan 19, 2018 5:52 am

IPTABLES in RouterOs

Mon Jan 22, 2018 4:19 am

Hi all,

I'm considering updating my exiting DDWRT to a routerboard, before I make a purchase I'd like to be sure that routerOS can definatly do the following.

I use a dns proxy for some devices, I have IPTABLES rules to detect any dns requests from certain hosts and redirect them transparently via my dns proxy. Below is the IPTABLES rules I use, can this be achieved in RouterOS, if so how?

# 1.2.3.4 would be the DNS proxy IP
iptables -t nat -A PREROUTING -i br0 -s ROKU -p tcp --dport 53 -j DNAT --to 1.2.3.4
iptables -t nat -A PREROUTING -i br0 -s ROKU -p udp --dport 53 -j DNAT --to 1.2.3.4

Thanks
 
User avatar
urbinek
Frequent Visitor
Frequent Visitor
Posts: 87
Joined: Mon Oct 25, 2010 4:11 pm

Re: IPTABLES in RouterOs

Mon Jan 22, 2018 12:00 pm

yup, but examples are easly findable in google ;)
/ip firewall nat
add action=dst-nat chain=dstnat disabled=no dst-port=53 in-interface=bridge1 protocol=udp src-address=192.168.88.0/24 to-addresses=1.2.3.4
 
BassTeQ
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Fri Jan 19, 2018 5:52 am

Re: IPTABLES in RouterOs

Tue Jan 23, 2018 12:06 am

Thanks for confirming, will place an order for a Routerboard :)
 
BassTeQ
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Fri Jan 19, 2018 5:52 am

Re: IPTABLES in RouterOs

Wed Jan 24, 2018 5:05 am

Sorry forgot to ask, can this rule also be applied to all devices on a VLAN, rather then setting it at a device level?

Thanks
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1782
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: IPTABLES in RouterOs

Wed Jan 24, 2018 4:09 pm

Vlan is considered a virtual interface in routeros, and supports/provides "same functionality" as physical interface.
 
BassTeQ
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Fri Jan 19, 2018 5:52 am

Re: IPTABLES in RouterOs

Wed Jan 24, 2018 11:30 pm

Thanks!

Who is online

Users browsing this forum: 4l4R1, bonamin, Chupaka, coolalexg and 126 guests