Will this configuration work, please advice? I know this not how we should configure routers, I’m planing to make configuration proper, but I just can’t do it for now. There are to many objective reasons.
At one of my customers I’ll replace Cisco with Mikrotik and Cisco is configured this way - export of Mikrotik conf is bellow. I hate to do it this way but I have no other option for now. As I said: in future I’ll correct configuration.
Weirdness is in that I have uplink and LAN on same interface - ether1. Ethernet1 is connected to WAN switch and WAN switch is connected to LAN switch. On eth1 there is also local subnet and dhcp server and some vlans and respective ip configuration. I’m a bit worried how will work srcnat and dstnat. And I have also have to make two ipsec tunnels on this router. Will standard ipsec configuration work on this mess?
/interface ethernet
set [ find default-name=ether1 ] comment=Uplink
/interface vlan
add interface=ether1 name=vlan56 vlan-id=56
add interface=ether1 name=vlan57 vlan-id=57
add interface=ether1 name=vlan100 vlan-id=100
/ip pool
add name=dhcp_pool0 ranges=192.168.53.100-192.168.53.254
add name=dhcp_pool1 ranges=192.168.56.100-192.168.56.254
add name=dhcp_pool2 ranges=10.3.37.100-10.3.37.249,10.3.37.251-10.3.37.254
/ip dhcp-server
add address-pool=dhcp_pool0 disabled=no interface=ether1 name=dhcp1
add address-pool=dhcp_pool1 disabled=no interface=vlan56 name=dhcp2
add address-pool=dhcp_pool2 disabled=no interface=vlan57 name=dhcp3
/ip firewall connection tracking
set enabled=yes
/ip address
add address=WANpublicIP-X interface=ether1 network=X.X.X.X
add address=192.168.53.1/24 interface=ether1 network=192.168.53.0
add address=192.168.56.1/24 interface=vlan56 network=192.168.56.0
add address=192.168.100.1/24 interface=vlan100 network=192.168.100.0
add address=10.3.37.250/24 interface=vlan57 network=10.3.37.0
/ip dhcp-server network
add address=10.3.37.0/24 dns-server=z.z.z.z gateway=10.3.37.250
add address=192.168.53.0/24 dns-server=z.z.z.z gateway=192.168.53.1
add address=192.168.56.0/24 dns-server=z.z.z.z gateway=192.168.56.1
/ip firewall address-list
add address=192.168.53.0/24 list=LocalSubnets
add address=10.3.37.0/24 list=LocalSubnets
add address=192.168.56.0/24 list=LocalSubnets
/ip firewall filter
add action=accept chain=forward connection-state=established
add action=accept chain=forward connection-state=related
add action=accept chain=input connection-state=established
add action=accept chain=input connection-state=related
add action=add-src-to-address-list address-list=knockers address-list-timeout=30s chain=input dst-address=WANpublicIP-X dst-port=zzzz in-interface=ether1 protocol=tcp
add action=accept chain=input dst-port=8291 in-interface=ether1 protocol=tcp src-address-list=knockers
add action=drop chain=input dst-address=WANpublicIP-X dst-port=8291 in-interface=ether1 protocol=tcp
/ip firewall nat
add action=src-nat chain=srcnat dst-address-list=!LocalSubnets src-address=192.168.53.0/24 to-addresses=WANpublicIP-X
add action=src-nat chain=srcnat dst-address-list=!LocalSubnets src-address=192.168.56.0/24 to-addresses=WANpublicIP-X
add action=src-nat chain=srcnat dst-address-list=!LocalSubnets src-address=192.168.100.0/24 to-addresses=WANpublicIP-X
add action=src-nat chain=srcnat dst-address-list=!LocalSubnets src-address=10.3.37.0/24 to-addresses=WANpublicIP-X
add action=dst-nat chain=dstnat dst-address=WANpublicIP-X dst-port=zz protocol=tcp to-addresses=192.168.53.44 to-ports=zz
/ip route
add distance=1 gateway=PublicIP-Y