fbpx

Can a gateway with dynamic public IP be configured in MikroTik?

Yes, it is possible to configure a gateway on a MikroTik device that uses a dynamic public IP address. This setting is useful when the MikroTik device is connected to an ISP that assigns IP addresses dynamically, as is common with residential or small business connections.

We explain how you can configure a gateway with a dynamic IP in MikroTik using DHCP to obtain the IP address and then configure this address as your default gateway.

Steps to Configure a Gateway with Dynamic IP in MikroTik

  1. DHCP Client Configuration:
    • Make sure your WAN interface (the interface connected to the ISP) is configured to obtain an IP address using DHCP. This can be done from WinBox or via the CLI.
    By CLI:

    /ip dhcp-client add interface=ether1 disabled=no

  2. By WinBox:
    • Go to IP -> DHCP Client, select the corresponding interface (for example, ether1), and make sure it is enabled.
  3. Set the Default Gateway:
    • Generally, when you configure a DHCP client in MikroTik, it automatically configures the default route if the DHCP server provides this information. However, you can check or modify this manually if necessary.
    By CLI:

    /ip route add gateway=<nombre-de-tu-interfaz-dhcp>

    By WinBox:
    • Go to IP -> Routes and make sure there is a route with dst-address=0.0.0.0/0 y gateway configured to your DHCP interface.
  4. Verification and Monitoring:
    • Verify that your MikroTik is correctly receiving the dynamic public IP and that it can use it as a gateway.
    Useful commands to verify:

    /ip dhcp-client print
    /ip address print
    /ip route print
    • These commands will help you verify that the IP address is correctly assigned to the interface, and that a default route exists that uses this IP address.

Additional considerations

  • Security: Make sure your firewall is properly configured to protect your network, especially when you are using a dynamic public IP.
  • DDNS (Dynamic DNS): If you need to access your network from outside on a consistent basis, consider setting up a DDNS service. This will allow you to access your MikroTik device even when the public IP address changes.

Configuring a gateway with a dynamic public IP in MikroTik is a relatively simple process and allows you to make the most of Internet connections with dynamic IPs, maintaining a flexible and adaptable network configuration.

There are no tags for this post.
Did this content help you?
Facebook
Twitter
LinkedIn
WhatsApp
Telegram

Other documents in this category

Leave your comment

Your email address will not be published. Required fields are marked with *

Tutorials available at MikroLABs

No Courses Found!

DISCOUNT CODE

AN24-LIB

applies to MikroTik books and book packs

Days
Hours
Minutes
Seconds

Introduction to
OSPF - BGP - MPLS

Sign up for this Free course

MAE-RAV-ROS-240118
Days
Hours
Minutes
Seconds

Sign up for this Free course

MAS-ROS-240111

Promo for Three Kings Day!

KINGS24

15%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the Three Kings Day discount code!

* promotion valid until Sunday January 7, 2024
** the code (KINGS24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

New Year's Eve Promo!

NY24

20%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the New Year's Eve discount code!

* promotion valid until Monday, January 1, 2024
** the code (NY24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

Christmas discounts!

XMAS23

30%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the discount code for Christmas!!!

**codes are applied in the shopping cart
Promo valid until Monday December 25, 2023

CYBER WEEK DISCOUNTS

CW23-MK

17%

all MikroTik OnLine courses

CW23-AX

30%

all Academy courses

CW23-LIB

25%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Cyber ​​Week!!!

**codes are applied in the shopping cart
Promo valid until Sunday December 3, 2023

BLACK FRIDAY DISCOUNTS

BF23-MX

22%

all MikroTik OnLine courses

BF23-AX

35%

all Academy courses

BF23-LIB

30%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Black Friday!!!

**Codes are applied in the shopping cart

codes are applied in the shopping cart
valid until Sunday November 26, 2023

Days
Hours
Minutes
Seconds

Sign up for this Free course

MAE-VPN-SET-231115

Halloween promo

Take advantage of discount codes for Halloween.

Codes are applied in the shopping cart

HW23-MK

11% discount on all MikroTik OnLine courses

11%

HW23-AX

30% discount on all Academy courses

30%

HW23-LIB

25% discount on all MikroTik Books and Book Packs

25%

Register and participate in the free course Introduction to Advanced Routing with MikroTik (MAE-RAV-ROS)

Today (Wednesday) October 11, 2023
7pm to 11pm (Colombia, Ecuador, Peru)

MAE-RAV-ROS-231011