Routing Fundamental, Routing Policy and Firewall Filter

A: Ran hari ini belajar apa lu?
Aku: ini lagi belajar juniper, suruh dirusuh pak bos ambil juniper sekalian.

Ini pembahasan tentang konfigurasi routing static, OSPF, routing policy dan firewall filter (access list). Masih dasar sih tapi gpp namanya juga lagi belajar. Oke topology seperti berikut.

1.PNGKemudian konfigurasikan ip address seperti topologi diatas
R1 ingin mendapatkan 2.2.2.2/32 di routing table-nya, konfigurasikan secara static dengan ketentuan:
1. 12.12.12.2 sebagai next-hop = primary;
2. 21.21.21.2 sebagai qualified-next-hop (static float route) = secondary;

root@R1# run show configuration routing-options static
route 2.2.2.2/32 {
  next -hop 12.12.12.2;
    qualified-next-hop 21.21.21.2 {
      preference 7;
  }
}
[edit]

Kemudian coba ping 2.2.2.2 dari R1 dan pastikan ping berhasil.
Selanjutnya gunakan OSPF untuk menghubungkan semua network ke semua router, hanya saja untuk interface loopback R2 tidak perlu dimasukan. Hierarki untuk OSPF:

protocol ospf    {
  area    <area-id>    {
    interface <interface>;
  }
}

contoh:

root@R1# run show configuration protocols ospf
    area 0.0.0.0 {
      interface em1.0;
      interface em2.0;
      interface em3.0;
      interface lo0.0;
}
[edit]
root@R1#

Lihat routing table di semua router, perhatikan bahwa 2.2.2.2/32 tidak terdapat di R3, karena memang tidak di-advertise melalui OSPF. R1 punya 2.2.2.2/32 hasil dari static route.

2Supaya 2.2.2.2/32 bisa ada di routing table R3, mari lakukan readvertise static R1 ke OSPF. Untuk melakukan export routing table, buat dulu policy dengan hierarki:

policy-options    {
    policy-statement    <policy-name>    {
       term    <term-name>    {
          from    <if-conditions>;
          then    <actions>;
      }
   }
}

Contoh:

root@R1# run show configuration policy-options
   policy-statement static->ospf {
      term 1 {
         from protocol static;
         then accept;
  }
}
[edit]
root@R1#

Setelah membuat policy, export di protokol OSPF, hierarkinya seperti ini:

protocol ospf    {
export <policy-name>;
}

contoh:

root@R1# run show configuration protocols ospf
     export static->ospf;
         area 0.0.0.0 {
  interface em1.0;
            interface em2.0;
            interface em3.0;
            interface lo0.0;
}
[edit]
root@R1#

Lihat lagi routing table R3 dan lihat 2.2.2.2/32 sudah masuk di routing table (sebagai eksternal OSPF).

3

Firewall filter bekerja seperti access list pada Cisco, hanya saja sistemnya tetap menggunakan hierarki. Untuk lab ini pastikan hanya R3 saja yang bisa memperoleh akses telnet ke R2. Sebelum ke firewall filter, buat dulu prefix list semua local network R3 supaya nantinya lebih mudah saat mengimplementasikan firewall filter. Hierarki prefix list seperti ini:

policy-options {
   prefix-list <prefix-name> {
      <prefixes>;
   }
}

contoh:

root@R2# run show configuration policy-options
prefix-list R3 {
    3.3.3.3/32;
    13.13.13.3/32;
    23.23.23.3/32;
}

[edit]
root@R2#

Dengan ini kita bisa memasukkan prefix-list R3 untuk dimasukkan di firewall R2. Buat firewall
filter di R2 supaya telnet hanya bisa dilakukan dari R3, hierarkinya:

firewall {
    filter <filter-name> {
        term <term-name> {
           from <if-conditions>;
           then <actions>;
       }
   }
}

contoh:

root@R2# run show configuration firewall filter limit-telnet                
term 1 {
    from {
        source-prefix-list {
            R3;
        }
        protocol tcp;
        destination-port telnet;
    }
    then accept;
}
term 2 {
    from {
        protocol tcp;
        destination-port telnet;
    }
    then {
        reject;
    }
}
term 3 {
    then accept;
}

[edit]
root@R2#

Jika digambarkan di flowchart kurang lebih seperti ini

4Firewall filter sudah dibuat, sekarang implementasikan di interface yang diinginkan. Jika dikehendaki untuk semua interface, maka loopback interface bisa digunakan.

interfaces {
    <interface> {
         unit 0 {
            family inet {
               filter {
                  input <filter-name>;
              }
            }
        }
    }
}

Contoh:

root@R2# run show configuration interfaces lo0 unit 0
family inet {
    filter {
        input limit-telnet;
    }
    address 2.2.2.2/32;
}

[edit]
root@R2#

Setelah di commit pastikan hanya R3 yang bisa melakukan telnet ke R2

5

Regard to mas caysar udah ngasih bukunya 😀

2 thoughts on “Routing Fundamental, Routing Policy and Firewall Filter

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.