Definisikan AS number dan Router ID
Definisikan router id
set routing-options router-id 12.23.34.45
Definisikan AS number
set routing-options autonomous-system 141234
Definisikan IP address (optional but recommended)
set interfaces lo0 unit 0 family inet address 192.0.2.0/32
Definisikan Prefix
Ketika kita akan melakukan advertise prefix ke internet untuk IPv4 panjang minimum yang boleh di advertise ke internet adalah /24, di juniper agar bisa kita advertise syarat utamanya adalah prefix tersebut harus ada di routing table. kita tambahkan menggunakan static route prefix dengan action discard (blackhole). tak perlu khawatir karena jika di jaringan internal kita membagi ke subnet subnet yang lebih kecil maka prefix/subnet tersebut tidak akan di discard/blackhole karena prefixnya lebih spesifik dan akan di utamakan.
set routing-options static route 192.0.2.0/24 discard
Prefix List
prefix-list
di juniper berfungsi untuk menambahkan list beberapa prefix kedalam satu nama group, prefix-list
biasanya dibagungkan dengan routing filter, prefix-list
hanya akan cocok jika network dan panjang prefix nya sama
set policy-options prefix-list my-prefixes 192.0.2.0/24
set policy-options prefix-list customer-prefixes 198.51.100.0/24
set policy-options prefix-list customer-prefixes 203.0.113.0/24
Show configuration
show policy-options
prefix-list my-prefixes {
192.0.2.0/24;
}
prefix-list customer-prefixes {
198.51.100.0/24;
203.0.113.0/24;
}
Route Filter List
Fungsinya sama dengan prefix-list namun dengan kelebihan bisa menyesuaikan panjang prefix (Range), jika di cisco adalah ge
& le
— SOON —
Membuat Routing Filter (Policy Statement)
Example Filter In
Berikut adalah contoh filter in
set policy-options policy-statement EBGP-PEER-IN term 1 from prefix-list my-prefixes
set policy-options policy-statement EBGP-PEER-IN term 1 then reject
set policy-options policy-statement EBGP-PEER-IN term 2 from prefix-list customer-prefixes
set policy-options policy-statement EBGP-PEER-IN term 2 then accept
set policy-options policy-statement EBGP-PEER-IN term reject-else then reject
Show configuration
show policy-options policy-statement EBGP-PEER-IN
term 1 {
from {
prefix-list my-prefixes;
}
then reject;
}
term 2 {
from {
prefix-list customer-prefixes;
}
then accept;
}
term reject-else {
then reject;
}
Example Filter Out
Berikut adalah contoh filter out
set policy-options policy-statement EBGP-PEER-OUT term 1 from prefix-list my-prefixes
set policy-options policy-statement EBGP-PEER-OUT term 1 then accept
set policy-options policy-statement EBGP-PEER-OUT term reject-else then reject
Show configuration
show policy-options policy-statement EBGP-PEER-OUT
term 1 {
from {
prefix-list my-prefixes;
}
then accept;
}
term reject-else {
then reject;
}
Example Filter with Community
Berikut contoh routing filter-out untuk advertise prefix dan menambahkan attribute community
set policy-options community COMMUNITY-NAME members 65505:90099
set policy-options policy-statement EBGP-PEER-OUT term 1 from prefix-list my-prefixes
set policy-options policy-statement EBGP-PEER-OUT term 1 then community add COMMUNITY-NAME
set policy-options policy-statement EBGP-PEER-OUT term 1 then accept
set policy-options policy-statement EBGP-PEER-OUT term reject-else then reject
Show configuration
policy-options {
policy-statement EBGP-PEER-OUT {
term 1 {
from {
prefix-list my-prefixes;
}
then {
community add COMMUNITY-NAME;
accept;
}
}
term reject-else {
then reject;
}
}
community COMMUNITY-NAME members 65505:90099;
}
Example Filter with Large Community
Berikut contoh routing filter-out untuk advertise prefix dan menambahkan attribute large community
set policy-options community COMMUNITY-NAME members large:65505:0:17885
set policy-options policy-statement EBGP-PEER-OUT term 1 from prefix-list my-prefixes
set policy-options policy-statement EBGP-PEER-OUT term 1 then community add COMMUNITY-NAME
set policy-options policy-statement EBGP-PEER-OUT term 1 then accept
set policy-options policy-statement EBGP-PEER-OUT term reject-else then reject
Setup Peering
set protocols bgp group EBGP.PEER type external
set protocols bgp group EBGP.PEER neighbor 169.254.0.2 description PEER-DESCRIPTION
set protocols bgp group EBGP.PEER neighbor 169.254.0.2 import EBGP-PEER-IN
set protocols bgp group EBGP.PEER neighbor 169.254.0.2 export EBGP-PEER-OUT
set protocols bgp group EBGP.PEER neighbor 169.254.0.2 peer-as 14789
Show configuration
type external;
neighbor 169.254.0.2 {
description PEER-NAME;
import EBGP-PEER-IN;
export EBGP-PEER-OUT;
peer-as 14789;
}