Obtaining Public IP Addresses for Connected Devices on a MikroTik Router
In this article, we will discuss how to obtain public IP addresses for devices connected to a MikroTik router. This can be useful in scenarios where you have multiple devices that need to be accessible from the internet, such as servers, cameras, or other networked devices.
Understanding Public vs Private IP Addresses
Before we dive into the specifics of obtaining public IP addresses for your devices, it's important to understand the difference between public and private IP addresses. A public IP address is a unique address that is assigned to a device by an Internet Service Provider (ISP) and is accessible from the internet. A private IP address, on the other hand, is an address that is used within a private network, such as a home or business network. Private IP addresses are not accessible from the internet and are used to identify devices within the network.
Configuring the MikroTik Router as a Bridge
If you have a MikroTik router connected to a modem, you can configure the router to act as a bridge. This will allow all devices connected to the router to obtain public IP addresses from the ISP. To do this, follow these steps:
Connect to the MikroTik router using Winbox or the web interface.
Go to the IP > Addresses menu and add a new address. Use the public IP address assigned by the ISP as the address and set the netmask to 255.255.255.255.
Go to the IP > Firewall menu and add a new firewall rule. Set the chain to input and the protocol to all. In the source address field, enter the private IP address range of your network (e.g. 192.168.1.0/24). This will allow all devices on your network to access the internet.
Go to the IP > Services menu and disable the DHCP server. This will prevent the router from assigning private IP addresses to devices on your network.
Connect your devices to the router using Ethernet or WiFi. They should now obtain public IP addresses from the ISP.
Configuring DHCP Server to Assign Public IP Addresses
If you have a MikroTik router with a public IP address and you want to assign public IP addresses to devices on your network using DHCP, you can do so by following these steps:
Connect to the MikroTik router using Winbox or the web interface.
Go to the IP > Addresses menu and add a new address. Use the public IP address assigned by the ISP as the address and set the netmask to 255.255.255.255.
Go to the IP > DHCP Server menu and add a new DHCP server. Set the address range to the public IP address range assigned by the ISP. Set the netmask to 255.255.255.255 and the default gateway to the public IP address of the router.
Connect your devices to the router using Ethernet or WiFi. They should now obtain public IP addresses from the DHCP server.
In this article, we discussed how to obtain public IP addresses for devices connected to a MikroTik router. We covered the difference between public and private IP addresses, how to configure the MikroTik router as a bridge, and how to configure the DHCP server to assign public IP addresses. By following the steps outlined in this article, you should be able to provide your devices with public IP addresses and make them accessible from the internet.