29/01/2025
MIKROTIK SESSION 3-Configuring MikroTik for Dynamic IP (PPPoE/DHCP) via Command Mode
Requirements:
ISP provides a dynamic shared IP (using PPPoE or DHCP), your MikroTik router needs to be configured to obtain this IP automatically, rather than setting a static IP. Below is the configuration process for both PPPoE and DHCP setup.
Step 1- PPPoE Configuration (if ISP provides dynamic IP via PPPoE)-
/interface pppoe-client add name=pppoe-out1 interface=ether1 user="236403" password="063575" use-peer-dns=yes add-default-route=yes
Verify the PPPoE Connection-
/interface pppoe-client print
Step 2- DHCP Configuration (if ISP provides dynamic IP via DHCP)-
/ip dhcp-client add interface=ether1 disabled=no
Step 3- Verify DHCP Lease-
/ip dhcp-client print
Step 4- Assign IP to LAN Interface (Ether2)-
/ip address add address=192.168.1.1/24 interface=ether2
Step 5- Set Up DHCP Server for LAN-
/ip pool add name=dhcp pool ranges=192.168.1.2-192.168.1.254
/ip dhcp-server add name=dhcp1 interface=ether2 address-pool=dhcp pool disabled=no
/ip dhcp-server network add address=192.168.1.0/24 gateway=192.168.1.1 dns-server=8.8.8.8,8.8.4.4
Step 6- Configuration NAT for PPPoE-
/ip firewall nat add chain=srcnat out-interface=pppoe-out1 action=masquerade
Step 7- Configuration NAT for DHCP-
/ip firewall nat add chain=srcnat out-interface=ether1 action=masquerade
Step 8- Configuration DNS-
/ip dns set servers=8.8.8.8,8.8.4.4
Step 9- Configure Wireless-
/interface wireless set wlan1 mode=ap-bridge ssid="WIFI MIK" disabled=no
/interface wireless security-profiles add name=wifi-sec profile-type=wpa2-psk authentication-types=wpa2-psk wpa2-pre-shared-key="passwordditamna"
/interface wireless set wlan1 security-profile=wifi-sec
Step 10- Verify the Connection-
verify WAN IP-
/ip address print
verify Default Route-
/ip route print
check internet connectivity-
/ping 8.8.8.8
MikroTik Link3 Technologies