[Juniper] Simple Basic BGP Configuration Juniper OS [Step by Step]
Posted by a. Rahman Isnaini r. Sutan on May 14th, 2008
=======================
Juniper Config Manager [Here..]
=======================
Juniper OS [JUNOS] has a completely different model of configuration with cisco IOS.
A Basic & Simple BGP config as you can see below.
The scheme is :
- You are connected to two peers
- Your ASNumber 8888
- You are peering with PEER-1 AS 9999
- You are peering with PEER-2 AS 10000
- You are advertising first longer prefix /24 to PEER-1
- You are advertising second longer prefix /24 to PEER-2
- You are advertising supernet aggregate or /23 to PEER-1 & PEER-2
- Why ? Redundancy Purpose
+++++++++++++++++++++++++++++++++++++++++++++++++
1. Configure IP Address for BGP Peer Purpose (PEER-1 & PEER-2) for e.g
+++++++++++++++++++++++++++++++++++++++++++++++++
interfaces {
fe-0/2/0 {
description PEER-1;
speed 100m;
link-mode full-duplex;
unit 0 {
family inet {
address 88.88.88.89/30;
}
}
}
fe-0/2/1 {
description PEER-2;
speed 100m;
link-mode full-duplex;
unit 0 {
family inet {
address 88.88.88.99/30;
}
}
}
}
The command should be (you can go with step by step command architechture or directly to the end) :
admin@JUNOS>edit
Entering configuration mode
[edit]
admin@JUNOS#edit interfaceS fe-0/2/0
[edit interfaces fe-0/2/0]
admin@JUNOS#
admin@JUNOS#set description PEER-1 speed 100 link-mode full-duplex unit 0 family inet 88.88.88.89/30
admin@JUNOS#edit interfaceS fe-0/2/1
admin@JUNOS#
admin@JUNOS#set description PEER-2 speed 100 link-mode full-duplex unit 0 family inet 88.88.88.99/30
[edit interfaces fe-0/2/1]
admin@JUNOS#
admin@JUNOS#commit
++++++++++++++++++++++++++++
2. Configure AS Number in Routing Option
++++++++++++++++++++++++++++
routing-options {
autonomous-system 8888;
The command should be :
admin@JUNOS>edit
Entering configuration mode
[edit]
admin@JUNOS#set routing-option autonomous-system 8888
++++++++++++
3. Configure BGP
++++++++++++
protocols {
bgp {
group PEER-1 {
type external;
description ***PEER-1***;
damping;
import PEER-IMPORT;
export PEER1-EXPORT;
peer-as 9999;
neighbor 88.88.88.90
}
}
group PEER-2 {
type external;
description ***PEER-2***;
damping;
import PEER-IMPORT;
export PEER2-EXPORT;
peer-as 10000;
neighbor 88.88.88.100
}
}
}
}
The command should be :
admin@JUNOS>edit
Entering configuration mode
[edit]
admin@JUNOS#set protocol bgp group PEER-1 type external description ***PEER-1*** import PEER-IMPORT export PEER1-EXPORT peer-as 9999 neighbor 88.88.88.90
admin@JUNOS#set protocol bgp group PEER-2 type external description ***PEER-2*** import PEER-IMPORT export PEER2-EXPORT peer-as 1000 neighbor 88.88.88.100
admin@JUNOS#commit
++++++++++++++++++++++++++++++++++++
4. Configure BGP Policy & AS Path Access-List in Cisco ![]()
++++++++++++++++++++++++++++++++++++
policy-options {
prefix-list PEER-1 {
88.88.86.0/24;
}
prefix-list PEER-2 {
88.88.87.0/24;
}
prefix-list PEER-12 {
88.88.86.0/23;
}
The command should be :
admin@JUNOS>edit
Entering configuration mode
[edit]
admin@JUNOS#set policy-options prefix-list PEER-1 88.88.88.86.0/24
admin@JUNOS#set policy-options prefix-list PEER-2 88.88.88.87.0/24
admin@JUNOS#set policy-options prefix-list PEER-12 88.88.88.86.0/23
policy-statement PEER-IMPORT {
term 1 {
from as-path ALL;
then accept;
}
}
admin@JUNOS#set policy-options policy-statement PEER-IMPORT term 1 from as-path ALL
admin@JUNOS#set policy-options policy-statement PEER-IMPORT term 1 then accept
policy-statement PEER1-EXPORT {
term 1 {
from {
prefix-list PEER-1;
}
then accept;
}
term 2 {
from {
prefix-list PEER-12;
}
then accept;
}
term 3 {
then reject;
}
}
admin@JUNOS#set policy-options policy-statement PEER1-EXPORT term 1 from prefix-list PEER-1
admin@JUNOS#set policy-options policy-statement PEER1-EXPORT term 1 then accept
admin@JUNOS#set policy-options policy-statement PEER1-EXPORT term 2 from prefix-list PEER-12
admin@JUNOS#set policy-options policy-statement PEER1-EXPORT term 2 then accept
admin@JUNOS#set policy-options policy-statement PEER1-EXPORT term 3 then reject
policy-statement PEER2-EXPORT {
term 1 {
from {
prefix-list PEER-2;
}
then accept;
}
term 2 {
from {
prefix-list PEER-12;
}
then accept;
}
term 3 {
then reject;
}
admin@JUNOS#set policy-options policy-statement PEER2-EXPORT term 1 from prefix-list PEER-2
admin@JUNOS#set policy-options policy-statement PEER2-EXPORT term 1 then accept
admin@JUNOS#set policy-options policy-statement PEER2-EXPORT term 2 from prefix-list PEER-12
admin@JUNOS#set policy-options policy-statement PEER2-EXPORT term 2 then accept
admin@JUNOS#set policy-options policy-statement PEER2-EXPORT term 3 then reject
}
as-path ALL .*;
admin@JUNOS#set policy-options as-path ALL .*
admin@JUNOS#commit
}
a. rahman isnaini r.sutan



August 15th, 2008 at 10:52 am
[...] see BGP step by step config for more detail on how configuring [...]
August 18th, 2008 at 9:38 am
That was great, it helped me iron out some issues i had with policy application. Please cover something on firewall. Thanx
August 19th, 2008 at 1:25 am
Glad to hear that, Martin.
Firewall working on it
August 26th, 2008 at 8:29 am
Thanks for the article. It’s really help me.
August 26th, 2008 at 8:38 am
Sama2 Mas Zakki.
December 31st, 2008 at 3:21 am
[...] Source : risnaini [...]
January 20th, 2009 at 6:55 pm
[...] post has been moved to http://www.ip-stories.com Please kindly update & noted. I’m really sorry for your [...]
July 21st, 2010 at 2:20 pm
Tutorial yg sangat bagus..