0% found this document useful (0 votes)
410 views

Mikrotik Router CLI Configuration Guide

The document provides instructions for basic Mikrotik router configuration including enabling DHCP on an interface, adding static IP addresses, viewing routing tables, adding default routes, and configuring NAT for internet access. It also mentions optional configurations like using the router as a DNS server and includes firewall rules to allow necessary traffic while dropping all other connections.

Uploaded by

TaonaRalph
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
410 views

Mikrotik Router CLI Configuration Guide

The document provides instructions for basic Mikrotik router configuration including enabling DHCP on an interface, adding static IP addresses, viewing routing tables, adding default routes, and configuring NAT for internet access. It also mentions optional configurations like using the router as a DNS server and includes firewall rules to allow necessary traffic while dropping all other connections.

Uploaded by

TaonaRalph
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Mikrotik Router CLI Configuration guide

Mandatory Configs

Enable DHCP on an interface


ip dhcp-client add interface=ether1 disabled=no

Verify DHCP information


ip dhcp-client print detail

Add a static IP address to an interface


ip address add address=192.168.88.1/24 interface=ether2

Show routing table


ip route print

Add a static route (Internet Gateway)


ip route add dst-address=0.0.0.0/0 gateway=172.16.213.1

Configuring NAT (Allows internet access)


ip firewall nat add chain=srcnat src-address=192.168.88.0/24 action=masquerade

Optional Configs

Configure Mikrotik Router as DNS server

Firewall Configs

[admin@mikrotik] > ip firewall filter add action=accept chain=input comment="Allow ICMP ping" protocol=icmp

[admin@mikrotik] > ip firewall filter add action=accept chain=input comment="Allow WinBox" dst-port=8291 protocol=tcp

[admin@mikrotik] > ip firewall filter add action=accept chain=input comment="Allow SSH" dst-port=22 protocol=tcp

[admin@mikrotik] > ip firewall filter add action=accept chain=input comment="Accept established connections" connection-state=established

[admin@mikrotik] > ip firewall filter add action=accept chain=input comment="Accept related connections" connection-state=related

[admin@mikrotik] > ip firewall filter add action=accept chain=input comment="Allow DNS for trusted network" dst-port=53 protocol=udp src-address=192.168.88.0/24

[admin@mikrotik] > ip firewall filter add action=drop chain=input comment="Drop everything else"

You might also like