Senin, 07 September 2009

Configure a Cisco ASA 5505 with Dual ISP Backup Connection

Harris Andrea is a Cisco Certified Network Professional (CCNP) and Cisco Certified Security Professional (CCSP) with more than 10 years experience in the networking field.

Configure a Cisco ASA 5505 with Dual ISP Backup Connection

In this article I will explain how to configure a Cisco ASA 5505 firewall to connect to dual ISPs for redundancy purposes. Suppose that we have a primary high-speed ISP connection, and a cheaper DSL line connected to a Secondary ISP. Normally all of our traffic should flow through the primary ISP. If the primary link fails, the secondary DSL connection should be utilized for Internet access. Please note that the above scenario is valid only for Outbound traffic (i.e. from our internal network towards the Internet). The functionality that I will describe below works for ASA 5505 version 7.2(1) and above.

Assume that we are assigned a static Public IP address of 100.100.100.1 from Primary ISP and another static Public IP address of 200.200.200.1 from our Backup ISP. We will use Ethernet 0/0 for connecting to Primary ISP, Ethernet 0/1 for connecting to our Internal LAN, and Ethernet 0/2 for connecting to our Backup ISP. We will create three VLANs to support our configuration. VLAN1 (the default Vlan) will be assigned to Ethernet 0/1 (inside), VLAN2 will be assigned to Ethernet 0/0 (primary-isp) and VLAN3 will be assigned to Ethernet 0/2 (backup-isp). We also have to configure two static default routes pointing to the ISP gateway address. The primary ISP default route shall have a metric of 1 and the backup ISP default route shall have a metric bigger than 1 (let's say 2). Let us see the configuration below:

ASA5505(config)# interface ethernet 0/0
ASA5505(config-if)# switchport access vlan 2
ASA5505(config-if)# no shutdown

ASA5505(config)# interface ethernet 0/1
ASA5505(config-if)# switchport access vlan 1
ASA5505(config-if)# no shutdown

ASA5505(config)# interface ethernet 0/2
ASA5505(config-if)# switchport access vlan 3
ASA5505(config-if)# no shutdown

ASA5505(config)# interface vlan 1
ASA5505(config-if)# nameif inside
ASA5505(config-if)# security-level 100
ASA5505(config-if)# ip address 192.168.1.1 255.255.255.0
ASA5505(config-if)# no shutdown

ASA5505(config)# interface vlan 2
ASA5505(config-if)# nameif primary-isp
ASA5505(config-if)# security-level 0
ASA5505(config-if)# ip address 100.100.100.1 255.255.255.0
ASA5505(config-if)# backup interface vlan 3
ASA5505(config-if)# no shutdown

ASA5505(config)# interface vlan 3
ASA5505(config-if)# nameif backup-isp
ASA5505(config-if)# security-level 1
ASA5505(config-if)# ip address 200.200.200.1 255.255.255.0
ASA5505(config-if)# no shutdown

ASA5505(config)# route primary-isp 0.0.0.0 0.0.0.0 100.100.100.2 1
ASA5505(config)# route backup-isp 0.0.0.0 0.0.0.0 200.200.200.2 2

Failover ASA

asa5500(config)# sla monitor 100
asa5500(config-sla-monitor)# type echo protocol ipIcmpEcho 100.100.100.2 interface outside
asa5500(config-sla-monitor-echo)# timeout 3000
asa5500(config-sla-monitor-echo)# frequency 10
asa5500(config)# sla monitor schedule 100 life forever start-time now
asa5500(config)# track 1 rtr 100 reachability
asa5500(config)# route outside 0.0.0.0 0.0.0.0 100.100.100.2 track 1
asa5500(config)# route backup-isp 0.0.0.0 0.0.0.0 200.200.200.2 254

2 Default Gateway

Berdasarkan pengalaman pribadi, mungkin berguna..
1. Buat access list

access-list 1 permit xxx.xxx.xxx.xxx aaa.aaa.aaa.aaa
access-list 2 permit yyy.yyy.yyy.yyy aaa.aaa.aaa.aaa

dimana xxx dan yyy adalah ip public dari masing-masing provider dan aaa adalah subnetmask-nya wildcard mask (reverse mask)

2. Buat route-map

route-map 2GW permit 10
match ip address 1
set ip default next-hop ip_serial_0
!
route-map 2GW permit 20
match ip address 2
set ip default next-hop ip_serial_1
!
route-map 2GW permit 30
set default interface Null0

3. Tidak usah diberikan Ip route 0.0.0.0

Maka bila diberikan command sh ip route tidak terdapat 0.0.0.0, hal ini tidak masalah karena sudah diatur oleh rules access list yg kita buat…

4. Coba tracert dari masing-masing ip subnet mask tersebut

Load Balancing Web server dengan DNS

Load balancing (pembagian beban) adalah salah satu metode untuk mengurangi beban pada server, karena permintaan dari client akan dibagi ke server lain.
ada beberapa software dan hardware yang mampu menjalankan service ini, tapi pada kesempatan ini akan membahas load balancing web server dengan DNS sebagai load balancernya.

sebagai contoh konfigurasi load balancing dengan DNS sebagai load balancernya.
misalkan

  1. DNS, mempunyai IP address 10.10.10.2
  2. NS1, mempunyai IP address 10.10.10.3
  3. NS2, mempunyai IP address 10.10.10.4
  4. NS3, mempunyai IP address 10.10.10.5
  5. NS4, mempunyai IP address 10.10.10.6
berikut adalah konfigurasi pada DNS :

DNS IN A 10.10.10.2
NS1 IN A 10.10.10.3
NS2 IN A 10.10.10.4
NS3 IN A 10.10.10.5
NS6 IN A 10.10.10.6

www0 IN CNAME NS1
www1 IN CNAME NS2
www2 IN CNAME NS3
www3 IN CNAME NS4

www IN CNAME www0
www IN CNAME www1
www IN CNAME www2
www IN CNAME www3

jadi ketika client mengetikkan www.namadomain.com, maka permintaan client akan di lempar ke salah satu server tersebut.


VRRP Virtual Router Redundancy Protocol [Mikrotik]

Virtual Router atau VRRP Group merupakan sekumpulan router yang berfungsi untuk kebutuhan redundancy. Secara konseptual VRRP mempunyai satu device yang berperan sebagai master dan beberapa router yang akan berfungsi sebagai backup. Pada VRRP, Router Master prioritynya diset 255, sedangkan pada Backup diset antara 1-254, dengan nilai default prioritynya adalah 100 yang masing-masingnya mempunyai sebuah VRID (Virtual Router ID) yang unik.
A. Konfigurasi sebagai Master State
  1. Login sebagai admin dengan password sesuai yang anda set
  2. Aktifkan program winbox dan masuk ke tab terminal / console mode jika anda menguasai.
  3. Buat ip pada masing-masing interface pada router master.
  4. Masuk ke ip vrrp, lalu masukan interface dan prioritynya. (Pada router Master prioritynya 255)
  5. Kemudian lihat dengan perintah print, apakah router tersebut sudah menjadi master atau belum. Apabila sudah terdapat flag ‘M’ pada sisi sebelah kiri, maka sudah berfungsi sebagai master.
  6. Setelah itu masukan alamat ipnya yang akan difungsikan sebagai ip aliasing pada router tersebut.
  7. Terakhir lihat status ip tersebut apakah sudah aktif atau belum dengan melihat flag ‘A’ yang ada pada sisi sebelah kiri.

B. Konfigurasi sebagai Backup State
Konfigurasi pada router Backup tidak berbeda halnya dengan konfigurasi router master.

  1. Login sebagai admin sesuai password yang sudah anda set.
  2. Aktifkan program winbox dan masuk ke terminal atau consolemode jika anda menguasai
  3. Buat ip pada masing-masing interface di router backup.
  4. Masuk ke ip vrrp, lalu masukan interface dan prioritynya.(Pada router backup prioritynya dari 1-254)
  5. Kemudian lihat dengan perintah print. Apabila sudah terdapat flag ‘B’ pada sisi sebelah kiri, maka sudah berfungsi sebagai Backup.
  6. Setelah itu masukan alamat ipnya yang akan difungsikan sebagai ip aliasing pada router tersebut.

Terakhir lihat status IP tersebut apakah sudah aktif atau belum dengan melihat flag ‘A’ yang ada pada sisi sebelah kiri.

Secara singkat setelah anda pusing melakukan konfigurasi tersebut diatas, sebenarnya fungsi utama dari feature VRPP ini adalah kita akan mempunyai router cadangan. Jadi apabila router master kita terkena gangguan / rusak entah apapun penyebabe maka kita masih mempunyai router cadangan yang dapat berfungsi sebagai router master.