When two BGP peers from different autonomous systems peers with each other it's called eBGP. When the peers belong to the same ASN, they are in an iBGP.
Below is an example configuration of setting up BGP with Juniper and Mikrotik:
Juniper Configuration:
----------------------------------------------------------------------------------------------
root@TATA> configure
Entering configuration mode
The configuration has been changed but not committed
[edit]
root@TATA# show
## Last changed: 2019-03-25 12:07:10 UTC
version 10.1R1.8;
system {
host-name TATA;
root-authentication {
encrypted-password "$1$/okW5cvo$LbfKdybOk7sPp9PGWaU0c0"; ## SECRET-DATA
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
interfaces {
em0 {
unit 0 {
family inet {
address 1.1.1.1/30;
}
}
}
}
routing-options {
static {
route 1.1.1.0/24 {
install;
active;
}
}
router-id 1.1.1.1;
autonomous-system 1100;
}
protocols {
bgp {
group ABC {
type external;
export ABC_OUT;
peer-as 1300;
neighbor 1.1.1.2;
}
}
}
policy-options {
policy-statement ABC_OUT {
term 1 {
from {
protocol direct;
route-filter 1.1.1.0/24 exact;
route-filter 1.1.2.0/24 exact;
route-filter 1.1.3.0/24 exact;
route-filter 1.1.4.0/24 exact;
}
then accept;
}
}
}
[edit]
root@TATA#
----------------------------------------------------------------------------------------------
ABC_DISTRIBUTION
/interface ethernet
set [ find default-name=ether3 ] arp=reply-only
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp_pool0 ranges=1.3.1.2-1.3.1.254
/ip dhcp-server
add add-arp=yes address-pool=dhcp_pool0 disabled=no interface=ether3 name=\
dhcp1
/routing ospf area
add area-id=1.1.1.1 default-cost=1 inject-summary-lsas=yes name=\
ABC_DISTRIBUTION type=stub
/ip address
add address=192.168.125.3/24 comment=MGMT interface=ether12 network=\
192.168.125.0
add address=1.3.0.2/30 comment=WAN interface=ether1 network=1.3.0.0
add address=1.3.0.5/30 comment=LAN1 interface=ether2 network=1.3.0.4
add address=1.3.1.1/24 comment=LAN2 interface=ether3 network=1.3.1.0
add address=1.3.2.1/24 interface=ether3 network=1.3.2.0
add address=1.3.3.1/24 interface=ether3 network=1.3.3.0
/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1
/ip dhcp-server network
add address=1.3.1.0/24 dns-server=1.3.1.1 gateway=1.3.1.1
/ip route
add distance=1 gateway=1.3.0.1
/routing ospf area range
add area=ABC_DISTRIBUTION range=1.3.0.0/22
/routing ospf interface
add authentication=md5 authentication-key=1452 interface=ether1 network-type=\
point-to-point priority=2
add interface=ether12 network-type=broadcast passive=yes
/routing ospf network
add area=ABC_DISTRIBUTION network=1.3.0.0/24
add area=ABC_DISTRIBUTION network=1.3.1.0/24
add area=ABC_DISTRIBUTION network=1.3.2.0/24
add area=ABC_DISTRIBUTION network=1.3.3.0/24
add area=backbone network=1.3.0.0/30
/system identity
set name=ABC_DISTRIBUTION
----------------------------------------------------------------------------------------------
ABC_CORE
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/routing bgp instance
set default as=1300 redistribute-ospf=yes
/ip address
add address=1.1.1.2/30 comment=TATA interface=ether1 network=1.1.1.0
add address=192.168.125.2/24 comment=MGMT interface=ether12 network=\
192.168.125.0
add address=1.3.0.1/30 comment="ABC DISTRIBUTION" interface=ether2 network=\
1.3.0.0
/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1
/routing bgp network
/routing bgp peer
add name=TATA remote-address=1.1.1.1 remote-as=1100
/routing ospf interface
add authentication=md5 authentication-key=1452 interface=ether2 network-type=\
point-to-point
add interface=ether12 network-type=broadcast passive=yes
/routing ospf network
add area=backbone network=1.3.0.0/30
/system identity
set name=ABC
----------------------------------------------------------------------------------------------
root@TATA> configure
Entering configuration mode
The configuration has been changed but not committed
[edit]
root@TATA# show
## Last changed: 2019-03-25 12:07:10 UTC
version 10.1R1.8;
system {
host-name TATA;
root-authentication {
encrypted-password "$1$/okW5cvo$LbfKdybOk7sPp9PGWaU0c0"; ## SECRET-DATA
}
syslog {
user * {
any emergency;
}
file messages {
any notice;
authorization info;
}
file interactive-commands {
interactive-commands any;
}
}
}
interfaces {
em0 {
unit 0 {
family inet {
address 1.1.1.1/30;
}
}
}
}
routing-options {
static {
route 1.1.1.0/24 {
install;
active;
}
}
router-id 1.1.1.1;
autonomous-system 1100;
}
protocols {
bgp {
group ABC {
type external;
export ABC_OUT;
peer-as 1300;
neighbor 1.1.1.2;
}
}
}
policy-options {
policy-statement ABC_OUT {
term 1 {
from {
protocol direct;
route-filter 1.1.1.0/24 exact;
route-filter 1.1.2.0/24 exact;
route-filter 1.1.3.0/24 exact;
route-filter 1.1.4.0/24 exact;
}
then accept;
}
}
}
[edit]
root@TATA#
----------------------------------------------------------------------------------------------
ABC_DISTRIBUTION
/interface ethernet
set [ find default-name=ether3 ] arp=reply-only
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp_pool0 ranges=1.3.1.2-1.3.1.254
/ip dhcp-server
add add-arp=yes address-pool=dhcp_pool0 disabled=no interface=ether3 name=\
dhcp1
/routing ospf area
add area-id=1.1.1.1 default-cost=1 inject-summary-lsas=yes name=\
ABC_DISTRIBUTION type=stub
/ip address
add address=192.168.125.3/24 comment=MGMT interface=ether12 network=\
192.168.125.0
add address=1.3.0.2/30 comment=WAN interface=ether1 network=1.3.0.0
add address=1.3.0.5/30 comment=LAN1 interface=ether2 network=1.3.0.4
add address=1.3.1.1/24 comment=LAN2 interface=ether3 network=1.3.1.0
add address=1.3.2.1/24 interface=ether3 network=1.3.2.0
add address=1.3.3.1/24 interface=ether3 network=1.3.3.0
/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1
/ip dhcp-server network
add address=1.3.1.0/24 dns-server=1.3.1.1 gateway=1.3.1.1
/ip route
add distance=1 gateway=1.3.0.1
/routing ospf area range
add area=ABC_DISTRIBUTION range=1.3.0.0/22
/routing ospf interface
add authentication=md5 authentication-key=1452 interface=ether1 network-type=\
point-to-point priority=2
add interface=ether12 network-type=broadcast passive=yes
/routing ospf network
add area=ABC_DISTRIBUTION network=1.3.0.0/24
add area=ABC_DISTRIBUTION network=1.3.1.0/24
add area=ABC_DISTRIBUTION network=1.3.2.0/24
add area=ABC_DISTRIBUTION network=1.3.3.0/24
add area=backbone network=1.3.0.0/30
/system identity
set name=ABC_DISTRIBUTION
----------------------------------------------------------------------------------------------
ABC_CORE
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/routing bgp instance
set default as=1300 redistribute-ospf=yes
/ip address
add address=1.1.1.2/30 comment=TATA interface=ether1 network=1.1.1.0
add address=192.168.125.2/24 comment=MGMT interface=ether12 network=\
192.168.125.0
add address=1.3.0.1/30 comment="ABC DISTRIBUTION" interface=ether2 network=\
1.3.0.0
/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1
/routing bgp network
/routing bgp peer
add name=TATA remote-address=1.1.1.1 remote-as=1100
/routing ospf interface
add authentication=md5 authentication-key=1452 interface=ether2 network-type=\
point-to-point
add interface=ether12 network-type=broadcast passive=yes
/routing ospf network
add area=backbone network=1.3.0.0/30
/system identity
set name=ABC
No comments:
Post a Comment