Basic Configurasi Mikrotik: Perbedaan antara revisi

Dari Catatan Pak Samsul
Loncat ke navigasi Loncat ke pencarian
 
(18 revisi perantara oleh pengguna yang sama tidak ditampilkan)
Baris 23: Baris 23:
<code>/interface ethernet set ether1 name=ether1-internet</code>
<code>/interface ethernet set ether1 name=ether1-internet</code>
====Configurasi IP Address====
====Configurasi IP Address====
Perintah<span> </span>:  
Contoh Perintah<span> </span>:  
  [admin@MikroTik] > ip dhcp-client set ether1 disabled=no use-peer-dns=yes
  [admin@MikroTik] > ip address add address=192.168.1.1/24 interface=ether1
[admin@MikroTik] > ip address add address=192.168.2.1/24 interface=ether2
[admin@MikroTik] > ip address add address=192.168.3.1/24 interface=ether3
[admin@MikroTik] > ip address add address=192.168.4.1/24 interface=ether4
[admin@MikroTik] > ip address add address=192.168.5.1/24 interface=ether5


===='''Configurasi IP Gateway'''====
===='''Configurasi IP Gateway'''====
Baris 48: Baris 44:


<br />
<br />
===LANGKAH-LANGKAH KONFIGURASI ROUTER SEDERHANA===
====Login Default====
====Login Default====
  User = admin
  User = admin
  Password = (default belum ada password)
  Password = (default belum ada password)


======Setup Identity<span> </span>: R1(memberi nama router mikrotik)======
====Setup Identity<span> </span>: R1(memberi nama router mikrotik)====
  [admin@MikroTik] > system identity set name=R1
  [admin@MikroTik] > system identity set name=R1
  [admin@R1] >
  [admin@R1] >


======Cek ethernet mikrotik======
====Cek ethernet mikrotik====
  [admin@R1] > interface print
  [admin@R1] > interface print
  Flags: D - dynamic, X - disabled, R - running, S - slave
  Flags: D - dynamic, X - disabled, R - running, S - slave
Baris 66: Baris 65:
  4  R  ether5                              ether            1500                  08:00:27:A3:44:12
  4  R  ether5                              ether            1500                  08:00:27:A3:44:12


======Setup IP Address<span> </span>:======  
====Ketentuan IP Address yang akan di tambahkan<span> </span>:====  
  ether1 : DHCP-Client
  ether1 : DHCP-Client
  ether2 : 192.168.1.1/24
  ether2 : 192.168.2.1/24
  ether3 : 192.168.2.1/24
  ether3 : 192.168.3.1/24
  ether4 : 10.192.0.1/8
  ether4 : 192.168.4.1/24
ether5 : 192.168.5.1/24


======Setup DHCP-Client======
====Setup DHCP-Client====
[admin@R1] > ip dhcp-client add use-peer-dns=yes use-peer-ntp=yes interface=ether1 disabled=no
Lakukan setup dhcp-client agar ether1 pada router ini mendapat ip dari sumber internet secara otomatis.
  [admin@R1] > ip dhcp-client set ether1 disabled=no use-peer-dns=yes
Cek DHCP-Client | Pastikan ether1 sudah dapat IP Address
Cek DHCP-Client | Pastikan ether1 sudah dapat IP Address
  [admin@R1] > ip dhcp-client print
  [admin@R1] > ip dhcp-client print


======Setting ip======
====Setting ip====
[admin@MikroTik] > ip dhcp-client set ether1 disabled=no use-peer-dns=yes
  [admin@R1] > ip address add address=192.168.2.1/24 interface=ether2
  [admin@MikroTik] > ip address add address=192.168.2.1/24 interface=ether2
  [admin@R1] > ip address add address=192.168.3.1/24 interface=ether3
  [admin@MikroTik] > ip address add address=192.168.3.1/24 interface=ether3
  [admin@R1] > ip address add address=192.168.4.1/24 interface=ether4
  [admin@MikroTik] > ip address add address=192.168.4.1/24 interface=ether4
  [admin@R1] > ip address add address=192.168.5.1/24 interface=ether5
  [admin@MikroTik] > ip address add address=192.168.5.1/24 interface=ether5


Cek konfigurasi ip address, pastikan semua ethernet sudah terdapat ip address sesuai ketentuan
Cek konfigurasi ip address, pastikan semua ethernet sudah terdapat ip address sesuai ketentuan
  [admin@R1] > ip address print
  [admin@R1] > ip address print


======Setup Gateway======
====Setup DHCP Server pada masing-masing port====
  [admin@R1] > ip route add gateway=192.168.1.1
Dibawah ini adalah contoh setup dhcp-server pada ether2 jika menghendaki pada setiap ethernet memiliki dhcp-server silahkan lakukan hal yang sama pada setiap ethernet seperti langkah berikut.
[admin@R1] > ip dhcp-server setup
Select interface to run DHCP server on
dhcp server interface: ether2
Select network for DHCP addresses
dhcp address space: 192.168.2.0/24
Select gateway for given network
gateway for dhcp network: 192.168.2.1
Select pool of ip addresses given out by DHCP server
addresses to give out: 192.168.2.2-192.168.2.254
Select DNS servers
dns servers: 192.168.137.1
Select lease time
 
====Setup Gateway====
  [admin@R1] > ip route add gateway=192.168.137.97
 
====Setup DNS====
[admin@R1] > ip dns set servers=8.8.8.8 allow-remote-requests=yes
[admin@R1] > ip dns print
 
==== Tambahkan NAT ====
[admin@R1] > /ip firewall nat add chain=srcnat src-address=0.0.0.0/0 out-interface=ether1 action=masquerade


======Setup DNS======
==== Test Koneksi dengan perintah ping ====
/ip dns set primary-dns=172.168.0.6 allow-remoterequests=yes
  Jika semua proses sudah selesai silahkan lakukan test koneksi dari atau ke semua interface
/ip dns set secondary-dns=202.134.1.10 allow-remoterequests=yes
  /ip dns print

Revisi terkini sejak 26 September 2021 00.00


Koneksi dari internet sampai ke pengguna

IP Address Default Router Mikrotik

IP Address Default = 192.168.88.1

Username dan Password Default Router Mikrotik

User       = Admin
Password   = (kosong)
Menghubungukan router mikrotik ke ISP(Internet Service Provider)

Memberikan nama perangkat

/system identity set name=pcrouter

Set Time Zone, Tanggal dan Waktu di Mikrotik

[admin@MikroTik] > /system clock set time-zone-autodetect=yes
[admin@MikroTik] > /system clock set time=06:06:05
[admin@MikroTik] > /system clock set date=sep/26/2021
[admin@MikroTik] > /system clock set time-zone-name=Asia/Jakarta

Memberi Nama Interface Mikrotik

/interface ethernet set ether1 name=ether1-internet

Configurasi IP Address

Contoh Perintah :

[admin@MikroTik] > ip address add address=192.168.1.1/24 interface=ether1

Configurasi IP Gateway

/ip route add gateway=192.168.1.1

Configurasi DNS

/ip dns set servers=1.1.1.1 8.8.8.8 set allow-remote-requests=yes

Configurasi NAT

/ip firewall nat add chain=srcnat src-address=172.16.1.0/24 out-interface=ether1-internet action=masquerade

Backup & Restore Setingan Mikrotik

Backup :

/system backup save name="basic-config-051019"

Restore :

/system backup load name="basic-config-051019"


LANGKAH-LANGKAH KONFIGURASI ROUTER SEDERHANA

Login Default

User = admin
Password = (default belum ada password)

Setup Identity : R1(memberi nama router mikrotik)

[admin@MikroTik] > system identity set name=R1
[admin@R1] >

Cek ethernet mikrotik

[admin@R1] > interface print
Flags: D - dynamic, X - disabled, R - running, S - slave
#     NAME                                TYPE       ACTUAL-MTU L2MTU  MAX-L2MTU MAC-ADDRESS
0  R  ether1                              ether            1500                  08:00:27:11:49:EC
1  R  ether2                              ether            1500                  08:00:27:49:67:52
2  R  ether3                              ether            1500                  08:00:27:43:D7:2E
3  R  ether4                              ether            1500                  08:00:27:7F:12:39
4  R  ether5                              ether            1500                  08:00:27:A3:44:12

Ketentuan IP Address yang akan di tambahkan :

ether1	: DHCP-Client
ether2	: 192.168.2.1/24
ether3	: 192.168.3.1/24
ether4	: 192.168.4.1/24
ether5	: 192.168.5.1/24

Setup DHCP-Client

Lakukan setup dhcp-client agar ether1 pada router ini mendapat ip dari sumber internet secara otomatis.

 [admin@R1] > ip dhcp-client set ether1 disabled=no use-peer-dns=yes

Cek DHCP-Client | Pastikan ether1 sudah dapat IP Address

[admin@R1] > ip dhcp-client print

Setting ip

[admin@R1] > ip address add address=192.168.2.1/24 interface=ether2
[admin@R1] > ip address add address=192.168.3.1/24 interface=ether3
[admin@R1] > ip address add address=192.168.4.1/24 interface=ether4
[admin@R1] > ip address add address=192.168.5.1/24 interface=ether5

Cek konfigurasi ip address, pastikan semua ethernet sudah terdapat ip address sesuai ketentuan

[admin@R1] > ip address print

Setup DHCP Server pada masing-masing port

Dibawah ini adalah contoh setup dhcp-server pada ether2 jika menghendaki pada setiap ethernet memiliki dhcp-server silahkan lakukan hal yang sama pada setiap ethernet seperti langkah berikut.

[admin@R1] > ip dhcp-server setup
Select interface to run DHCP server on
dhcp server interface: ether2
Select network for DHCP addresses
dhcp address space: 192.168.2.0/24
Select gateway for given network
gateway for dhcp network: 192.168.2.1
Select pool of ip addresses given out by DHCP server
addresses to give out: 192.168.2.2-192.168.2.254
Select DNS servers
dns servers: 192.168.137.1
Select lease time

Setup Gateway

[admin@R1] > ip route add gateway=192.168.137.97

Setup DNS

[admin@R1] > ip dns set servers=8.8.8.8 allow-remote-requests=yes
[admin@R1] > ip dns print

Tambahkan NAT

[admin@R1] > /ip firewall nat add chain=srcnat src-address=0.0.0.0/0 out-interface=ether1 action=masquerade

Test Koneksi dengan perintah ping

Jika semua proses sudah selesai silahkan lakukan test koneksi dari atau ke semua interface