IPv4 Addressing on RouterOS: A Beginner Guide
Before a MikroTik router can do anything useful, its interfaces need IP addresses. This lesson covers everything you need to know about assigning and managing IP addresses in RouterOS.
Quick Review: IP Addresses and Subnets
An IPv4 address is written as four groups of digits separated by dots — for example, 192.168.1.100. Every device on a network needs a unique IP address to communicate.
A subnet mask tells you which part of the address identifies the network. The modern way to write this is CIDR notation — for example, /24 means the first 24 bits are the network part.
Common subnets:
| CIDR | Subnet Mask | Usable Hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /16 | 255.255.0.0 | 65534 |
| /30 | 255.255.255.252 | 2 (point-to-point links) |
Viewing Existing IP Addresses
/ip address printExample output:
Flags: X - disabled, I - invalid, D - dynamic
# ADDRESS NETWORK INTERFACE
0 192.168.88.1/24 192.168.88.0 bridge
1 D 10.0.0.2/30 10.0.0.0 ether1Dmeans dynamic (assigned by DHCP client)Xmeans disabled
For more detail:
/ip address print detailViewing Interface Names
Before assigning an IP, check your interface names:
/interface printOutput example:
# NAME TYPE ACTUAL-MTU
0 R ether1 ether 1500
1 R ether2 ether 1500
2 R wlan1 wlan 1500
3 R bridge bridge 1500Adding an IP Address
Basic syntax:
/ip address add address=<IP/PREFIX> interface=<INTERFACE-NAME>Add WAN address (static from ISP)
/ip address add address=203.0.113.10/30 interface=ether1Add LAN address
/ip address add address=192.168.1.1/24 interface=ether2Add multiple addresses to one interface
One interface can have multiple IPs:
/ip address add address=192.168.10.1/24 interface=ether2
/ip address add address=172.16.0.1/24 interface=ether2Modifying an Existing IP Address
Find the entry number with print, then use set:
/ip address print
/ip address set 0 address=192.168.1.1/24Or use the find function:
/ip address set [find interface=ether2] address=192.168.20.1/24Removing an IP Address
# Remove by number
/ip address remove 0
# Remove a specific address
/ip address remove [find address=192.168.88.1/24]Disabling and Enabling an IP Address
/ip address disable 0
/ip address enable 0A disabled address shows with the X flag in print output.
Practical Example: Two-Interface Setup
ether1 connected to ISP, ether2 connected to LAN:
# Static WAN address
/ip address add address=203.0.113.10/30 interface=ether1
# LAN address
/ip address add address=192.168.1.1/24 interface=ether2DHCP Client — Dynamic WAN IP from ISP
If your ISP assigns your WAN IP via DHCP:
/ip dhcp-client add interface=ether1 disabled=noCheck the result:
/ip dhcp-client printConnected Routes Are Created Automatically
When you add an IP address, RouterOS automatically adds a connected route to the routing table. Verify:
/ip route printYou will see a route like 192.168.1.0/24 via ether2 marked with type C (connected).
Common Mistakes to Avoid
Wrong Subnet Mask
Use /30 for router-to-router links (gives exactly 2 usable hosts). Using /24 wastes 252 addresses.
Duplicate IP Addresses
Two devices with the same IP on the same subnet causes network chaos. Always check existing addresses before adding new ones.
Assigning to Wrong Interface
On most MikroTik devices, ether1 is the WAN port and ether2–ether5 are LAN ports. Double-check before assigning.
Forgetting to Remove Old Address
Before changing an interface address, remove the old one first to avoid having two addresses on the same interface causing routing confusion.
Summary
IP addressing in RouterOS is straightforward:
print— see current addressesadd address=X.X.X.X/prefix interface=NAME— add new addressset NUMBER address=X.X.X.X/prefix— modify existingremove NUMBER— delete- Connected routes are created automatically
