Monday, February 12, 2007

Update IOS Switch

Buat admin yang (mungkin) terkena amnesia mendadak dan tiba2 lupa password switch catalystnya , bisa mencoba metode ini untuk merecovery password. pengalaman pribadi nih :P. udah coba dioprek di Catalyst 2950 & 2960 ,dan menurut white papper juga berlaku untuk switch seri 35xx keatas

buat yang mo nyoba, ga disaranin dicoba di switch yang masih operasional, kalo ada apa-apa dipecat gw ngga tanggung jawab

pertama-tama tentunya harus punya akses fisik ke switch yang mau direcovery. Nah untuk langkah awal kita coba grepe2 badan switch kita ini dulu :D, biasanya selain button power ada satu button lagi yang labelnya MODE. ok kalo udah ketemu jangan dipencet dulu.. idupin switchnya dulu ( ya iya lah.. :P) tapi jangan kelamaan, pas proses start-up cepet2 pencet tombol MODE hingga tampilannya berubah kaya gini :

The system has been interrupted prior to initializing the
flash filesystem. The following commands will initialize
the flash filesystem, and finish loading the operating
system software:

flash_init
load_helper
boot

nah trus tungguin sampe keluar prompt kaya gini neh :

Switch:

setelah itu masukin perintah :

Switch: load_helper

Load_helper — Load and initialize a helper image
klo kata systemnya sih fungsinya itu….. buat nambah2in perintah yg di hidden.
ok, lanjut masukin perintah ini :

Switch: flash_init
Initializing Flash…
flashfs[0]: 18 files, 2 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 7741440
flashfs[0]: Bytes used: 3966464
flashfs[0]: Bytes available: 3774976
flashfs[0]: flashfs fsck took 7 seconds.
…done initializing flash.
Boot Sector Filesystem (bs:) installed, fsid: 3
Parameter Block Filesystem (pb:) installed, fsid: 4

fungsinya adalah untuk inisialisasi flash system image yg ada pada switch.
Setelah itu kita bisa mengecek isi dari switch ini dengan menggunakan perintah “dir”
contoh:

switch: dir

List of filesystems currently registered:

flash[0]: (read-write)
xmodem[1]: (read-only)
null[2]: (read-write)
bs[3]: (read-only)

silahkan jalan2 & liat2 jeroan nih switch sekarang :), tapi inget.. tujuan kita adalah mereset password switch yang dilupain ama admin nyah okeh.. hm.. dari list diatas itu ada folder2 yg ada di dalem switch, mari kita intip isi flash nya

switch: dir flash:
Directory of flash:/

2 -rwx 2664051 c2950-i6q4l2-mz.121-11.EA1.bin
3 -rwx 269 env_vars
4 -rwx 2296 vlan.dat
5 -rwx 3441 config.text
6 -rwx 5 private-config.text
7 drwx 704 html
19 -rwx 109 info
20 -rwx 109 info.ver

3774976 bytes available (3966464 bytes used)


oke, gw review dikit beberapa file diatas yang menarik :

c2950-i6q4l2-mz.121-11.EA1.bin <—- ini cisco IOS nya vlan.dat <—- file konfigurasi vlan neeh… config.text <—- file konfigurasi switch, alias startup-config nyah nah.. , kepikiran sesuatu ngga :D, klo kita bisa edit file config.text yang mana adalah akan diload waktu switch booting. kita bisa memanipulasi tuh enable secret , that’s how it works okeh, kita langsung ke serangan utama (weleh kayak mo ngapain aja, ) rename file config.text menjadi config.text.lama , caranya adalah sebagai berikut : switch: rename flash: config.text flash: config.text.lama kemudian kita cek hasil nya : switch: dir flash: Directory of flash:/ 2 -rwx 2664051 c2950-i6q4l2-mz.121-11.EA1.bin
3 -rwx 269 env_vars
4 -rwx 2296 vlan.dat
5 -rwx 3441 config.text.lama
6 -rwx 5 private-config.text
7 drwx 704 html
19 -rwx 109 info
20 -rwx 109 info.ver

3774976 bytes available (3966464 bytes used)
switch:

nah sekarang nama filenya udah berubah , sekarang reboot switchnya dengan perintah :

switch: boot

setelah kita eksekusi maka akan keluar seperti:

File “flash:/c2950-i6q4l2-mz.121-11.EA1.bin” uncompressed and installed, entry point: 0×80010000
executing…

Restricted Rights Legend

Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.

cisco Systems, Inc.
170 West Tasman Drive
San Jose, California 95134-1706

Cisco Internetwork Operating System Software
IOS ™ C2950 Software (C2950-I6Q4L2-M), Version 12.1(11)EA1, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Wed 28-Aug-02 10:25 by antonino
Image text-base: 0×80010000, data-base: 0×80528000

Initializing flashfs…
flashfs[1]: 18 files, 2 directories
flashfs[1]: 0 orphaned files, 0 orphaned directories
flashfs[1]: Total bytes: 7741440
flashfs[1]: Bytes used: 3966464
flashfs[1]: Bytes available: 3774976
flashfs[1]: flashfs fsck took 7 seconds.
flashfs[1]: Initialization complete.
Done initializing flashfs.
POST: System Board Test : Passed
POST: Ethernet Controller Test : Passed
ASIC Initialization Passed

POST: FRONT-END LOOPBACK TEST : Passed
cisco WS-C2950-24 (RC32300) processor (revision G0) with 20402K bytes of memory.
Processor board ID FOC0652Y1DH
Last reset from system-reset
Running Standard Image
24 FastEthernet/IEEE 802.3 interface(s)

32K bytes of flash-simulated non-volatile configuration memory.
Base ethernet MAC Address: 00:0B:BE:DE:C2:40
Motherboard assembly number: 73-5781-11
Power supply part number: 34-0965-01
Motherboard serial number: FOC06520A0V
Power supply serial number: PHI06470GKF
Model revision number: G0
Motherboard revision number: A0
Model number: WS-C2950-24
System serial number: FOC0652Y1DH

— System Configuration Dialog —

Would you like to enter the initial configuration dialog? [yes/no]:


well.. lihat apa yang kita lakukan…, kayak switch baru kan
okeh ke langkah selanjutnya dulu.. pilih no untuk membypass initial configuration
langkah berikutnya :

Switch>en
Switch#dir
Directory of flash:/

2 -rwx 2664051 Mar 01 1993 00:03:22 c2950-i6q4l2-mz.121-11.EA1.bin
3 -rwx 269 Jan 01 1970 00:01:24 env_vars
4 -rwx 2296 Mar 28 1993 22:10:35 vlan.dat
5 -rwx 3441 Mar 08 1993 22:54:27 config.text.lama
6 -rwx 5 Mar 08 1993 22:54:27 private-config.text
7 drwx 704 Mar 01 1993 00:03:59 html
19 -rwx 109 Mar 01 1993 00:04:01 info
20 -rwx 109 Mar 01 1993 00:04:01 info.ver

7741440 bytes total (3774976 bytes free)
Switch#rename flash:config.text.lama flash:config.text
Destination filename [config.text]?

maksud perintah ini adalah mengganti file config.text (yang masih polosan) dengan file config.text.lama (config yang asli) sehingga settingan2 kita yang lama tetep muncul. Kecuali kalo emang niat diilangin sekalian :P, okeh..

untuk memasukkan configurasi lama kedalam running config, cukup dengan perintah :

Switch# copy flash: config.text system: running-config
Source filename [config.text]?
Destination filename [running-config]?

yup, anda sudah kembali kawan

SwitchPuntodewo#

sekarang enaknya ngapain ya…, hehe. ya jelas.. kita ubah enable secret nyaa… hehe…

SwitchPuntodewo# configure terminal
SwitchPuntodewo (config)# enable secret khayangan
SwitchPuntodewo (config)# exit
SwitchPuntodewo# write memory
Building configuration…
[OK]

yup, silahkan letakkan kembali switch anda ditempat yang terlihat manis..
dan lanjutkan maen game online lagi heheh…

Saturday, February 10, 2007

Recovering IOS from ROMMON via TFTP

This information is here primarily for my reference at customer sites; for some odd reason, I seem to be recovering IOS images through ROMMON quite a bit lately. These are the minimum fields to get this going through TFTP rather than XModem.

rommon 1 > IP_ADDRESS=192.168.1.100
rommon 2 > IP_SUBNET_MASK=255.255.255.0
rommon 3 > DEFAULT_GATEWAY=192.168.1.1
rommon 4 > TFTP_SERVER=192.168.1.50
rommon 5 > TFTP_FILE=c2600-adventerprisek9-mz.124-5a.bin
rommon 6 > tftpdnld (this command kicks off the tftp download)

Saturday, November 18, 2006

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/ip_firewall_address_list_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. 

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

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/ip_firewall_address_list_nice.php

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

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

 

Selamat mencoba.






Last Updated ( Wednesday, 08 November 2006 )

Tuesday, October 03, 2006

kompres pake tar dan gz .. sok hiap wae

Unix file compression utilities:



There are two commonly used free file compression utlities that you will find in wide use on the internet.



tar - tape archive



This utility basically appends a list of files &/or directories into one flat file. This was commonly used in the early days of Unix when writing large amounts of information to a tape.

Creating a tape archive:



tar -cf archive.tar myDirectories/



Note - using the "v" flag prints out extra messages, as verbose mode, though it's not related to extracting files.

Listing the contents of an archive:



tar -tf archive.tar



It is generally a good idea to preview the contents of tape archives before unpacking them. This can become a serious problem if you are currently root, and the archive just happens to jump out of the current directory, and write over some important system files.

Extracting all files from an archive:



tar -xf archive.tar



To extract just partial pieces from the archive, supply a file or directory name after the archive name. You can list as many as desiered here, separated by spaces.



tar -xf archive.tar filename



gzip - gnu zip



This is a gnu utility that is used to compress/decompress a file. Generally, if there is a set of files to compress, they will be sent through tar first to create a single file.

Compress:



gzip archive.tar

Decompress:



gunzip archive.tar.gz

Merged filenames:



Sometimes, you will download files ending with the extension *.tgz - these are essentially identical to files ending with *.tar.gz files. You can gunzip them, and untar them just the same way. If you're working with a recent version of gnu tar, you may be able to take a shortcut, as described below.



Merging commands



The "z" flag works with gzip, to either create a tar/gzipped archive:



tar -czvf archive.tgz files/



...or decompress a tar/gzipped archive:



tar -xzvf archive.tgz



tar to a pipe



If you're concerned with filling your disk during a tar, or with filling a disk cache, you can also tar to a pipe, which doesn't write the compressed file to disk, but instead just stores it temporarily in memory.



tar -cf - ./filename | (cd other-directory; tar -xf -)