Sunday, April 29, 2012

Forwarding loop detected [Solve]

What is a forwarding loop?
A forwarding loop is when a request passes through one proxy more than once. You can get a forwarding loop if
a cache forwards requests to itself. This might happen with interception caching (or server acceleration) configurations.
a pair or group of caches forward requests to each other. This can happen when Squid uses ICP, Cache Digests, or the ICMP RTT database to select a next-hop cache.

Forwarding loops are detected by examining the Via request header. Each cache which "touches" a request must add its hostname to the Via header. If a cache notices its own hostname in this header for an incoming request, it knows there is a forwarding loop somewhere.

Saturday, April 28, 2012

Optimizing and Security Hotspot YFI (part 2)


Squid
·         get the latest version squid, http://www.squid-cache.org and installing
cd /usr/local
wget http://www.squid-cache.org/Versions/v3/3.1/squid-3.1.19.tar.bz2
tar jxvf squid-3.1.19.tar.bz2
cd squid-3.1.19
./configure --prefix=/usr   --exec-prefix=/usr   --bindir=/usr/sbin  \
 --sbindir=/usr/sbin   --sysconfdir=/etc/squid   --datadir=/usr/share/squid  \
 --includedir=/usr/include   --libdir=/usr/lib   --libexecdir=/usr/lib/squid  \
 --localstatedir=/var   --sharedstatedir=/usr/com   --mandir=/usr/share/man  \
 --infodir=/usr/share/info   --x-includes=/usr/include   \ 

Tuesday, April 03, 2012

Cara Upgrade IOS Cisco Router 2800 series

Ada kerjaan dari kantor untuk setting router cisco 2800 series. Saat setting router, untuk routing BGP, muncul tulisan protocol no in this image
ROUTER(config)#router bgp 6xxxx Protocol not in this image

Artinya IOS tidak support untuk routing BGP. So, terpaksa harus dicari cara untuk upgrade IOSnya. Untunglah, om google masih berbaik hati untuk mencarikan. Setelah mencari beberapa referensi di internet, dengan bantuan om google, saya dapatkan cara untuk upgrade IOS. Ada 3 cara yang berbeda, dan itu semuanya saya lakukan.
Warning. Langkah dan command di bawah ini, bukanlah yang saya lakukan. Ini adalah referensi saya. Kemaren itu saya lupa untuk mendokumentasikan, jadi referensinya saja, saya copykan disini…

Cara Pertama
Untuk melakukan proses upgrade IOS yang diperlukan adalah :
- Kabel Console
- Kabel Cross untuk router ke laptop atau PC
- Software TFTP Server ( solarwinds )
Upgrade IOS router cisco

Berikut adalah langkah-langkah untuk melakukan upgrade IOS pada cisco router/switch :
· Hubungkan cable konsol ke port console yang ada di perangkat router atau switch dengan port serial atau usb yang ada pada PC / Laptop
· Hubungkan kabel cross / straight ke port Ethernet yang ada pada perangkat router / switch dengan port Ethernet yang ada pada laptop atau PC, configure interface yang terhubung dalam satu subnet yang sama.
contoh command untuk konfigurasi Interface pada router:
R1-Jkt-2801#conf t
R1-Jkt-2801(config)#interface fa0/0
R1-Jkt-2801(config-if)#no shut
R1-Jkt-2801(config-if)#ip address 10.10.10.1 255.255.255.0
· Pada PC atau laptop pasang IP address 10.10.10.2 subnet mask 255.255.255.0 dan default gateway 10.10.10.1
· Colokan kabel crossover dari fast Ethernet 0/0 ke PC atau Laptop Pastikan koneksi point to point antara PC dan router berjalan dengan baik , lakukan test ping dari PC ke ip tujuan 10.10.10.1 dan pastikan hasil sudah reply .
· Jalankan software TFTP server dan pastikan IOS baru sudah berada pada directory tftp server pada PC atau laptop. Pada percobaan kali ini akan menggunakan solarwinds karena sofrware ini lebih lengkap dan lebih bagus daripada TFTP biasa.
Solarwinds.net

Tampilan Solarwinds
Cara menempatkan file lokasi IOS yg akan di copy-kan ke router:
1. Klik file pada pojok kiri atas solarwinds
2. Pilih “Configure” trus “TFTP Root Directory” untuk menempatkan lokasi IOS

Solarwinds.net tftp server

-Back up configurasi yang ada pada perangkat sebelum melakukan upgrade :
- Pastikan size free atau space storage yang akan dimasukan IOS mencukupi untuk ukuran file IOS tersebut.
Command :
R1-Jkt-2801#dir flash: <– untuk melihat kapasitas flash: flash:
atau gunakan command berikut untuk melihat seluruh disk yang tersedia
R1-Jkt-2801#dir all
Directory of nvram:/
139 -rw- 8855 startup-config
140 —- 2982 private-config
1 -rw- 0 ifIndex-table
2 —- 12 persistent-data
155640 bytes total (141703 bytes free)
Directory of system:/
2 drwx 0 its
87 dr-x 0 memory
1 -rw- 8855 running-config
86 dr-x 0 vfiles
No space information available
Directory of flash:/
1 -rw- 20751928 Mar 1 1993 07:04:54 +07:00 c2801-ipbase-mz.124-15.T9.bin
2 -rw- 1888 Mar 1 1993 07:06:14 +07:00 sdmconfig-36xx-37xx.cfg
3 -rw- 16264 Mar 1 1993 07:06:26 +07:00 sdm.shtml
4 -rw- 3176448 Mar 1 1993 07:06:48 +07:00 sdm.tar
5 -rw- 1462 Mar 1 1993 07:07:00 +07:00 home.html
6 -rw- 216064 Mar 1 1993 07:07:14 +07:00 home.tar
32329728 bytes total (8155136 bytes free)
R1-Jkt-2801#
Back up IOS lama yang ada pada perangkat cisco dengan cara mengcopy ke tftp server
Command to Copy existing IOS ke tftp server :
R1-Jkt-2801#copy flash: tftp: <– copy dari flash Router ke tftp
Source filename c2801-ipbase-mz.124-15.T9.bin<– File IOS Lama
Address or name of remote host ? 10.10.10.2 <– ip address Host TFTP server
Destination filename [c2801-ipbase-mz.124-15.T9.bin] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
113153060 bytes copied in 52.588 secs (211752 bytes/sec)
R1-Jkt-2801#
Copy file IOS baru dari TFTP ke Router
Command :
R1-Jkt-2801#copy tftp: flash: <– copy ios dari tftp ke flash pada router
Source filename ? c2801-spservicesk9-mz.124-3i.bin<– File IOS Baru
Address or name of remote host ? 10.10.10.2 <– ip address Host TFTP server
Destination filename [c2801-spservicesk9-mz.124-3i.bin] <– Nama File tujuan
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
113153060 bytes copied in 52.588 secs (211752 bytes/sec)
R1-Jkt-2801#
- Verifikasi File yang telah dicopy dari TFTP server, hal ini sangat perlu dilakukan untuk mengetahui adanya corrupt file dalam proses transfer
Command :
R1-Jkt-2801#dir all <– mengecek apakah file sudah masuk pada directory
R1-Jkt-2801#verify flash: c2801-spservicesk9-mz.124-3i.bin
%Filesystem does not support verify operations
Verifying file integrity of flash: c2801.122 37.bin…………………………………………………………………………..
………………………………………………………………………………..
………………………………………………………………………………..
………………………………………………………………………………..
….Done!
Embedded Hash MD5 : 3FC77A9403C492C05E148BBF5FE03FDB
Computed Hash MD5 : 3FC77A9403C492C05E148BBF5FE03FDB
CCO Hash MD5 : 414495BF745929E2C5A5320C04F07CC6
Signature Verified
R1-Jkt-2801#
- Mengarahkan boot system ke file yang baru
R1-Jkt-2801# config t
R1-Jkt-2801(config)# boot system flash: c2801-spservicesk9-mz.124-3i.bin
R1-Jkt-2801(config)#exit
R1-Jkt-2801#write mem
- Restart perangkat cisco
R1-Jkt-2801# Reload
Tunggu sampai proses ini selesai dan pastikan kembali pada saaat booting IOS sudah mengarah ke file IOS yang baru, compare configurasi dengan configurasi sebelum di reload. Untuk mengecek apakah sudah terinstal IOS baru ketik perintah “Show version” maka akan ada keterangan nama IOS : c2801-spservicesk9-mz.124-3i.bin.

IOS, yang saya gunakan adalah bukan seperti IOS yang ada di referensi, melainkan IOS : c2801-adventerprisek9-mz.124-24.T1. Hasilnya adalah… ketika dijalankan, tidak bisa berjalan dengan sempurna, alias crash. Ternyata IOS yang digunakan, berbeda dengan hardwarenya, sepertinya IOSnya terlalu canggih, hehehe.... IOS yang c2801-adventerprisek9-mz.124-24.T1, harus diganti dengan c2801-spservicesk9-mz.124-3g

Cara Kedua
Karena IOS sudah crash, cara pertama tidak bisa digunakan lagi.  Akhirnya saya gunakan cara kedua. Berikut referensi cara kedua.

XMODEM

Xmodem dapat mentransfer data ke router melalui port console. Anda hanya bisa mendownload “files” ke router. Anda tidak bisa menggunakan xmodem untuk mengambil “files” dari router.

Sebagai contoh penggunaan xmodem untuk mendownload Cisco IOS software image ke dalam router Cisco 2620.

1. Jalankan program terminal emulator

Contoh ini menggunakan Windows HyperTerminal dengan konfigurasi 8-N-1 pada kecepatan/speed 9600 bps. Hubungkan serial port PC anda ke port console pada router. Ketika terhubung, anda akan mendapatkan tampilan prompt ROMmon (rommon 1>). Umumnya, jika IOS dan bootflash corrupt, tampilan akan masuk ke mode ROMmon. Jika IOS sebelumnya bermasalah dan tidak masuk ke ROMmon, anda dapat merubah configuration register untuk bisa masuk ke mode ROMmon, dari 0×2102 menjadi 0×0 (perintah show version), dengan cara sebagai berikut :

2620#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
2620(config)#con
2620(config)#conf
2620(config)#config−register 0×0
2620(config)#^Z
2620#
5d03h: %SYS−5−CONFIG_I: Configured from console by console
2620#
2620#reload

System configuration has been modified. Save? [yes/no]: n
Proceed with reload? [confirm]

5d03h: %SYS−5−RELOAD: Reload requested
System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)
Copyright (c) 1999 by cisco Systems, Inc.
TAC:Home:SW:IOS:Specials for info
C2600 platform with 65536 Kbytes of main memory

rommon 1 >

2. Setelah masuk ROMmon, ubah “baud rate” console dari 9600 bps menjadi 115200 bps untuk mempercepat download. Gunakan perintah confreg dan ikuti petunjuk pada layar.

rommon 1 >confreg
Configuration Summary
enabled are:
break/abort has effect
console baud: 9600
boot: the ROM Monitor

do you wish to change the configuration? y/n [n]: y
enable “diagnostic mode”? y/n [n]:
enable “use net in IP bcast address”? y/n [n]:
enable “load rom after netboot fails”? y/n [n]:
enable “use all zero broadcast”? y/n [n]:
disable “break/abort has effect”? y/n [n]:
enable “ignore system config info”? y/n [n]:
change console baud rate? y/n [n]: y
enter rate: 0 = 9600, 1 = 4800, 2 = 1200, 3 = 2400
4 = 19200, 5 = 38400, 6 = 57600, 7 = 115200 [0]: 7
change the boot characteristics? y/n [n]:

Configuration Summary
enabled are:
break/abort has effect
console baud: 115200
boot: the ROM Monitor

do you wish to change the configuration? y/n [n]:
You must reset or power cycle for new config to take effect.

rommon 2 >

3. Masukkan perintah reset

rommon 2> reset

Ketika router boot up dan masuk ROMmon, HyperTerminal mulai menampilkan karakter aneh/huruf yg tidak dikenal. Anda harus tutup HyperTeminal dan buka kembali HyperTerminal dan ubah kecepatan data rate menjadi 115200 bps yang sesuai dengan kecepatan console pada langkah 2.

4. Sekarang anda siap untuk menjalankan perintah xmodem. Sebelum menjalankan perintah xmodem, pastikan bahwa anda mempunya IOS baru di PC anda.

rommon 2 > xmodem −c c2600−is−mz.122−10a.bin

Do not start the sending program yet…
File size Checksum File name
9939820 bytes (0×97ab6c) 0×4991 c2600−is−mz.122−7a.bin

Warning

Peringatan:
.
.

All existing data in bootflash will be lost!
Invoke this application only for disaster recovery. Do you wish to continue?
y/n [n]: y Ready to receive file c2600−is−mz.122−10a.bin …

5. Dari menu bar HyperTerminal, Pilih Transfer > Send File.. dan tentukan nama IOS/lokasi (dengan tombol “browse”) dan pilih “protocol xmodem” seperti pada langkah 3 dan 4 dan klik tombol Send untuk mulai mentransfer.

6. Saat transfer file sudah komplit, akan muncul pesan di router sebagai berikut :

Erasing flash at 0×60fc0000
program flash location 0×60990000

Download Complete!

Jangan lupa anda merubah kembali kecepatan console ke 9600 bps dan boot sequence ke default dengan cara men “set” configuration register ke 0×2102.

rommon 12 > confreg 0×2102
You must reset or power cycle for new config to take effect

rommon 2 >reset

System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)
Copyright (c) 1999 by cisco Systems, Inc.
TAC:Home:SW:IOS:Specials for info
C2600 platform with 65536 Kbytes of main memory

program load complete, entry point: 0×80008000, size: 0×995ec8
Self decompressing the image : ################################
##################################################################
##################################################################
######################## [OK]

……………………….

Cisco Internetwork Operating System Software
IOS ™ C2600 Software (C2600−IS−M), Version 12.2(10a), RELEASE SOFTWARE (fc1)

Copyright (c) 1986−2002 by cisco Systems, Inc.
Compiled Tue 21−May−02 14:16 by pwade
Image text−base: 0×80008088, data−base: 0×810ABB08

cisco 2620 (MPC860) processor (revision 0×100) with 61440K/4096K bytes of memory.
Processor board ID JAB03110MUB (3691217154)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
1 FastEthernet/IEEE 802.3 interface(s)
2 Voice FXS interface(s)
32K bytes of non−volatile configuration memory.
16384K bytes of processor board System flash (Read/Write)

Press RETURN to get started!


Cara Ketiga.
Karena sangat lambat untuk transfer data, saya cancel cara kedua, kemudian saya gunakan cara ketiga. Referensi yang digunakan ada cisco seri 2600, ternyata bisa juga digunakan untuk seri 2800, karena seri 2800 support tftpdnld, berikut referensinya…


Menggunakan perintah tftpdnld

Catatan : Perintah tftpdnld hanya terdapat pada router Cisco seri 2600.

Pastikan anda sudah menghubungkan PC yang terinstall TFTP-Server (berisi file IOS) menggunakan kabel ethernet (RJ.45) ke port Ethernet 0 pada router Cisco.

Perintah tftpdnld pada router Cisco dapat digunakan untuk mendownload Cisco IOS software image dari “remote server” ke dalam memory flash dengan aplikasi TFTP-Server.

tftpdnld—Perintah untuk mulai meng-copy dari TFTP-server.

Berikut adalah variabel yang diperlukan:

* IP_ADDRESS—Alamat IP dari router yang anda gunakan (alamat IP ethernet 0).
* IP_SUBNET_MASK—Subnet mask untuk alamat IP router anda.
* DEFAULT_GATEWAY—Default gateway untuk router anda.
* TFTP_SERVER—Alamat IP dari TFTP-Server, tempat menyimpan IOS yang akan anda download ke router.
* TFTP_FILE—Nama file yang ingin anda download.

Variabel berikut adalah optional:

* TFTP_VERBOSE—Print setting. 0=quiet, 1=progress, 2=verbose. The default is 1.
* TFTP_RETRY_COUNT—Retry count for ARP and TFTP. The default is 7.
* TFTP_TIMEOUT—Overall timeout of the download operation in seconds. The default is 2400 seconds.
* TFTP_CHECKSUM—Performs a checksum test on the image. 0=no, 1=yes. The default is 1.

Syntax untuk mendefinisikan variable adalah sebagai berikut:
VARIABLE_NAME=value

Setelah konfigurasi selesai, anda harus mengulangi lagi perintah tftpdnld. Sebagai contoh:

rommon 1 > tftpdnld
rommon 2 > IP_ADDRESS=172.15.19.11
rommon 3 > IP_SUBNET_MASK=255.255.255.0
rommon 4 > DEFAULT_GATEWAY=172.15.19.1
rommon 5 > TFTP_SERVER=172.15.20.10
rommon 6 > TFTP_FILE=/tftpboot/c2600-i-mz
rommon 7 > TFTP_VERBOSE=1
rommon 8 > tftpdnld

IP_ADDRESS=172.15.19.11
IP_SUBNET_MASK=255.255.255.0
DEFAULT_GATEWAY=172.15.19.1
TFTP_SERVER=172.15.20.10
TFTP_FILE=/tftpboot/2600-i-mz
TFTP_VERBOSE=1

Invoke this command for disaster recovery only.
WARNING: all existing data in flash will be lost!
Do you wish to continue? y/n: [n]:

Enter y untuk memulai download Cisco IOS software image. Ketika proses sudah komplit/selesai, mode ROMmon akan tampil kembali di layar anda.

Langkah terakhir adalah melakukan “reset” agar Router segera membaca IOS yang baru didownload.

rommon 9 >reset

Dengan cara ketiga, sangat cepat untuk upgrade IOS, tidak sampai 5 menit. Selesai… akhirnya saya mendapatkan cisco 2800 IOS yang sudah terupgrade, dan siap untuk disetting.

Monday, April 02, 2012

Optimizing and Security Hotspot YFI (part 1)

In this article, I try to optimize my server hotspot yfi, by adding squid, shorewall, and updating coova chilli. This post continued from previous post about Install Hotspot YFI. See the previous post in part 1 and part 2.

Upgrade Coova Chilli.

Important points to remember. The UAM Port is by default on 3990 when you compile the CoovaChilli package yourself, and on 3660 when using !CoovaChilliAP Firmware.

UAM Port
3990
COA Port
3799

 

Install CoovaChilli


  • First, stop the service chilli, and remove the old coova chilli. Execute the following commands: