we recently bought CCR1016-12G for our office and now we need to find a way to configure it. Unfortunately, we do not have any experience with MikroTik. But we do understand network fundamentals. Currently, we mainly have Cisco / HP equipment that we are currently looking to replace with MikroTik (for obvious reasons). The configuration logic is quite similar (of course), but not quite the same (again: of course)... And this is what we really need help with.
Let me explain our network setup quickly. We have LAN, DMZ and WAN segments. This particular MikroTik router will stand between WAN and DMZ. We have couple of servers (living inside LAN and DMZ) that we want to publish to WAN. By publish I mean: specific ports / protocols from WAN. And traffic initiated from those servers needs to go to WAN regardless of protocol used. We also want to enable Internet surfing for employees in the office. They will go to the Internet using RRAS server (that stands between LAN and DMZ; it's basically yet another NAT) and that server will forward everything to MikroTik and finally on the WAN. ISP gave us couple of fixed IP addresses we want to use when publishing our LAN / DMZ servers on the Internet. Since ISP router is configured to route all data over just 1 port, all those public IPs will have to be on single MikroTik port as well. If I understand correctly, that definitely should not be a problem. I think that's it. Let me know if you need any additional info regarding setup.
To sum it up: what we have is some quite basic firewall + NAT configuration (static routes, fixed public IPs, fixed LAN / DMZ IPs). Pretty straightforward, right?
OK, so this is the basic configuration we though would work...
...but it seems we got it wrong.# apr/27/2016 15:10:53 by RouterOS 6.30.4
#
/interface ethernet
set [ find default-name=ether1 ] comment=WAN name="ether1 (ISP1)"
set [ find default-name=ether2 ] name="ether2 (NA)"
set [ find default-name=ether3 ] name="ether3 (SERVER1)"
set [ find default-name=ether4 ] name="ether4 (SERVER2)"
set [ find default-name=ether5 ] name="ether5 (RRAS)"
set [ find default-name=ether10 ] name="ether10 (SERVER4)"
set [ find default-name=ether12 ] name="ether12 (CONFIG)"
/ip firewall connection tracking
set enabled=yes
/ip address
add address=A.B.C.30/29 comment=WAN_Default interface="ether1 (ISP1)" network=A.B.C.28
add address=A.B.C.31/29 comment=WAN_SERVER4 interface="ether1 (ISP1)" network=A.B.C.28
add address=A.B.C.32/29 comment=WAN_SERVER1 interface="ether1 (ISP1)" network=A.B.C.28
add address=A.B.C.33/29 comment=WAN_RRAS interface="ether1 (ISP1)" network=A.B.C.28
add address=A.B.C.34/29 comment=WAN_SERVER2 interface="ether1 (ISP1)" network=A.B.C.28
add address=X.Y.3.1/24 comment=DMZ_SERVER2 interface="ether4 (SERVER2)" network=X.Y.3.0
add address=X.Y.1.9/24 comment=DMZ_SERVER1 interface="ether3 (SERVER1)" network=X.Y.1.0
add address=X.Y.0.9/24 comment=DMZ_SERVER4 interface="ether10 (SERVER4)" network=X.Y.0.0
add address=X.Y.0.144/24 comment=DMZ_Config interface="ether12 (CONFIG)" network=X.Y.0.0
add address=X.Y.1.1/24 comment=DMZ_RRAS interface="ether5 (RRAS)" network=X.Y.1.0
add address=X.Y.0.44/24 comment=DMZ_NA disabled=yes interface="ether2 (NA)" network=X.Y.0.0
/ip dns
set servers=8.8.8.8,8.8.4.4
/ip firewall filter
add chain=input comment=SERVER1 dst-address=A.B.C.32 dst-port=20 in-interface="ether1 (ISP1)" protocol=tcp
add chain=input dst-address=A.B.C.32 dst-port=21 in-interface="ether1 (ISP1)" protocol=tcp
add chain=input dst-address=A.B.C.32 dst-port=22 in-interface="ether1 (ISP1)" protocol=tcp
add chain=input dst-address=A.B.C.32 dst-port=25 in-interface="ether1 (ISP1)" protocol=tcp
add chain=input dst-address=A.B.C.32 dst-port=80 in-interface="ether1 (ISP1)" protocol=tcp
add action=drop chain=input dst-address=A.B.C.32 in-interface="ether1 (ISP1)"
add chain=input comment=SERVER4 dst-address=A.B.C.31 dst-port=1234 in-interface="ether1 (ISP1)" protocol=udp src-address=M.N.O.P
add chain=input dst-address=A.B.C.31 dst-port=5678 in-interface="ether1 (ISP1)" protocol=udp src-address=R.S.T.U
add action=drop chain=input dst-address=A.B.C.31 in-interface="ether1 (ISP1)"
add chain=input comment=SERVER2 dst-address=A.B.C.34 dst-port=25 in-interface="ether1 (ISP1)" protocol=tcp
add chain=input dst-address=A.B.C.34 dst-port=25 in-interface="ether1 (ISP1)" protocol=udp
add chain=input dst-address=A.B.C.34 dst-port=80 in-interface="ether1 (ISP1)" protocol=tcp
add action=drop chain=input dst-address=A.B.C.34 in-interface="ether1 (ISP1)"
add chain=forward comment="LAST RULES" in-interface="!ether1 (ISP1)"
add chain=input comment="Allow Established Connections" connection-state=established
add chain=input comment="Allow Related Connections" connection-state=related
add chain=icmp comment="Allow ICMP" icmp-options=0:0 in-interface="!ether1 (ISP1)" protocol=icmp
add chain=icmp icmp-options=8:0 in-interface="!ether1 (ISP1)" protocol=icmp
add chain=forward in-interface="!ether1 (ISP1)" protocol=icmp
add chain=input in-interface="!ether1 (ISP1)" protocol=icmp
add chain=input comment="LAST RULE - ACCEPT ALL FROM DMZ" in-interface="!ether1 (ISP1)"
add chain=output out-interface="!ether1 (ISP1)"
add action=drop chain=input comment="LAST RULE - DROP EVERYTHING"
/ip firewall nat
add action=src-nat chain=srcnat comment=SERVER1 dst-address=0.0.0.0/0 out-interface="ether1 (ISP1)" src-address=X.Y.1.2 to-addresses=A.B.C.32
add action=dst-nat chain=dstnat dst-address=A.B.C.32 in-interface="ether1 (ISP1)" to-addresses=X.Y.1.2
add action=src-nat chain=srcnat comment=SERVER2 dst-address=0.0.0.0/0 out-interface="ether1 (ISP1)" src-address=X.Y.3.2 to-addresses=A.B.C.34
add action=dst-nat chain=dstnat dst-address=A.B.C.34 in-interface="ether1 (ISP1)" to-addresses=X.Y.3.2
add action=src-nat chain=srcnat comment=RRAS dst-address=0.0.0.0/0 out-interface="ether1 (ISP1)" src-address=X.Y.1.3 to-addresses=A.B.C.33
add action=dst-nat chain=dstnat dst-address=A.B.C.33 in-interface="ether1 (ISP1)" to-addresses=X.Y.1.3
add action=src-nat chain=srcnat comment=SERVER4 dst-address=0.0.0.0/0 out-interface="ether1 (ISP1)" src-address=X.Y.0.11 to-addresses=A.B.C.31
add action=dst-nat chain=dstnat dst-address=A.B.C.31 in-interface="ether1 (ISP1)" to-addresses=X.Y.0.11
/ip route
add distance=1 gateway=A.B.C.29
We cannot get traffic from LAN / DMZ servers to WAN / nor vice versa. Packets / Bytes counters just stand still. And regarding employees surfing over RRAS and MikroTik - do we need some different setup for that?
Bottom line: we are obviously missing some crucial MikroTik-logic-step here. Any ideas where to look? What to check? (P.S. We also have no idea how to efficiently debug MikroTik to check where exactly do packets sink into the void. Any side-help on that topic would be nice.)
Thank you in advance.