Saturday, June 05, 2010

Pengaturan Quagga

Berikut adalah tulisan mengenai bagaimana memasang quagga dalam Linux OS. Unduh versi offline di sini.

Instalasi Quagga

apt-get install quagga

Konfigurasi Quagga

  1. Copy file-file yang terletak pada direktori /usr/share/doc/quagga/examples/ berikut:
    • zebra.conf.sample
    • vtysh.conf.sample
    • ripd.conf.sample
    • ospfd.conf.sample
    Menuju direktori /etc/quagga/ dengan menghilangkan .sample pada filename-nya.
    /usr/share/doc/quagga/examples//etc/quagga/
    zebra.conf.samplezebra.conf
    vtysh.conf.samplevtysh.conf
    ripd.conf.sampleripd.conf
    ospfd.conf.sampleospfd.conf
    Contoh perintah yang digunakan untuk melakukan copy:
    cp /usr/share/doc/quagga/examples/zebra.conf.sample /etc/quagga/zebra.conf
  2. Edit file /etc/quagga/daemons dengan perintah:
  3. nano /etc/quagga/daemons Ubah nilai "no" pada zebra, ospfd, dan ripd menjadi "yes". Isi file yang telah diubah adalah sebagai berikut:
    # This file tells the quagga package which daemons to start.
    #
    # Entries are in the format: =(yes|no|priority)
    #   0, "no"  = disabled
    #   1, "yes" = highest priority
    #   2 .. 10  = lower priorities
    # Read /usr/share/doc/quagga/README.Debian for details.
    #
    # Sample configurations for these daemons can be found in
    # /usr/share/doc/quagga/examples/.
    #
    # ATTENTION: 
    #
    # When activation a daemon at the first time, a config file, even if it is
    # empty, has to be present *and* be owned by the user and group "quagga", else
    # the daemon will not be started by /etc/init.d/quagga. The permissions should
    # be u=rw,g=r,o=.
    # When using "vtysh" such a config file is also needed. It should be owned by
    # group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too.
    #
    zebra=yes
    bgpd=no
    ospfd=yes
    ospf6d=no
    ripd=yes
    ripngd=no
    isisd=no
  4. Restart quagga dengan menggunakan perintah:
  5. /etc/init.d/quagga restart

Konfigurasi Zebra

telnet localhost 2601
Login dengan password zebra (untuk seterusnya, password yang digunakan dalam quagga adalah zebra)

Setting IP address untuk tiap interface yang digunakan.

  1. Masuk menuju configure terminal.
  2. Router> enable
    Router# configure terminal
  3. Berikan IP address untuk interface yang digunakan. Misal interface eth0 dengan IP address 192.168.1.1/24:
  4. Router(config)# interface eth0
    Router(config-if)# ip address 192.168.1.1/24
  5. Jika sudah selesai, kembali ke mode priviledged exec (Router#) dengan menggunakan perintah end dan simpan konfigurasi dengan perintah wr atau copy running-config startup-config.
  6. Cek apakah tiap interface sudah memiliki IP address dengan salah satu perintah berikut:
    • show running-config
    • show interface
  7. Gunakan perintah exit untuk keluar dari zebra.

Konfigurasi RIP Daemon

telnet localhost 2602
Untuk menggunakan RIP (Routing Information Protocol), kita harus mendaftarkan network mana saja yang berhubungan langsung dengan router.
  1. Masuk ke configure terminal.
  2. Masuk ke RIP dengan perintah
  3. ripd(config)# router rip
  4. Masukkan network IP address(es) yang berhubungan dengan router. Misal salah satu network yang berhubungan dengan router ini adalah 192.168.1.0/24:
  5. ripd(config-router)# network 192.168.1.0/24
  6. Ulangi langkah no 3 untuk semua address yang terhubung.
  7. Simpan konfigurasi.
  8. Untuk melihat hasil, masukkan perintah
  9. ripd# show ip rip
    Jika konfigurasi RIP benar, akan muncul rute dengan kode R di depannya.

Konfigurasi OSPF Daemon

telnet localhost 2604
Untuk menggunakan OSPF (Open Shortest Path First), kita harus mendaftarkan network mana saja yang berhubungan langsung dengan router. Cara konfigurasi hampir sama dengan RIP daemon.
  1. Masuk configure terminal.
  2. Masuk ke OSPF dengan perintah:
  3. ospfd(config)# router ospf
  4. Masukkan network IP adress(es) yang berhubungan langsung dengan router. Misal salah satu network yang berhubungan dengan router ini adalah 192.168.1.0/24:
  5. ospfd(config-router)# network 192.168.1.0/24 area 0
  6. Simpan konfigurasi.
  7. Untuk melihat hasil, masukkan perintah:
  8. ospfd# show ip ospf route
    ospfd# show ip ospf interface
    Jika konfigurasi OSPF benar, akan muncul rute dengan kode O di depannya.

Contoh Desain Jaringan

Keterangan interface pada router A:
  • eth0: 192.168.2.1/24
  • eth1: 192.168.1.1/24
Keterangan interface pada router B:
  • eth0: 192.168.2.2/24
  • eth1: 192.168.3.1/24

Setting Zebra

Router A

telnet localhost 2601
Password: zebra
Router> enable
Password: zebra
Router# configure terminal
Router(config)# interface eth0
Router(config-if)# ip address 192.168.2.1/24
Router(config-if)# interface eth1
Router(config-if)# ip address 192.168.1.1/24
Router(config-if)# end
Router# wr
Router# exit

Router B

telnet localhost 2601
Password: zebra
Router> enable
Password: zebra
Router# configure terminal
Router(config)# interface eth0
Router(config-if)# ip address 192.168.2.2/24
Router(config-if)# interface eth1
Router(config-if)# ip address 192.168.3.1/24
Router(config-if)# end
Router# wr
Router# exit

Setting RIP Daemon

Router A

telnet localhost 2602
Password: zebra
ripd> enable
ripd# configure terminal
ripd(config)# router rip
ripd(config-router)# network 192.168.1.0/24
ripd(config-router)# network 192.168.2.0/24
ripd(config-router)# end
ripd# wr
ripd# exit

Router B

telnet localhost 2602
Password: zebra
ripd> enable
ripd# configure terminal
ripd(config)# router rip
ripd(config-router)# network 192.168.2.0/24
ripd(config-router)# network 192.168.3.0/24
ripd(config-router)# end
ripd# wr
ripd# exit

Setting OSPF Daemon

Router A

telnet localhost 2604
Password: zebra
ospfd> enable
ospfd# configure terminal
ospfd(config)# router ospf
ospfd(config-router)# network 192.168.1.0/24 area 0
ospfd(config-router)# network 192.168.2.0/24 area 0
ospfd(config-router)# end
ospfd# wr
ospfd# exit

Router B

telnet localhost 2604
Password: zebra
ospfd> enable
ospfd# configure terminal
ospfd(config)# router ospf
ospfd(config-router)# network 192.168.2.0/24 area 0
ospfd(config-router)# network 192.168.3.0/24 area 0
ospfd(config-router)# end
ospfd# wr
ospfd# exit

5 comments:

  1. wew komplit,perlu ni.. mirip2 setting router cisco ya,cuman ada nama daemonnya.. hehe

    ReplyDelete
  2. Biasa aja.. intinya sebenarnya ga sebanyak ini.. Tulisan ini khusus untuk yang belum pernah kenal jaringan komputer..

    ReplyDelete
  3. Suon2... haha...

    ReplyDelete
  4. monggo2.. ga usah sungkan2.. :D

    ReplyDelete

Please leave a footprint.