- IP modem :address: 192.168.0.1/30 netmask : 255.255.255.252
- Mikrotik menggunakan 2 buah Lan Card :
- Publik : addres 192.168.0.2/30 network: 192.168.0.0 broadcast 192.168.0.3 => untuk ke Modem
- Local: address 192.168.1.1/27 network 192.168.1.0 broadcast 192.168.1.31 => untuk ke klient
- Untuk Client : address 192.168.1.2 sampai dengan 192.168.1.30 netmask 255.255.255.224
[admin@Mikrotik]> interface set 0 name=public disable=no comment="ke modem"
untuk Local
[admin@Mikrotik] > interface set 1 name=local disable=no comment="keLAN"
[admin@Mikrotik] > interface print Flags: X - disabled, D - dynamic, R - running
# NAME TYPE RX-RATE TX-RATE MTU
0 R ;;; ke modem
public ether 0 0 1500
1 R ;;; keLAN
local ether 0 0 1500
[admin@Mikrotik]>ip address interface=public add address=192.168.0.2/30 network=192.168.0.0 broadcast=192.168.0.3 comment="ke Modem" disable=no
untuk Local
[admin@Mikrotik]>ip address interface=local add address=192.168.1.1/27 network=192.168.1.0 broadcast=192.168.1.31 comment="ke-LAN" disable=no
[admin@Mikrotik]>ip address print Flags: X - disabled, I - invalid, D - dynamic
# ADDRESS NETWORK BROADCAST INTERFACE
0 ;;; ke Modem
192.168.0.2/30 192.168.0.0 192.168.0.3 public
1 ;;; ke-LAN
192.168.1.1/27 192.168.1.0 192.168.1.31 local
[admin@Mikrotik]>ip route print Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf
# DST-ADDRESS PREFSRC G GATEWAY DISTANCE INTERFACE
0 ADC 192.168.0.0/30 192.168.0.2 public
1 ADC 192.168.1.0/27 192.168.1.1 local
2 A S 0.0.0.0/0 r 192.168.0.2 public
[admin@Mikrotik]>ip dns set secondary-dns=202.134.2.5 allow-remoterequests=yes
[admin@Mikrotik]>ip dns print primary-dns: 202.134.0.155
secondary-dns: 202.134.2.5
allow-remote-requests: yes
cache-size: 2048KiB
cache-max-ttl: 1w
cache-used: 358KiB9. Tes akses domain
[admin@Mikrotik]>ping yahoo.com 206.190.60.37 64 byte ping: ttl=51 time=419 ms
206.190.60.37 64 byte ping: ttl=51 time=563 ms
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 419/491.0/563 ms
Semua request dari client ke port 80 akan dibelokan ke port 8080
[admin@Mikrotik]>ip firewall nat add chain=dstnat in-interface=local src-address=192.168.1.0/27 protocol=tcp dst-port=80 action=redirect to-ports=8080
Untuk mencegah klient mem-bypassproxy maka tambahkan
[admin@Mikrotik]>ip firewall nat add chain=dstnat in-interface=local src-address=!192.168.1.1 protocol=tcp dst-port=80 action=dst-nat to-addresses=192.168.1.1 to-ports=8080