Basic Script to Configure a Blank MikroTik Router

Basic Script to Configure a Blank MikroTik Router

 

I have developed a script you can simply paste into the router and it will configure everything for you and get you started on the right track.

      
/ip address
add address=192.168.1.1/24 disabled=no interface=ether2 
add address=192.168.2.1/24 disabled=no interface=wlan1 
/ip pool
add name=dhcp_pool1 ranges=192.168.1.2-192.168.1.254
add name=dhcp_pool2 ranges=192.168.2.2-192.168.2.254
/ip dhcp-server
add address-pool=dhcp_pool1 \
disabled=no interface=ether2 lease-time=3d name=dhcp1
add address-pool=dhcp_pool2 \
disabled=no interface=wlan1 lease-time=3d name=dhcp2
/ip dhcp-server config
set store-leases-disk=5m
/ip dhcp-server network
add address=192.168.1.0/24 dns-server=4.2.2.2 gateway=192.168.1.1
add address=192.168.2.0/24 dns-server=4.2.2.2 gateway=192.168.2.1
/system ntp client
set enabled=yes primary-ntp=50.19.122.125
/interface wireless
set 0 band=2ghz-b default-authentication=yes disabled=no\
wireless-protocol=802.11 mode=ap-bridge
/ip dhcp-client
add interface=ether1 disabled=no
/ip firewall nat

    
 
 
    • Related Articles

    • How to Log Into a Mikrotik Router

      After you have installed the RouterOS software, or turned on the Router for the first time, there are various ways how to connect to it: Accessing Command Line Interface (CLI) via Telnet, SSH, serial cable or even keyboard and monitor if your router ...
    • Netonix WISP-Switch & Mikrotik Router on a Stick Howto

      In this example we will build a router on a stick. We want to manage the switch from port 8 using inter vlan routing on the router. Here is the physical setup: 1. To configure the switch, set an IP address of 192.168.1.1/24 on your laptop and log ...
    • Cloning MikroTik Routers, Quick and Easy

      If you are wanting to configure multiple MikroTik routers with the same configuration, or to copy a config from one router to another, the best way is to use an export.  The export command dumps all of the configuration commands you added to a router ...
    • Mikrotik Mass Updater

        I converted an old perl backup utility written by Phillip Hutchison that was on the Mikrotik forums to make it a mass update utility for Mikrotik. There are 2 versions (Link is at bottom) version1 - "massupdater.pl" that uses only 1 username and ...
    • Using MikroTik LHG as a UE With a Baicells eNodeB

      If you want to use a MikroTik LHG CPE as a UE with your Baicells eNodeB, this blog post explains how.  Also shown is the tricky nature of inserting the SIM Card in the LHG. LEARN MORE