This is the fast-path version of Complete MikroTik RouterOS 7 Initial Configuration Using WinBox — use that lesson if you want the full explanation behind each step.
Required Information
Before you start, gather the following:
- WAN Scenario: Static, DHCP, or PPPoE (Check your ISP documentation).
- Intended LAN Subnet: e.g.,
192.168.88.0/24. - Strong Administrator Password: Ready to be applied.
Interactive Configuration Generator
Use this tool to instantly generate the exact RouterOS script for your environment. Copy the output and paste it into your MikroTik terminal.
Network Parameters
Generated RouterOS CLI
1. Initial Access & Security
Why: By default, a factory reset MikroTik router has an open admin account. We must secure this and set an identity.
# Connect via MAC address in WinBox or terminal, then set identity and password
/system identity set name="Core-Router"
/user set admin password="YourStrongPasswordHere"
- Open WinBox and connect via MAC Address (Login:
admin, Password:[blank]). - Go to System → Identity and enter
Core-Router. Click OK. - Go to System → Users, double-click
admin, click Password, and set your strong password.
2. LAN Bridge & IP Addressing
Why: RouterOS requires a software “Bridge” to group physical ports together so they act as a single switch.
# Create the bridge and add ports ether2-ether5
/interface bridge add name=bridge-LAN
/interface bridge port
add bridge=bridge-LAN interface=ether2
add bridge=bridge-LAN interface=ether3
add bridge=bridge-LAN interface=ether4
add bridge=bridge-LAN interface=ether5
# Assign the LAN subnet gateway IP to the bridge
/ip address add address=192.168.88.1/24 interface=bridge-LAN
- Go to Bridge → Bridge tab. Click [+], name it
bridge-LAN, click OK. - Go to Bridge → Ports tab. Click [+] and add
ether2tobridge-LAN. Repeat forether3,ether4, andether5. - Go to IP → Addresses. Click [+], set Address to
192.168.88.1/24, Interface tobridge-LAN. Click OK.
3. DHCP Server for LAN
Why: Clients need IP addresses automatically assigned to them when they connect.
# Define the pool of addresses to hand out
/ip pool add name=dhcp-pool ranges=192.168.88.10-192.168.88.250
# Create the DHCP server on the bridge
/ip dhcp-server add address-pool=dhcp-pool interface=bridge-LAN name=dhcp1 disabled=no
# Provide clients with a gateway and DNS servers
/ip dhcp-server network add address=192.168.88.0/24 dns-server=8.8.8.8,1.1.1.1 gateway=192.168.88.1
- Go to IP → DHCP Server → DHCP Setup button.
- Select
bridge-LAN. Click Next until finished (accept default ranges and add8.8.8.8as DNS).
4. WAN Configuration (Internet Access)
Why: The router needs an IP address from your ISP on the WAN port (ether1).
# Assuming dynamic IP (DHCP) from the ISP
/ip dhcp-client add interface=ether1 disabled=no
- Go to IP → DHCP Client.
- Click [+]. Select
ether1as the interface. Check “Use Peer DNS” and “Use Peer NTP”. Click OK.
5. NAT (Network Address Translation)
Why: Private LAN IPs (192.168.x.x) cannot route over the public internet. NAT translates them behind the router’s public IP.
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
- Go to IP → Firewall → NAT tab.
- Click [+]. In General, set Chain to
srcnatand Out. Interface toether1. - In Action, set Action to
masquerade. Click OK.
6. Basic Firewall
Why: A factory default router has no firewall. We must protect it from the outside.
# Allow established/related connections
/ip firewall filter add chain=input connection-state=established,related action=accept
/ip firewall filter add chain=forward connection-state=established,related action=accept
# Drop invalid packets
/ip firewall filter add chain=input connection-state=invalid action=drop
/ip firewall filter add chain=forward connection-state=invalid action=drop
# Drop all other incoming traffic from the WAN (assuming ether1)
/ip firewall filter add chain=input in-interface=ether1 action=drop
- Go to IP → Firewall → Filter Rules tab.
- Click [+]. Chain:
input, Connection State:establishedandrelated. Action:accept. - Click [+]. Chain:
forward, Connection State:establishedandrelated. Action:accept. - Click [+]. Chain:
input, Connection State:invalid. Action:drop. - Click [+]. Chain:
forward, Connection State:invalid. Action:drop. - Click [+]. Chain:
input, In. Interface:ether1. Action:drop.
Verification
- Check LAN IP: Ensure your computer gets a
192.168.88.xIP address. - Ping Gateway:
ping 192.168.88.1 - Ping Internet:
ping 8.8.8.8(Tests NAT and routing). - Resolve DNS:
ping google.com(Tests DNS).
Common Failures
- No DHCP lease: Verify your computer is plugged into a port assigned to
bridge-LAN(e.g. ether2). - No Internet despite lease: Verify your default route (
/ip route print) and ensure the NAT rule uses the correctout-interface. - Management locked out: If you applied a firewall rule dropping input on the bridge instead of the WAN interface, you will block yourself.
Production Notes
- Backup: Run
/export file=clean-initial-configand download the.rscfile. - Safe Mode: Always use Safe Mode in WinBox (the button at the top left) before altering firewalls or bridges.
- Security: This is a basic firewall. For production, consider securing the management interface to specific management IPs.