3
SETUP MIKROTIK AS GATEWAY Now, I will let you know how to setup MIkrotik as Gateway server. 1. First, install Mikrotik RouterOS on your server PC. 2. Login mikrotik with console. MikroTik v2.9.7 Login: admin Password: After that, you can go inside on Mikrotik Server. Your username is “admin” and without password by default. 3. If you want to setup password: [admin@Mikrotik] > password old password: **** new password: ******* retype new password: ******* [admin@ Mikrotik]] > 4. To identify your interface on your PC that installed on MIkrotik [admin@Mikrotik] > interface print Flags: X - disabled, D - dynamic, R - running # NAME TYPE RX-RATE TX-RATE MTU 0 R ether1 ether 0 0 1500 1 R ether2 ether 0 0 1500 2 R ether2 ether 0 0 1500 [admin@Mikrotik] > 5. Give IP address on every interface that you’ve installed. [admin@Mikrotik] > ip address add address=192.168.0.1 netmask=255.255.255.0 interfac e=ether1 [admin@Mikrotik] > ip address add address=172.16.0.1

Setup Mikrotik as Gateway

Embed Size (px)

DESCRIPTION

Bagaimana mensetup Mikrotik sebagai gateway pada jaringan anda? disini jawabannya!

Citation preview

Page 1: Setup Mikrotik as Gateway

SETUP MIKROTIK AS GATEWAY

Now, I will let you know how to setup MIkrotik as Gateway server.

1. First, install Mikrotik RouterOS on your server PC.2. Login mikrotik with console.

MikroTik v2.9.7Login: adminPassword:

After that, you can go inside on Mikrotik Server. Your username is “admin” and without password by default.

3. If you want to setup password:

[admin@Mikrotik] > passwordold password: ****new password: *******retype new password: *******

[admin@ Mikrotik]] >

4. To identify your interface on your PC that installed on MIkrotik

[admin@Mikrotik] > interface printFlags: X - disabled, D - dynamic, R - running# NAME TYPE RX-RATE TX-RATE MTU0 R ether1 ether 0 0 15001 R ether2 ether 0 0 15002 R ether2 ether 0 0 1500

[admin@Mikrotik] >

5. Give IP address on every interface that you’ve installed.

[admin@Mikrotik] > ip address add address=192.168.0.1netmask=255.255.255.0 interface=ether1[admin@Mikrotik] > ip address add address=172.16.0.1netmask=255.255.255.0 interfac

e=ether2

6. To see the configuration of IP address:

[admin@Mikrotik] >ip address print

Page 2: Setup Mikrotik as Gateway

Flags: X - disabled, I - invalid, D - dynamic# ADDRESS NETWORK BROADCAST INTERFACE0 192.168.0.1/24 192.168.0.0 192.168.0.63 ether11 172.16.0.1/24 172.16.0.0 172.16.0.255 ether2

[admin@Mikrotik] >

7. Give the default gateway. For the example, gateway for internet connection is 192.168.0.254

[admin@Mikrotik] > /ip route add gateway=192.168.0.254

8. Now, see the routing table on Mikrotik System.

[admin@Mikrotik] > ip route printFlags: X - disabled, A - active, D - dynamic,C - connect, S - static, r - rip, b - bgp, o - ospf# DST-ADDRESS PREFSRC G GATEWAY DISTANCE INTERFACE0 ADC 172.16.0.0/24 172.16.0.1 ether21 ADC 192.168.0.0/26 192.168.0.1 ether12 A S 0.0.0.0/0 r 192.168.0.254 ether1

[admin@Mikrotik] >

9. Test connection to gateway to make sure the configuration is correct.

[admin@Mikrotik] > ping 192.168.0.254192.168.0.254 64 byte ping: ttl=64 time<1 ms192.168.0.254 64 byte ping: ttl=64 time<1 ms2 packets transmitted, 2 packets received, 0% packet lossround-trip min/avg/max = 0/0.0/0 ms

[admin@Mikrotik] >

10. Setup the DNS on MIkrotik.

[admin@Mikrotik] > ip dns set primary-dns=192.168.0.10 allow-remoterequests=no[admin@Mikrotik] > ip dns set secondary-dns=192.168.0.11 allow-remoterequests=no

11. To see the configuration of DNS:

[admin@Mikrotik] > ip dns printprimary-dns: 192.168.0.10secondary-dns: 192.168.0.11allow-remote-requests: nocache-size: 2048KiBcache-max-ttl: 1wcache-used: 16KiB[admin@Mikrotik] >

12. To test the connection, just use “ping” command to domain:

Page 3: Setup Mikrotik as Gateway

[admin@Mikrotik] > ping yahoo.com216.109.112.135 64 byte ping: ttl=48 time=250 ms10 packets transmitted, 10 packets received, 0% packet lossround-trip min/avg/max = 571/571.0/571 ms[admin@Mikrotik] >

13. Setup masquerading. If Mikrotik that we used as gateway server, we should masquerading due to can be connected into internet.

[admin@Mikrotik] > ip firewall nat add action=masquerade outinterface= ether1 chain: srcnat[admin@Mikrotik] >

14. To see the configuration of Masquerading:

[admin@Mikrotik] ip firewall nat printFlags: X - disabled, I - invalid, D - dynamic0 chain=srcnat out-interface=ether1 action=masquerade[admin@Mikrotik] >