IP Addressing
IP Addressing
Section titled “IP Addressing”Overview
Section titled “Overview”IP Addressing is a fundamental networking concept that provides logical addressing for devices on an IP network. RouterOS provides comprehensive support for both IPv4 and IPv6 addressing, allowing you to configure addresses on interfaces, manage address pools, and control address assignment through DHCP.
This documentation covers the /ip address menu for IPv4 configuration and IPv6 address management, explaining address types, subnetting concepts, and practical RouterOS configurations.
IPv4 Addressing
Section titled “IPv4 Addressing”IPv4 addresses are 32-bit addresses written in dotted-decimal notation (e.g., 192.168.88.1). Each address consists of a network portion and a host portion, determined by the subnet mask.
Address Structure
Section titled “Address Structure”An IPv4 address is represented as four octets (0-255) separated by dots:
192.168.88.1The subnet mask determines how many bits represent the network portion:
| CIDR Notation | Subnet Mask | Usable Hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /29 | 255.255.255.248 | 6 |
| /30 | 255.255.255.252 | 2 |
| /32 | 255.255.255.255 | 1 (point-to-point) |
Private Address Ranges
Section titled “Private Address Ranges”RFC 1918 reserves specific address ranges for private networks. These addresses are not routable on the internet and are commonly used for internal networks:
| Address Range | CIDR | Start | End |
|---|---|---|---|
| 10.0.0.0/8 | 10.x.x.x | 10.0.0.0 | 10.255.255.255 |
| 172.16.0.0/12 | 172.16.x.x - 172.31.x.x | 172.16.0.0 | 172.31.255.255 |
| 192.168.0.0/16 | 192.168.x.x | 192.168.0.0 | 192.168.255.255 |
Other Reserved Address Ranges
Section titled “Other Reserved Address Ranges”| Range | Description |
|---|---|
| 0.0.0.0/8 | This network (RFC 1122) |
| 127.0.0.0/8 | Loopback addresses |
| 169.254.0.0/16 | Link-local (APIPA) |
| 224.0.0.0/4 | Multicast (Class D) |
| 240.0.0.0/4 | Reserved (Class E) |
| 255.255.255.255/32 | Limited broadcast |
Adding IP Addresses
Section titled “Adding IP Addresses”Basic Configuration
Section titled “Basic Configuration”Add an IP address to an interface using the /ip address menu:
/ip address add address=192.168.88.1/24 interface=ether1This assigns the address 192.168.88.1 with a /24 subnet mask (255.255.255.0) to ether1.
Viewing Address Configuration
Section titled “Viewing Address Configuration”/ip address printOutput:
Flags: X - disabled, I - invalid, D - dynamic, G - global, P - pending # ADDRESS NETWORK INTERFACE DHCPSERVER 0 G 192.168.88.1/24 192.168.88.0 ether1The output shows:
- ADDRESS: The IP address with CIDR prefix
- NETWORK: The network address (first address in subnet)
- INTERFACE: The interface the address is assigned to
- DHCPSERVER: If DHCP server is running on this address
Properties
Section titled “Properties”| Property | Description |
|---|---|
address | IP address with CIDR notation (e.g., 192.168.88.1/24) |
netmask | Subnet mask in dotted decimal (alternative to CIDR) |
network | Network address (auto-calculated or explicitly set) |
interface | Interface to assign the address to |
disabled | Whether the address is disabled |
actual-interface | Shows the actual interface (for bridges, VLANs) |
dhcp-server | DHCP server that provides addresses from this pool |
dynamic | Whether the address was assigned dynamically |
publish | Whether to publish this address in routing protocols |
Example Configurations
Section titled “Example Configurations”Multiple Addresses on Single Interface
Section titled “Multiple Addresses on Single Interface”Add multiple addresses to a single interface:
/ip address add address=192.168.88.1/24 interface=ether1/ip address add address=10.0.0.1/24 interface=ether1Point-to-Point Links
Section titled “Point-to-Point Links”For point-to-point links, use /32 addresses:
/ip address add address=10.0.0.1/32 network=10.0.0.2 interface=ether1/ip address add address=10.0.0.2/32 network=10.0.0.1 interface=ether2Bridge Interface Addressing
Section titled “Bridge Interface Addressing”Assign an IP address to a bridge:
/ip address add address=192.168.1.1/24 interface=bridge1Read-only Properties
Section titled “Read-only Properties”These properties are automatically calculated and cannot be modified:
| Property | Description |
|---|---|
dynamic | Address was assigned via DHCP or other dynamic method |
invalid | Address configuration is invalid |
actual-interface | The actual underlying interface |
IPv6 Addressing
Section titled “IPv6 Addressing”IPv6 addresses are 128-bit addresses typically written in hexadecimal notation with colons. RouterOS supports full IPv6 address configuration including link-local, unique local, and global unicast addresses.
Address Types
Section titled “Address Types”Link-local Addresses
Section titled “Link-local Addresses”Link-local addresses (fe80::/10) are automatically generated on all interfaces and are used for local communication only:
/ipv6 address add address=fe80::1/64 interface=ether1RouterOS automatically generates link-local addresses when an interface is enabled. You can verify:
/ipv6 address printUnique Local Addresses
Section titled “Unique Local Addresses”Unique local addresses (ULA, fc00::/7) are similar to IPv4 private addresses:
/ipv6 address add address=fd00::1/64 interface=ether1 advertise=noGlobal Unicast Addresses
Section titled “Global Unicast Addresses”Global unicast addresses are publicly routable addresses assigned by an ISP or through other delegation methods:
/ipv6 address add address=2001:db8::1/64 interface=ether1Address Configuration Example
Section titled “Address Configuration Example”/ipv6 address add address=2001:db8:cafe::1/64 interface=bridge1 advertise=yesThe advertise=yes parameter enables router advertisement for prefix delegation.
Viewing IPv6 Addresses
Section titled “Viewing IPv6 Addresses”/ipv6 address printOutput:
Flags: D - dynamic, P - pending, G - global, L - link-local # ADDRESS INTERFACE ADV 0 G 2001:db8:cafe::1/64 bridge1 yes 1 L fe80::215:5dff:fea0:1/64 ether1 noDHCP Address Pools
Section titled “DHCP Address Pools”RouterOS can manage address pools for DHCP server assignments or manual allocation.
Creating an Address Pool
Section titled “Creating an Address Pool”/ip pool add name=LAN-Pool ranges=192.168.88.100-192.168.88.200This creates a pool named LAN-Pool with 101 addresses available for DHCP assignment.
Viewing Pools
Section titled “Viewing Pools”/ip pool printOutput:
# NAME Ranges 0 LAN-Pool 192.168.88.100-192.168.88.200IPv6 Pools
Section titled “IPv6 Pools”/ipv6 pool add name=LAN-Pool-v6 prefix=2001:db8:cafe::/64 prefix-length=64Practical Examples
Section titled “Practical Examples”Basic LAN Configuration
Section titled “Basic LAN Configuration”Configure a router as a LAN gateway:
/ip address add address=192.168.88.1/24 interface=ether1/ip address add address=203.0.113.1/30 interface=ether2This configures:
ether1: LAN interface with 192.168.88.0/24 networkether2: WAN interface with point-to-point link
Secondary Address
Section titled “Secondary Address”Add a secondary network to the same interface:
/ip address add address=10.0.0.1/24 interface=ether1/ip address add address=172.16.0.1/24 interface=ether1The interface now responds to both networks.
VLAN Addressing
Section titled “VLAN Addressing”Assign addresses to VLAN interfaces:
/interface vlan add name=VLAN10 vlan-id=10 interface=bridge1/ip address add address=192.168.10.1/24 interface=VLAN10Loopback Address
Section titled “Loopback Address”For router redundancy or OSPF, use loopback addresses:
/interface loopback add name=loopback/ip address add address=10.255.255.1/32 interface=loopbackIPv6 Prefix Delegation
Section titled “IPv6 Prefix Delegation”Configure IPv6 with prefix delegation from an upstream router:
/ipv6 dhcp-client add interface=ether1 pool-name=ipv6-pool add-prefix-length=64 request=prefix/ipv6 pool add name=ipv6-pool prefix=2001:db8:cafe::/48 prefix-length=64Troubleshooting
Section titled “Troubleshooting”Address Not Appearing
Section titled “Address Not Appearing”If an address doesn’t appear after configuration:
-
Verify the interface exists and is running:
/interface print -
Check for address conflicts:
/ip address print -
Verify interface is not disabled:
/interface ethernet set ether1 disabled=no
Cannot Ping Address
Section titled “Cannot Ping Address”-
Verify the address is assigned:
/ip address print -
Check ARP table:
/ip arp print -
Verify firewall is not blocking:
/ip firewall filter print
IPv6 Address Not Working
Section titled “IPv6 Address Not Working”-
Verify IPv6 is enabled:
/ipv6 settings print -
Check for duplicate addresses:
/ipv6 address print -
Verify router advertisement settings:
/ipv6 nd print
Common Configuration Mistakes
Section titled “Common Configuration Mistakes”Using /32 on a regular interface: Using /32 prevents the router from determining the network, causing routing issues:
# Wrong/ip address add address=192.168.88.1/32 interface=ether1
# Correct/ip address add address=192.168.88.1/24 interface=ether1Network address as host address: The first address in a subnet is the network address and cannot be assigned to hosts:
# Wrong - 192.168.88.0 is the network address/ip address add address=192.168.88.0/24 interface=ether1
# Correct/ip address add address=192.168.88.1/24 interface=ether1Broadcast address as host address: The last address in a subnet is the broadcast address:
# Wrong - 192.168.88.255 is the broadcast address/ip address add address=192.168.88.255/24 interface=ether1
# Correct - use 192.168.88.254 for last usable/ip address add address=192.168.88.254/24 interface=ether1Related Features
Section titled “Related Features”- DHCP Server - Automatically assign addresses to clients:
/ip dhcp-server - DHCP Client - Obtain address from upstream:
/ip dhcp-client - IP Settings - Configure system-wide IP parameters:
/ip settings - ARP - Address resolution:
/ip arp - IPv6 ND - Neighbor discovery:
/ipv6 nd - Routing - Route management:
/ip route
References
Section titled “References”- RFC 791 - Internet Protocol
- RFC 826 - Address Resolution Protocol (ARP)
- RFC 1918 - Address Allocation for Private Internets
- RFC 4193 - Unique Local IPv6 Unicast Addresses
- RFC 4291 - IPv6 Addressing Architecture