Cara Konfigurasi IP Address, Gateway, DNS, NAT di Mikrotik

Cara Konfigurasi IP Address, Gateway, DNS, NAT di Mikrotik

Untuk mengkonfigurasi Mikrotik kita menggunakan Winbox.

Jalankan Winbox
Klik tombol ‘…’
Karena IP Address belum diset maka yang tampil adalah MAC Address
Winbox akan mendeteksi semua Mikrotik yang terhubung dalam jaringan

Konfigurasi bisa menggunakan GUI atau menggunakan CLI
Kali ini cukup menggunakan CLI saja
Klik New Terminal untuk menampilkan window terminal

Mengganti Nama Hostname
Defaultnya [[email protected]] diganti menjadi [[email protected]]

system identity set name=mikrotik-lab

system identity set name=mikrotik-lab

Username dan Password Admin

user print Flags: X – disabled # NAME GROUP ADDRESS 0 ;;; system default user admin full

user print

Flags: X – disabled

#   NAME                        GROUP   ADDRESS

0   ;;; system default user      

admin                       full

Set password = admin untuk username = admin

user set numbers=0 password=admin

user set numbers=0 password=admin

Konfigurasi IP Address
Modem
– IP Address : 192.168.1.1
– Sub Netmask : 255.255.255.0

Mikrotik
Ether1
– IP Address : 192.168.1.10 (Ke Internet)
– Sub Netmask : 255.255.255.0
Ether2
– IP Address : 192.168.10.1 (Ke Jaringan Lokal)
– Sub Netmask : 255.255.255.0
Gateway : 192.168.1.1
DNS : 192.168.1.1

Tampilkan interface jaringan

interface print Flags: D – dynamic, X – disabled, R – running, S – slave # NAME TYPE MTU L2MTU MAX-L2MTU 0 R ether1 ether 1500 1 R ether2 ether 1500 2 R ether3 ether 1500 3 R ether4 ether 1500

interface print

Flags: D – dynamic, X – disabled, R – running, S – slave

#     NAME       TYPE               MTU L2MTU  MAX-L2MTU

0  R  ether1     ether             1500

1  R  ether2     ether             1500

2  R  ether3     ether             1500

3  R  ether4     ether             1500

Set Ether1

ip address add address=192.168.1.10 netmask=255.255.255.0 interface=ether1

ip address add address=192.168.1.10 netmask=255.255.255.0 interface=ether1

Set Ether2

ip address add address=192.168.10.1 netmask=255.255.255.0 interface=ether2

ip address add address=192.168.10.1 netmask=255.255.255.0 interface=ether2

Tampilkan IP Address

ip address print Flags: X – disabled, I – invalid, D – dynamic # ADDRESS NETWORK INTERFACE 0 192.168.1.10/24 192.168.1.0 ether1 1 192.168.10.1/24 192.168.10.0 ether2

ip address print

Flags: X – disabled, I – invalid, D – dynamic

#   ADDRESS            NETWORK         INTERFACE

0   192.168.1.10/24    192.168.1.0     ether1    

1   192.168.10.1/24    192.168.10.0    ether2

Set Default Gateway

ip route add dst-address=0.0.0.0/0 gateway=192.168.1.1

ip route add dst-address=0.0.0.0/0 gateway=192.168.1.1

Tampilkan Gateway

ip route print Flags: X – disabled, A – active, D – dynamic, C – connect, S – static, r – rip, b – bgp, o – ospf, m – mme, B – blackhole, U – unreachable, P – prohibit # DST-ADDRESS PREF-SRC GATEWAY DISTANCE 0 A S 0.0.0.0/0 192.168.1.1 1

ip route print

Flags: X – disabled, A – active, D – dynamic, C – connect, S – static, r – rip, b – bgp, o – ospf, m – mme, B – blackhole, U – unreachable, P – prohibit

#      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE

0 A S  0.0.0.0/0                          192.168.1.1               1

Set DNS Server

ip dns set servers=192.168.1.1 allow-remote-requests=yes

ip dns set servers=192.168.1.1 allow-remote-requests=yes

Tampilkan DNS Server

ip dns print servers: 192.168.1.1 dynamic-servers: allow-remote-requests: yes max-udp-packet-size: 4096 cache-size: 2048KiB cache-max-ttl: 1w cache-used: 29KiB

ip dns print

                servers: 192.168.1.1

        dynamic-servers:

  allow-remote-requests: yes

    max-udp-packet-size: 4096

             cache-size: 2048KiB

          cache-max-ttl: 1w

             cache-used: 29KiB

Tes konfigurasi dengan ping IP modem dan google.com

ping 192.168.1.1 ping google.com

ping 192.168.1.1

ping google.com

NAT (Network Address Translation)
NAT untuk mentranslasi IP Private ke IP Public atau sebaliknya.
Maksud konfigurasi dibawah ini, jika ada user yang mau terkoneksi ke internet maka paketnya dilewatkan melalui interface Ether1.

ip firewall nat add chain=srcnat out-interface=ether1 action=masquerade

ip firewall nat add chain=srcnat out-interface=ether1 action=masquerade

Sekarang set IP komputer client
IP Address : 192.168.10.2
Netmask : 255.255.255.0
Gateway : 192.168.10.1
DNS : 192.168.10.1

Pengujian konfigurasi client apakah terkoneksi ke mikrotik dan internet

ping 192.168.10.1 ping 192.168.1.1 ping google.com

ping 192.168.10.1

ping 192.168.1.1

ping google.com

Jika ping berhasil coba lakukan browsing internet.

selamat mencoba

Source

Leave a Reply

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