Home / Mikrotik / [02] Konfigurasi Mikrotik Sebagai Router DHCP Via CLI

[02] Konfigurasi Mikrotik Sebagai Router DHCP Via CLI

Cara Setting Mikrotik Sebagai Router DHCP

 

Ex :      IP internet 192.168.200.1/24

IP LAN 192.168.10.1/28

 

Setting nama router

[admin@Mikrotik] system identity set name=BBEC      → Enter

 

Setting Interface

[admin@BBEC] interface print      → Enter

[admin@BBEC] interface set ether1 name=WAN_eth1      → Enter

[admin@BBEC] interface set ether2 name=LAN_eth2      → Enter

[admin@BBEC] interface print      → Enter

 

Setting IP

[admin@BBEC] ip address add address=192.168.200.2/24 interface=WAN_eth1      → Enter

[admin@BBEC] ip address add address=192.168.10.1/28 interface=LAN_eth2      → Enter

[admin@BBEC] ip address print      → Enter

 

Setting DNS

[admin@BBEC] ip dns set server=1.1.1.1,8.8.8.8 allow-remote-request=yes      → Enter

[admin@BBEC] ip dns print      → Enter

 

Setting Gateway

[admin@BBEC] ip route add gateway=192.168.200.1      → Enter

[admin@BBEC] ip route print      → Enter

 

Test Koneksi

[admin@BBEC] ping 1.1.1.1      → Enter

 

Setting Firewall NAT

[admin@BBEC] ip firewall nat add chain=srcnat action=masquerade out-interface=WAN_eth1      → Enter

[admin@BBEC] ip firewall nat print      → Enter

 

Setting DHCP Server

[admin@BBEC] ip dhcp-server setup      → Enter

Select interface to run DHCP server on

dhcp server interface: LAN_eth2      → Enter

Select network for DHCP addresses

Dhcp address space : 192.168.10.0/28      → Enter

Select gateway for given network

gateway for dhcp network : 192.168.10.1      → Enter

Select pool of ip address given out by DHCP server

Addresses to give out : 192.168.10.2-192.168.10.14      → Enter

Select DNS servers

dns servers : 1.1.1.1,8.8.8.8      → Enter

Select lease time

lease time : 10m      → Enter

 

Pengujian

Coba colokkan kabel straight ke router ether2 dan ke laptop/komputer, lalu seting ip obtained address automatically.

About haikars

Check Also

[01] Konfigurasi Dasar Mikrotik Router via CLI

Cara Setting Mikrotik Dasar Via CLI   Ex :      IP internet 192.168.200.1/24 IP LAN …

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *