When you set up a static lease for your device on a MikroTik router, the DHCP server will always assign the same IP address to that device based on its MAC address. This is expected behavior for static leases, which is why you're consistently receiving the same IP address.
If you want to obtain a different IP address instead of the one assigned by the DHCP server, you have several options:
Option 1: Remove the Static Lease
-
Access the MikroTik Router:
- Log in to your MikroTik router using Winbox or through a web interface.
-
Navigate to IP > DHCP Server:
- Look for the “Leases” section under the DHCP server settings.
-
Remove or Disable the Static Lease:
- Find the lease that corresponds to your device (using its MAC address).
- Either delete the lease or change it from "Static" to "Dynamic".
-
Reconnect Your Device:
- After making the changes, reconnect your device or release the IP using one of the previous methods to request a new lease from the DHCP server.
Option 2: Change the MAC Address (Not Recommended)
If you do not want to change the static lease on the router but would like a different IP, one less common option is to change the MAC address of your network interface. This would make the DHCP server think it's a different device and assign a new IP address.
However, this method is usually not recommended due to potential connectivity issues, as it may also affect other network configurations or services.
You can change the MAC address temporarily on Linux by running:
sudo ip link set dev <interface> down
sudo ip link set dev <interface> address <new_mac_address>
sudo ip link set dev <interface> up
Replace <interface> with your network interface name and <new_mac_address> with a new MAC address (make sure it follows proper formatting). After this, you can request a new lease.
Option 3: Configure a DHCP Range on the MikroTik
If you want to keep the static lease but still utilize DHCP, you could set a different range of IP addresses from the DHCP server that does not overlap with the static leases assigned. For example:
- Go into your DHCP server settings on MikroTik.
- Adjust the DHCP range to exclude the IP addresses given as static leases.
Summary
The reason you are getting the same IP address is that your device has a static lease assigned on the DHCP server of your MikroTik router. If you want to change the IP, you either need to remove the static lease or use alternative methods like changing the MAC address (not recommended) or adjusting the DHCP configuration on the MikroTik router.