BGP Configuration Example using Mikrotik Router








This aricle introduce basic configuration about BGP, including ASN and E-BGP.
BGP use in TCP connection and using port 179,when connecting to the internet ,enterprise can use static route or a routing protocol name as Border Gateway Routing protocol(BGP).
See BGP Configuration video

Configure Basic ip address our mikrotik router


[admin@Laxmi]/ip address >            
add address=10.0.0.2/30 network=10.0.0.0 broadcast=10.0.0.3 interface=WAN1
add address=172.16.0.2/30 network=172.16.0.0 broadcast=172.16.0.3 interface=WAN2

Configure our AS number
[admin@Laxmi]/routing bgp instance>
set default as=100

Configure BGP Neighbor

[admin@Laxmi]/routing bgp peer>add name=ISP1 remote-address=10.0.0.1 remote-as=200
[admin@Laxmi]/routing bgp peer>add name=ISP2 remote-address=172.16.0.1 remote-as=300



Verification BGP peer

[admin@Laxmi] /routing bgp peer> print
Flags: X - disabled, E - established
 #   INSTANCE        REMOTE-ADDRESS                                 REMOTE-AS
 0 E default         10.0.0.1                                                              200    
 1 E default         172.16.0.1                                                    300




Network Advertisement Configuration

[admin@Laxmi]>
/routing bgp network
add network=192.168.10.0/24 synchronize=no




Outgoing and Incoming Filter Chain For ISP 1

[admin@Laxmi]>
/routing filter
add chain =ISP_1-out prefix=192.168.10.0/24 action=accept
add chain=ISP_1-out action=discard
[admin@Laxmi]>
/routing filter
add chain=ISP_1-in action=discard

Configure Outgoing and incoming Filter Chain For ISP 2
[admin@Laxmi]>
/routing filter
add chain =ISP_2-out prefix=192.168.10.0/24 action=accept set-bgp-prepend=5
[admin@Laxmi]>
/routing filter
add chain=ISP_2-in action=discard

[admin@Laxmi]>
/ip route
add gateway=10.0.0.1 check-gateway=ping
add gateway=172.16.0.1 check-gateway=ping distance=10






1 comment: