PT. Hawk Teknologi Solusi

Silahkan Cari Disini

Rabu, 30 April 2008

Firewall untuk router mikrotik

Untuk mengamankan router mikrotik dari traffic virus dan excess ping dapat digunakan skrip firewall berikut

Pertama buat address-list "ournetwork" yang berisi alamat IP radio, IP LAN dan IP WAN atau IP lainnya yang dapat dipercaya

Dalam contoh berikut alamat IP radio adalah = 10.0.0.0/16, IP LAN = 192.168.2.0/24 dan IP WAN = 203.89.24.0/21 dan IP lainnya yang dapat dipercaya = 202.67.33.7

Untuk membuat address-list dapat menggunakan contoh skrip seperti berikut ini tinggal disesuaikan dengan konfigurasi jaringan Anda.

Buat skrtip berikut menggunakan notepad kemudian copy-paste ke console mikrotik

/ ip firewall address-list
add list=ournetwork address=203.89.24.0/21 comment="Datautama Network" \
disabled=no
add list=ournetwork address=10.0.0.0/16 comment="IP Radio" disabled=no
add list=ournetwork address=192.168.2.0/24 comment="LAN Network" disabled=no

Selanjutnya copy-paste skrip berikut pada console mikrotik

/ ip firewall filter
add chain=forward connection-state=established action=accept comment="allow \
established connections" disabled=no
add chain=forward connection-state=related action=accept comment="allow \
related connections" disabled=no
add chain=virus protocol=udp dst-port=135-139 action=drop comment="Drop \
Messenger Worm" disabled=no
add chain=forward connection-state=invalid action=drop comment="drop invalid \
connections" disabled=no
add chain=virus protocol=tcp dst-port=135-139 action=drop comment="Drop \
Blaster Worm" disabled=no
add chain=virus protocol=tcp dst-port=1433-1434 action=drop comment="Worm" \
disabled=no
add chain=virus protocol=tcp dst-port=445 action=drop comment="Drop Blaster \
Worm" disabled=no
add chain=virus protocol=udp dst-port=445 action=drop comment="Drop Blaster \
Worm" disabled=no
add chain=virus protocol=tcp dst-port=593 action=drop comment="________" \
disabled=no
add chain=virus protocol=tcp dst-port=1024-1030 action=drop comment="________" \
disabled=no
add chain=virus protocol=tcp dst-port=1080 action=drop comment="Drop MyDoom" \
disabled=no
add chain=virus protocol=tcp dst-port=1214 action=drop comment="________" \
disabled=no
add chain=virus protocol=tcp dst-port=1363 action=drop comment="ndm requester" \
disabled=no
add chain=virus protocol=tcp dst-port=1364 action=drop comment="ndm server" \
disabled=no
add chain=virus protocol=tcp dst-port=1368 action=drop comment="screen cast" \
disabled=no
add chain=virus protocol=tcp dst-port=1373 action=drop comment="hromgrafx" \
disabled=no
add chain=virus protocol=tcp dst-port=1377 action=drop comment="cichlid" \
disabled=no
add chain=virus protocol=tcp dst-port=2745 action=drop comment="Bagle Virus" \
disabled=no
add chain=virus protocol=tcp dst-port=2283 action=drop comment="Drop Dumaru.Y" \
disabled=no
add chain=virus protocol=tcp dst-port=2535 action=drop comment="Drop Beagle" \
disabled=no
add chain=virus protocol=tcp dst-port=2745 action=drop comment="Drop \
Beagle.C-K" disabled=no
add chain=virus protocol=tcp dst-port=3127 action=drop comment="Drop MyDoom" \
disabled=no
add chain=virus protocol=tcp dst-port=3410 action=drop comment="Drop Backdoor \
OptixPro" disabled=no
add chain=virus protocol=tcp dst-port=4444 action=drop comment="Worm" \
disabled=no
add chain=virus protocol=udp dst-port=4444 action=drop comment="Worm" \
disabled=no
add chain=virus protocol=tcp dst-port=5554 action=drop comment="Drop Sasser" \
disabled=no
add chain=virus protocol=tcp dst-port=8866 action=drop comment="Drop Beagle.B" \
disabled=no
add chain=virus protocol=tcp dst-port=9898 action=drop comment="Drop \
Dabber.A-B" disabled=no
add chain=virus protocol=tcp dst-port=10000 action=drop comment="Drop \
Dumaru.Y, sebaiknya di didisable karena juga sering digunakan utk vpn atau \
webmin" disabled=yes
add chain=virus protocol=tcp dst-port=10080 action=drop comment="Drop \
MyDoom.B" disabled=no
add chain=virus protocol=tcp dst-port=12345 action=drop comment="Drop NetBus" \
disabled=no
add chain=virus protocol=tcp dst-port=17300 action=drop comment="Drop Kuang2" \
disabled=no
add chain=virus protocol=tcp dst-port=27374 action=drop comment="Drop \
SubSeven" disabled=no
add chain=virus protocol=tcp dst-port=65506 action=drop comment="Drop PhatBot, \
Agobot, Gaobot" disabled=no
add chain=forward action=jump jump-target=virus comment="jump to the virus \
chain" disabled=no
add chain=input connection-state=established action=accept comment="Accept \
established connections" disabled=no
add chain=input connection-state=related action=accept comment="Accept related \
connections" disabled=no
add chain=input connection-state=invalid action=drop comment="Drop invalid \
connections" disabled=no
add chain=input protocol=udp action=accept comment="UDP" disabled=no
add chain=input protocol=icmp limit=50/5s,2 action=accept comment="Allow \
limited pings" disabled=no
add chain=input protocol=icmp action=drop comment="Drop excess pings" \
disabled=no
add chain=input protocol=tcp dst-port=21 src-address-list=ournetwork \
action=accept comment="FTP" disabled=no
add chain=input protocol=tcp dst-port=22 src-address-list=ournetwork \
action=accept comment="SSH for secure shell" disabled=no
add chain=input protocol=tcp dst-port=23 src-address-list=ournetwork \
action=accept comment="Telnet" disabled=no
add chain=input protocol=tcp dst-port=80 src-address-list=ournetwork \
action=accept comment="Web" disabled=no
add chain=input protocol=tcp dst-port=8291 src-address-list=ournetwork \
action=accept comment="winbox" disabled=no
add chain=input protocol=tcp dst-port=1723 action=accept comment="pptp-server" \
disabled=no
add chain=input src-address-list=ournetwork action=accept comment="From \
Datautama network" disabled=no
add chain=input action=log log-prefix="DROP INPUT" comment="Log everything \
else" disabled=no
add chain=input action=drop comment="Drop everything else" disabled=no

Efek dari skrip diatas adalah:

  1. router mikrotik hanya dapat diakses FTP, SSH, Web dan Winbox dari IP yang didefinisikan dalam address-list "ournetwork" sehingga tidak bisa diakses dari sembarang tempat.
  2. Port-port yang sering dimanfaatkan virus di blok sehingga traffic virus tidak dapat dilewatkan, tetapi perlu diperhatikan jika ada user yang kesulitan mengakses service tertentu harus dicek pada chain="virus" apakah port yang dibutuhkan user tersebut terblok oleh firewall.
  3. Packet ping dibatasi untuk menghindari excess ping.

Selain itu yang perlu diperhatikan adalah: sebaiknya buat user baru dan password dengan group full kemudian disable user admin, hal ini untuk meminimasi resiko mikrotik Anda di hack orang.

Memisahkan Bandwidth Lokal dan International menggunakan Mikrotik

Versi 3

Perubahan dari versi sebelumnya:

  1. Proses mangle berdasarkan address-list
  2. Pemisahan traffic Indonesia dan overseas lebih akurat

Semakin berkembangnya konten Internet lokal di Indonesia telah memberikan peluang bisnis baru dalam industri Internet di Indonesia. Saat ini banyak Internet Service Provider
(ISP) yang menawarkan paket bandwidth lokal atau IIX yang lebih besar dibandingkan bandwidth Internet Internasional, hal ini seiring dengan semakin banyaknya pengelola RT-RW Net yang mampu menyediakan layanan koneksi Internet yang lebih terjangkau bagi lingkungan sekitarnya.

Permasalahan umum yang terjadi pada jaringan RT-RW Net adalah masalah pengaturan bandwidth. Pada umumnya pengelola RT-RW Net akan kesulitan pada saat ingin memisahkan antara traffic lokal dengan traffic internasional karena umumnya jaringan RT-RW Net hanya menggunakan static routing, berbeda dengan ISP yang mampu membangun jaringan yang lebih komplek menggunakan protocol routing BGP sehingga ISP dapat dengan mudah memisahkan antara traffic local dan internasional.

Untuk memisahkan traffic lokal dengan traffic internasional tersebut RT-RW Net dapat dengan mudah menggunakan PC Router + Sistem Operasi Mikrotik, Mikrotik sebenarnya adalah linux yang sudah di buat sedemikian rupa oleh pengembangnya sehingga sangat mudah diinstall dan di konfigur dengan banyak sekali fitur dan fungsi. Untuk lebih lanjut mengenai mikrotik dapat dilihat pada situs webnya http://www.mikrotik.com atau http://www.mikrotik.co.id

Berikut adalah sekenario jaringan dengan Mikrotik sebagai router

Image

Gambar 1. Sekenario Jaringan

Penjelasan:

  1. Mikrotik Router dengan 2 Network Interface Card (NIC) Ether1 dan Ether3, dimana Ether1 adalah Ethernet yang terhubung langsung ke ISP dan Ether3 adalah Ethernet yang terhubung langsung dengan jaringan 192.168.2.0/24
  2. Bandwidth dari ISP misalnya 256Kbps internasional dan 1024Kbps lokal IIX
  3. Komputer 192.168.2.4 akan diberi alokasi bandwidth 128Kbps internasional dan 256Kbps lokal IIX

Untuk memisahkan antara traffic lokal IIX dengan traffic internasional caranya adalah dengan menandai paket data yang menuju atau berasal dari jaringan lokal IIX menggunakan mangle. Pertanyaannya bagaimana caranya Mikrotik bisa mengetahui paket tersebut menuju atau berasal dari jairngan lokal IIX?

Jawabannya adalah dengan mengambil data dari http://lg.mohonmaaf.com

karena http://lg.mohonmaaf.com sudah tidak aktif maka data dapat diambil dari:

http://203.89.24.3/cgi-bin/lg.cgi

*** Mohon maaf lagi ya server 203.89.24.3 nya baru saya install ulang jadi pake yang http://lg.mohonmaaf.com aja ***

Pilih Query dengan men-cek-list BGP dan klik Submit

Image

Gambar 2. Hasil Query http://lg.mohonmaaf.com untuk perintah “show ip bgp”

Fungsi dari http://lg.mohonmaaf.com adalah sebagai fasilitas looking glass jaringan lokal yang dikelola oleh PT. IDC , terima kasih kepada Bapak Johar Alam yang telah menyediakan layanan tersebut.

Dari hasil query tersebut selanjutnya simpan sebagai text files untuk selanjutnya dapat diolah dengan menggunakan spreadsheet contohnya Ms. Excel untuk mendapatkan semua alamat Network yang diadvertise oleh router-router BGP ISP lokal Indonesia pada BGP router IDC atau National Inter Connection Exchange (NICE).

Pada penjelasan versi-2 dokumen ini saya menggunakan teknik langsung memasukkan daftar ip blok ke /ip firewall mangle, dengan teknik ini saya harus memasukkan dua kali daftar ip yang didapat dari router NICE ke /ip firewall mangle.

Cara lain yang lebih baik adalah dengan memasukkan daftar ip blok dari router NICE ke /ip firewall address-list dengan demikian maka pada /ip firewall mangle hanya terdapat beberapa baris saja dan pemisahan traffic Indonesia dan overseas dapat lebih akurat karena mangle dapat dilakukan berdasarkan address-list saja.

Lebih jelasnya adalah sbb:

Selanjutnya buat script berikut untuk dapat diimport oleh router Mikrotik

/ ip firewall address-list
add list=nice address=58.65.240.0/23 comment="" disabled=no
add list=nice address=58.65.242.0/23 comment="" disabled=no
add list=nice address=58.65.244.0/23 comment="" disabled=no
add list=nice address=58.65.246.0/23 comment="" disabled=no
add list=nice address=58.145.174.0/24 comment="" disabled=no
add list=nice address=58.147.184.0/24 comment="" disabled=no
add list=nice address=58.147.185.0/24 comment="" disabled=no
dst…


untuk mendapatkan script diatas dapat melalui URL berikut:

http://www.datautama.net.id/harijanto/mikrotik/datautama-nice.php

URL diatas secara online akan melakukan query ke router NICE dari http://lg.mohonmaaf.com

CATATAN:

Karena looking glass saya lagi tidak aktif jadi pake lg.mohonmaaf.com saja tetapi tetap utk daftar ip local dapat di ambil dari

http://ixp.mikrotik.co.id/download/nice.rsc

atau dari http://www.datautama.net.id/harijanto/mikrotik/datautama-nice.php

yang datanya dari looking glass DatautamaNet

dari hasil URL diatas copy lalu paste ke mikrotik dengan menggunakan aplikasi putty.exe ssh ke ipmikrotik tersebut, caranya setelah di copy teks hasil proses URL diatas lalu klik kanan mouse pada jendela ssh putty yang sedang meremote mikrotik tersebut. Cara ini agak kurang praktis tetapi karena jika script diatas dijadikan .rsc ternyata akan bermasalah karena ada beberapa baris ip blok yang saling overlap sebagai contoh:

\... add address=222.124.64.0/23 list="nice"
[datautama@router-01-jkt] > /ip firewall address-list \
\... add address=222.124.64.0/21 list="nice"
address ranges may not overlap

dimana 222.124.64.0/21 adalah supernet dari 222.124.64.0/23 artinya diantara dua blok ip tersebut saling overlap, sehingga pada saat proses import menggunakan file .rsc akan selalu berhenti pada saat menemui situasi seperti ini.

Sampai saat ini saya belum menemukan cara yang praktis utk mengatasi hal tersebut diatas.
Kalau saja kita bisa membuat address-list dari table prefix BGP yang dijalankan di mikrotik maka kita bisa mendapatkan address-list dengan lebih sempurna.

Selanjutnya pada /ip firewall mangle perlu dilakukan konfigurasi sbb:

/ ip firewall mangle
add chain=forward src-address-list=nice action=mark-connection \
new-connection-mark=mark-con-indonesia passthrough=yes comment="mark all \
indonesia source connection traffic" disabled=no
add chain=forward dst-address-list=nice action=mark-connection \
new-connection-mark=mark-con-indonesia passthrough=yes comment="mark all \
indonesia destination connection traffic" disabled=no
add chain=forward src-address-list=!nice action=mark-connection \
new-connection-mark=mark-con-overseas passthrough=yes comment="mark all \
overseas source connection traffic" disabled=no
add chain=forward dst-address-list=!nice action=mark-connection \
new-connection-mark=mark-con-overseas passthrough=yes comment="mark all \
overseas destination connection traffic" disabled=no
add chain=prerouting connection-mark=mark-con-indonesia action=mark-packet \
new-packet-mark=indonesia passthrough=yes comment="mark all indonesia \
traffic" disabled=no
add chain=prerouting connection-mark=mark-con-overseas action=mark-packet \
new-packet-mark=overseas passthrough=yes comment="mark all overseas \
traffic" disabled=no


Langkah selanjutnya adalah mengatur bandwidth melalui queue simple, untuk mengatur bandwidth internasional 128Kbps dan bandwidth lokal IIX 256Kbps pada komputer dengan IP 192.168.2.4 dapat dilakukan dengan contoh script sbb:

/ queue simple
add name="harijant-indonesia" target-addresses=192.168.2.4/32 \
dst-address=0.0.0.0/0 interface=all parent=none packet-marks=indonesia \
direction=both priority=8 queue=default/default limit-at=0/0 \
max-limit=256000/256000 total-queue=default disabled=no
add name="harijanto-overseas" target-addresses=192.168.2.4/32 \
dst-address=0.0.0.0/0 interface=all parent=none packet-marks=overseas \
direction=both priority=8 queue=default/default limit-at=0/0 \
max-limit=128000/128000 total-queue=default disabled=no


Script diatas berarti hanya komputer dengan IP 192.168.2.4 saja yang di batasi bandwidthnya 128Kbps internasional (overseas) dan 256Kbps lokal IIX (indonesia) sedangkan yang lainnya tidak dibatasi.

Hasil dari script tersebut adalah sbb:

Image

Gambar 3. simple queue untuk komputer 192.168.2.4


Dengan demikian maka komputer 192.168.2.4 hanya dapat mendownload atau mengupload sebesar 128Kbps untuk internasional dan 256Kbps untuk lokal IIX.

Untuk mengujinya dapat menggunakan bandwidthmeter sbb:

Image

Gambar 4. Hasil bandwidth meter komputer 192.168.2.4 ke lokal ISP

Image

Gambar 5. Hasil bandwidth meter ke ISP internasional

Dengan demikian berarti Mikrotik telah berhasil mengatur pemakaian bandwidth internasional dan lokal IIX sesuai dengan yang diharapkan pada komputer 192.168.2.4.

Pada penjelasan versi-3 ini proses mangle terhadap traffic “overseas” dapat lebih akurat karena menggunakan address-list dimana arti dari src-address=!nice adalah source address “bukan nice” dan dst-address=!nice adalah destination address “bukan nice”.

Sehingga demikian traffic “overseas” tidak akan salah identifikasi, sebelumnya pada penjelasan versi-2 traffic “overseas” bisa salah indentifikasi karena traffic “overseas” di definisikan sbb

add connection-mark=mark-con-indonesia action=mark-packet new-packet-mark=indonesia chain=prerouting comment="mark indonesia"
add packet-mark=!indonesia action=mark-packet new-packet-mark=overseas chain=prerouting comment="mark all overseas traffic"

packet-mark=!indonesia artinya “packet-mark=bukan paket Indonesia”, padahal “bukan paket Indonesia” bisa saja paket lainnya yang telah didefinisikan sebelumnya sehingga dapat menimbulkan salah identifikasi.

Adapun teknik diatas telah di test pada router mikrotik yang menjalankan NAT , jika router mikrotik tidak menjalankan NAT coba rubah chain=prerouting menjadi chain=forward.

Untuk lebih lanjut mengenai pengaturan bandwidth pada Mikrotik dapat dilihat pada manual mikrotik yang dapat didownload pada

http://www.mikrotik.com/docs/ros/2.9/RouterOS_Reference_Manual_v2.9.pdf


Script diatas dapat diimplementasikan pada Mikrotik Versi 2.9.27 , untuk versi mikrotik sebelumnya kemungkinan ada perbedaan perintah.

Reference:


* http://www.mikrotik.com
* http://www.mikrotik.co.id
* http://wiki.mikrotik.com

Memisahkan gateway traffic Local dan International

Teknik lainnya utk memisahkan traffic data local/IIX dan International adalah dengan menggunakan mark-routing

Misal untuk traffic International dilewatkan melalui gateway 203.89.24.65 sedangkan traffic local Indonesia di lewatkan melalui gateway 203.89.24.177.

Image

contoh konfigurasi IP address router user pada interface yang terhubung ke router Datautama

/ ip address
add address=203.89.24.66/27 network=203.89.24.64 broadcast=203.89.24.95 \
interface=ether1 comment="ip point to point utk traffic lnternational" \
disabled=no
add address=203.89.24.178/30 network=203.89.24.176 broadcast=203.89.24.179 \
interface=ether1 comment="ip point to point utk traffic local" disabled=no

Pertama masukkan daftar ip blok dari router NICE ke /ip firewall address-list seperti berikut:

/ ip firewall address-list
add list=nice address=58.65.240.0/23 comment="" disabled=no
add list=nice address=58.65.242.0/23 comment="" disabled=no
add list=nice address=58.65.244.0/23 comment="" disabled=no
add list=nice address=58.65.246.0/23 comment="" disabled=no
add list=nice address=58.145.174.0/24 comment="" disabled=no
add list=nice address=58.147.184.0/24 comment="" disabled=no
add list=nice address=58.147.185.0/24 comment="" disabled=no
dst…


untuk mendapatkan script diatas dapat melalui URL berikut:

http://www.datautama.net.id/harijanto/mikrotik/datautama-nice.php

Kemudian tandai packet data yang menuju local Indonesia

/ ip firewall mangle
add chain=postrouting dst-address-list=nice action=mark-routing \
new-routing-mark=nice passthrough=yes comment="" disabled=no

Selanjutnya buat ip route berikut

/ ip route
add dst-address=0.0.0.0/0 gateway=203.89.24.65 scope=255 target-scope=10 \
comment="traffic selain local Indonesia" disabled=no
add dst-address=0.0.0.0/0 gateway=203.89.24.177 scope=255 target-scope=10 \
routing-mark=nice comment="traffic local Indonesia" disabled=no

Dengan demikian maka jika ke jaringan local Indonesia akan melalui 203.89.24.177 sedangkan untuk ke International melalui 203.89.24.65, sehingga jika interfacenya dipisah diantara router user dengan router datautama dapat diberi dua mikrotik sebagai bridge utk melimit traffic International maupun local secara terpisah.

Hasil traceroute ke www.plasa.com

C:\Documents and Settings\user>tracert www.plasa.com

Tracing route to www.plasa.com [202.134.0.12]
over a maximum of 30 hops:

1 <1 ms <1 ms <1 ms 192.168.2.1
2 <1 ms <1 ms <1 ms ip-24-177.datautama.net.id [203.89.24.177]
3 16 ms 25 ms 12 ms ip-24-1.datautama.net.id [203.89.24.1]
4 25 ms 25 ms 15 ms telkomnet.openixp.net [218.100.27.179]
5 21 ms 23 ms 19 ms 202.134.2.148
6 12 ms 9 ms 12 ms web.plasa.com [202.134.0.12]
7 10 ms 12 ms 28 ms web.plasa.com [202.134.0.12]
8 11 ms 17 ms 12 ms web.plasa.com [202.134.0.12]

Trace complete.

Hasil traceroute ke www.yahoo.com

C:\Documents and Settings\user>tracert www.yahoo.com

Tracing route to www.yahoo-ht2.akadns.net [209.131.36.158]
over a maximum of 30 hops:

1 <1 ms <1 ms <1 ms 192.168.2.1
2 <1 ms <1 ms <1 ms ip-24-65.datautama.net.id [203.89.24.65]
3 15 ms 25 ms 10 ms ip-24-1.datautama.net.id [203.89.24.1]
4 12 ms 12 ms 15 ms 202.59.203.241
5 10 ms 14 ms 10 ms 202.153.90.89
6 94 ms 99 ms 71 ms 202.153.90.225
7 110 ms 204 ms 225 ms 208.30.197.53
8 * 140 ms 125 ms sl-bb20-hk-14-0.sprintlink.net [203.222.38.37]
9 * 163 ms 161 ms sl-bb20-tok-15-0.sprintlink.net [203.222.33.88]

10 318 ms 245 ms 241 ms sl-bb21-sea-8-2.sprintlink.net [144.232.20.50]
11 305 ms 260 ms 222 ms sl-bb20-sea-15-0.sprintlink.net [144.232.6.89]
12 218 ms 216 ms 228 ms so-3-0-0.gar1.Seattle1.Level3.net [209.0.227.133
]
13 226 ms 225 ms 313 ms ae-1-53.mp1.Seattle1.Level3.net [4.68.105.65]
14 237 ms 232 ms 239 ms as-0-0.bbr2.SanJose1.Level3.net [64.159.0.218]
15 230 ms 235 ms 238 ms ae-23-54.car3.SanJose1.Level3.net [4.68.123.109]

16 232 ms 241 ms 365 ms 4.71.112.14
17 230 ms 238 ms 233 ms g-1-0-0-p171.msr2.sp1.yahoo.com [216.115.107.87]

18 345 ms 314 ms 258 ms UNKNOWN-209-131-32-23.yahoo.com [209.131.32.23]

19 311 ms 261 ms 235 ms f1.www.vip.sp1.yahoo.com [209.131.36.158]

Trace complete.

Sedangkan disisi cisco router datautama dapat diseting seperti berikut:

interface FastEthernet0/1

description Interface yang point to point dengan International

ip policy route-map from-int-to-user

duplex auto

speed auto

!

interface FastEthernet1/1

description Interface yang point to point dengan IDC

ip policy route-map from-nice-to-user

duplex auto

speed auto

!

access-list 120 remark traffic dari luar ke user

access-list 120 permit ip any 203.89.26.0 0.0.0.255

!

route-map from-nice-to-user permit 10

match ip address 120

set ip next-hop 203.89.24.178

!

route-map from-int-to-user permit 10

match ip address 120

set ip next-hop 203.89.24.66

Jika ingin lebih baik maka di sisi user harus menggunakan router bgp, utk memisahkan traffic user menggunakan BGP akan dijabarkan pada artikel berikutnya.

Selamat mencoba.

Contoh Desain Jaringan Internet untuk Pelanggan ISP

Akses Internet semakin banyak di butuhkan oleh berbagai pihak, baik untuk kantor, warnet, game online, sekolah, kampus bahkan dirumah.

Untuk lebih memudahkan pelanggan dalam mengimplementasikan jaringan Internet di lingkungannya berikut adalah beberapa contoh umum yang dapat digunakan dalam merancang jaringan komputer berbasis TCP/IP.


Contoh 1.

Akses Internet melalui:

Wireless LAN (WLAN) / Leased line

Implementasi untuk:

  • SOHO = Small Office Home Office atau UKM = Usaha Kecil Menengah
  • Kantor Cabang
  • Sekolah
  • Warung Internet atau Game Online

Aplikasi untuk:

  • Browsing Internet
  • Chatting
  • Download / Upload
  • VoIP = Voice Over Internet Protocol
  • Game online

Keterangan:

  • Jika diperlukan adanya server yang dapat diakses dari Internet yang terpisah dengan PC Router dapat menggunakan teknik Port Forwarding.

Image

Gambar 1. Jaringan Internet Sederhana menggunakan WLAN


Contoh 2.

Akses Internet melalui:

Wireless LAN (WLAN)

Implementasi untuk:
  • SOHO = Small Office Home Office atau UKM = Usaha Kecil Menengah
  • Kantor Cabang
  • Sekolah
  • Warung Internet atau Game Online

Aplikasi untuk:

  • Browsing Internet
  • Chatting
  • Download / Upload
  • VoIP = Voice Over Internet Protocol
  • Game online

Keterangan:

  • Terdapat DMZ = De Military Zone untuk sistem keamanan Server
  • Dapat menambahkan 1 Server yang dapat diakses dari Internet
  • Membutuhkan 4 IP Public = 1 IP Public untuk server yang dapat diakses langsung dari Internet, 1 IP Public sebagai gateway dari server yang ada, 1 IP Public sebagai Network Address, 1 IP Public sebagai Broadcast Address.

Image

Gambar 2. Jaringan Internet dengan DMZ menggunakan WLAN


Contoh 3.

Akses Internet melalui:

Wireless LAN (WLAN)

Implementasi untuk:

  • Perusahaan menengah
  • Kantor Pusat
  • Kampus

Aplikasi untuk:

  • Browsing Internet
  • Chatting
  • Download / Upload
  • VoIP = Voice Over Internet Protocol
  • Application Server

Keterangan:

  • Memerlukan alokasi /29 dengan 8 IP Public = 5 IP Public untuk server yang dapat diakses langsung dari Internet, 1 IP Public sebagai gateway dari server yang ada, 1 IP Public sebagai Network Address, 1 IP Public sebagai Broadcast Address.
  • Memiliki Netname sendiri yang dapat di whois dari Internet.
  • Membutuhkan Network/System Administrator.

Image

Gambar 3. Jaringan Internet dengan alokasi /29 menggunakan WLAN

Contoh 4.

Akses Internet melalui:

ADSL

Implementasi untuk:

  • SOHO = Small Office Home Office atau UKM = Usaha Kecil Menengah
  • Kantor Cabang
  • Sekolah
  • Warung Internet atau Game Online

Aplikasi untuk:

  • Browsing Internet
  • Chatting
  • Download / Upload
  • VoIP = Voice Over Internet Protocol
  • Game online

Keterangan:

  • Jika diperlukan adanya server yang dapat diakses dari Internet yang terpisah dengan PC Router dapat menggunakan teknik Port Forwarding, tetapi perlu diketahui teknologi ADSL tidak cocok untuk menempatkan web server di dalam jaringan karena sifatnya yang Asymmetric dimana Downstream biasanya besar tetapi Upstream kecil.

Image

Gambar 4.Jaringan Internet Sederhana Menggunakan ADSL menggunakan modem eksternal


Contoh 5.

Akses Internet melalui:

ADSL

Implementasi untuk:

  • SOHO = Small Office Home Office atau UKM = Usaha Kecil Menengah
  • Kantor Cabang
  • Sekolah
  • Warung Internet atau Game Online

Aplikasi untuk:

  • Browsing Internet
  • Chatting
  • Download / Upload
  • VoIP = Voice Over Internet Protocol
  • Game online

Keterangan:

  • Jika diperlukan adanya server yang dapat diakses dari Internet yang terpisah dengan PC Router dapat menggunakan teknik Port Forwarding, tetapi perlu diketahui teknologi ADSL tidak cocok untuk menempatkan web server di dalam jaringan karena sifatnya yang Asymmetric dimana Downstream biasanya besar tetapi Upstream kecil.
Image
Gambar 5.
Jaringan Internet Sederhana Menggunakan ADSL
menggunakan modem internal/USB

Contoh 6.

Akses Internet melalui:

ADSL

Implementasi untuk:

  • SOHO = Small Office Home Office atau UKM = Usaha Kecil Menengah
  • Kantor Cabang
  • Personal

Aplikasi untuk:

  • Browsing Internet
  • Chatting
  • Download / Upload
  • VoIP = Voice Over Internet Protocol
  • Game online

Image

Gambar 6. Jaringan Internet Personal menggunakan ADSL

Contoh 7.

Akses Internet melalui:

Wireless LAN (WLAN), ADSL, Fiber Optic, Leased Line dll.

Implementasi untuk:

  • APARTEMENT
  • Gedung Perkantoran

Aplikasi untuk:

  • Browsing Internet
  • Chatting
  • Download / Upload
  • VoIP = Voice Over Internet Protocol
  • Game Online

Keterangan:

  • Akses Internet melalui infrastruktur kabel telepon gedung , dimana Internet di tumpangkan pada kabel telepon yang ada di Apartment atau gedung perkantoran.
  • Pelanggan cukup menggunakan Home PNA Adaptor atau ADSL modem biasa sebagai pengganti modem.


Image
Gambar 7. Jaringan Internet menggunakan Home PNA

Jumat, 25 April 2008

Prevent IP spoofing with the Cisco IOS

Seperti telah diketahui, Internet memiliki banyak ancaman keamanan, salah satunya adalah IP address spoofing. Umumnya pada saat spoofing IP address, penyerang secara sederhana memalsukan sumber / source paket-paket sebagai usaha untuk menampilkannya sebagai bagian dari network internal. Untuk itu berikut adalah tiga cara untuk melindunginya

Block IP addresses

Langkah pertama dalam menghindari spoofing adalah dengan memblok IP address yang berisiko. Biasanya spoofed IP addresses adalah private IP address(RFC 1918) dan lainnya adalah tipe IP addresses yang khusus seperti misalnya APIPA (Automatic Private IP Address)

Berikut adalah daftar IP addresses dan subnet masknya yang harus di blok pada saat masuk ke network dari Internet:

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16
  • 127.0.0.0/8
  • 224.0.0.0/3
  • 169.254.0.0/16

Semua IP addresses private diatas tidak dapat di routekan pada Internet, IP addresses private tidak mungkin datang dari Internet, kalau sampai terjadi maka pasti itu adalah traffic yang berbahaya.

Sebagai tambahan, spoofed IP addreses lainnya adalah IP addreses yang digunakan di Internal organisasi. Jika Anda menggunakan private IP addreses , rangenya sudah masuk pada list diatas. Tetapi, jika menggunakan IP addresses public sendiri, maka harus dimasukkan ke list tersebut. Maksudnya adalah tidak mungkin source IP berasal dari IP blok yang digunakan di internal organisasi masuk dari interface Internet ke dalam, yang normal adalah dari IP blok internal ke Internet bukan sebaliknya.


Implement ACLs

Cara termudah untuk menghindari spoofing adalah menggunakan ingress filter pada semua Internet traffic. Filter tersebut akan men-drop semua traffic dengan source yang masuk dalam daftar IP diatas. atau dengan kata lain buat access control list (ACL) untuk mend-drop semua traffic inbound dengan source IP dalam range diatas.

Berikut adalah contoh configurasinya

Router# conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# ip access-list ext ingress-antispoof
Router(config-ext-nacl)# deny ip 10.0.0.0 0.255.255.255 any
Router(config-ext-nacl)# deny ip 172.16.0.0 0.15.255.255 any
Router(config-ext-nacl)# deny ip 192.168.0.0 0.0.255.255 any
Router(config-ext-nacl)# deny ip 127.0.0.0 0.255.255.255 any
Router(config-ext-nacl)# deny ip 224.0.0.0 31.255.255.255 any
Router(config-ext-nacl)# deny ip 169.254.0.0 0.0.255.255 any
Router(config-ext-nacl)# permit ip any any
Router(config-ext-nacl)# exit

Router(config)#int s0/0
Router(config-if)#ip access-group ingress-antispoof in

Dalam contoh diatas interface s0/0 adalah interface yang terhubung langsung ke Internet.

Internet service providers (ISP) harus menggunakan filter seperti ini pada jaringannya, seperti yang didefinisikan dalam RFC 2267.

Use reverse path forwarding (ip verify)

Cara lainnya adalah menggunakan reverse path forwarding (RDF) atau ip verify. di Cisco IOS, perintah untuk reverse path forwarding diawali dengan ip verify.

RDF bekerja seperti solusi anti-spam. dimana bagian penerimaan email melakukan pengecekkan source e-mail address, dan melakukan recipient lookup pada server pengirim untuk memastikan pengirim memang benar exist pada server tersebut. Jika pengirim tidak exist, maka server penerima akan men-drop email tersebut dan ini biasanya adalah spam.

RDF melakukan hal yang sama pada penerimaan paket-paket. alamat sumber / source IP address paket yang diterima dari Internet di cek apakah router tersebut memiliki routing table untuk mereplay paket tersebut. Jika tidak ada route di routing table untuk merespon source IP tersebut, maka seseorang sepertinya melakukan spoofed pada paket tersebut. dan router akan mendrop paket tersebut.

Berikut adalah caranya mengkonfigure EPF pada router:
Router(config)# ip cef
Router(config)# int serial0/0
Router(config-if)# ip verify unicast reverse-path

Sayangnya hal ini tidak dapat bekerja pada jaringan multi-homed

Sumber:

http://articles.techrepublic.com.com/5100-1035-6166899-2.html

Senin, 21 April 2008

Mendrop ICMP dari luar menggunakan APF

Flooding maning, flooding maning son !

Hari ini dns datautama di flood lagi port udp sudah minta di filter di upstream tetap saja tembus
akhirnya ada ide cemerlang dari mas Priyo Suyono yaitu katanya:

"kalau orang mau ngeflood pasti ngeping dulu, siapa tahu dengan di matiin icmp-nya floodnya berhenti"

bener juga masukkannya , karena biasanya flood + spoofing jadi belum tentu ip tsb yang melakukan flood , oleh karena itu dns baiknya tidak bisa di ping dari luar tetapi dns bisa ngeping ke luar.

yang saya lakukan adalah memblok ping/icmp dari luar jaringan datautama ke dns dengan mengkonfigurasi APF di dns server untuk tidak accept inbound icmp kecuali icmp-type 0 (echo request) dengan demikian dari dns bisa ping keluar dan dari pelanggan datautama bisa ping ke dns tapi dari luar tidak bisa ping ke dns, dengan pertimbangan kalau ada flood dari pelanggan lebih mudah analisa dan filternya.


Edit Konfigurasi APF

nano /etc/apf/conf.apf

dibagian:

# Common ICMP inbound (ingress) types
# 'internals/icmp.types' for type definition; 'all' is wildcard for any
#IG_ICMP_TYPES="3,5,11,0,30,8"
# Semua ICMP di drop kecuali echo-replay dan host2 yang diizinkan di allow_hosts.rules
IG_ICMP_TYPES="11,0"

lalu restart apf hasilnya dns hanya bisa diping dari host yang diizinkan pada /etc/apf/allow_hosts.rules



hasil pengetesan:

1. Dari dalam datautama

C:\Documents and Settings\Harijanto>ping 203.89.24.34

Pinging 203.89.24.34 with 32 bytes of data:

Reply from 203.89.24.34: bytes=32 time=162ms TTL=62
Reply from 203.89.24.34: bytes=32 time=3ms TTL=62
Reply from 203.89.24.34: bytes=32 time=3ms TTL=62
Reply from 203.89.24.34: bytes=32 time=9ms TTL=62

Ping statistics for 203.89.24.34:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 162ms, Average = 44ms


2. Dari Looking Glass CBN



CBN Looking Glass AS4787 function: ping for target: 203.89.24.34 via: ipv4 (if applicable)
PING 203.89.24.34 (203.89.24.34) 56(84) bytes of data.

--- 203.89.24.34 ping statistics ---
10 packets transmitted, 0 received, 100% packet loss, time 9078ms

3. Dari Global Internet

route-server.phx1>ping 203.89.24.34

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 203.89.24.34, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
route-server.phx1>

Selasa, 15 April 2008

BGP quick tips

There are three most important keywords which we should have in mind while setting up BGP neighbor relationship. Even sometimes when we have successful BGP relationship, we are not able to see routes in the routing table. Following are the three important keywords.

1)ebgp-multihop :- In EBGP, neighbor relationships are only formed if we have directly connected networks. We would require to use ebgp-multihop keyword with neighbor statement so that neighbors which are not directly connected can form relationship with each other. We need to specify a number with ebgp-multihop keyword, number can be between 1-255. This number represents how many hop counts is the router away.

2)update-source. We need to specify the interface which will be used to update neighbor table incase routers are not directly connected. Without update-source we will not be able to form BGP neighbor relationships. update-source keyword will update the interface which will be used to form neighbor relationship. see configuration example below for better understanding.

3) next-hop-self:- When ebgp relation replicates , next hop always changes.IBGP routers only connected with other ibgp routers in same AS will not be able to talk with routers outside the AS, if they are not directly connected with each other. We would require a next-hop-self keyword in the ibgp router which is directly connected with ebgp neighbor so that other router in same AS (IBGP) can talk with ebgp routers. Refer to configuration examples below:-

Lets assume that we have three routers and we have to setup a ebgp relationship in between them. Router A ( AS :- 34 Serial0 192.168.1.1 , loopback0 1.1.1.1) , RouterB ( AS 34, loopback0 2.2.2.2 , Serial0 192.168.1.2 , Serial1 172.16.1.1), RouterC ( AS 400 , loopback0 3.3.3.3, Serial0 172.16.1.2)

Lets start configuring Router A

router BGP 34 –> As soon as we type 34 BGP process will start in the background
neighbor 192.168.1.2 remote-as 34 –> Bgp will know that this is IBGP looking at AS

Router B

router BGP 34
neighbor 192.168.1.1 remote-as 34
neighbor 172.16.1.2 remote-as 400 –> neighbor relationship with ebgp peer.
neighbor 3.3.3.3 remote-as 400
neighbor 3.3.3.3 ebgp-multihop 255 –> 255 is number of hops that neighbor is away. we can use any number from 1-255, it can be more specific by using 1 or 2 but my personal fav is 255 as it avoids confusion.
neighbor 3.3.3.3 update-source loopback 0 –> Here is the idea, when its sourcing the packets its sourcing it from serial interface, we need to inform the otherside that source interface is not serial interface, it is looback interface so that it cann match ip ip’s with the right interface and form neighbor relationship.

we would require to do similar configuration on router c

router bgp 400
neighbor 172.16.1.1 remote-as 34
neighbor 2.2.2.2 remote-as 34
neighbor 2.2.2.2 ebgp-multihop 255
neighbor 2.2.2.2 update-source loopback 0

Now after forming the neighbro relationships we’ll use network commands to add neighbors in routing table. Network command in BGP is bit different then Network command in other routing protocols. we ‘ll need to define mask keywork with network command in order to advertise clasless network where as if it is using a default mask we can ignore the same.

Example

Router C

router bgp 400
neighbor 172.16.1.0 mask 255.255.255.0
note:- i cannot use network 172.16.0.0 command without mask keyword as it will treat this as class B network. For any customised subnetting scheme we ‘ll need to specify subnet mask with mask keyword in network command.

Even after configuring above, Router A will not be able to talk with Router C. If we will use show ip bgp command on Router A. we’ll see that it has a valid route for Router C but it will not be able to ping router c. This is because next hop will be 3.3.3.3 which is not directly connected with Router A. . First thing which will come in our mind is that rule of synchronisation has taken in to effect but even after disabling synchronisation between router a and router B, Router C will not be reachable. we would need a special command on Router B so that all IBGP peers of AS 34 can talk with AS 400

To troubleshoot this we can use “debug ip bgp updates” but before using this debug we should use ” clear ip bgp *” command. We’ll see that it will show us that there is no valid path for networks in Router C. Next hop should be Router B but in the updates it will show next hp as router c. to avoid the we will use next-hop self keyword in Router B.

Router B

router bgp 34

neighbor 192.168.1.1 next-hop-self

When Router B is sending an update to Router A it is sending the update without changging its next hop so router A will receive next hop as Router C which is not directly connected. To avoid this we will use next-hop-self command in Router B so that router A should receve valid route.

source: http://ciscotips.wordpress.com/2006/09/18/bgp-quick-tips/
bgp case study: http://www.cisco.com/warp/public/459/bgp-toc.html