1. ISP Setup using MikroTik
Class - VII
Static Routing, OSPF, BGP
M Abdullah Al Naser
B.Sc in CSE
CCNA, RHCE, RHCSA, MTCNA
2. Static Routing
2
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)
Remote networks are added to the routing table either
by configuring static routes or enabling a dynamic
routing protocol. When the router learns about a
remote network and the interface that it will use to
reach that network, it adds that route to the routing
table as long as the exit interface is enabled.
A static route includes the network address and subnet
mask of the remote network, along with the IP address
of the next-hop router or exit interface. Static routes
are denoted with the code S in the routing table.
3. Static Routing
3
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)
Static routes should be used in the following cases:
● A network consists of only a few routers.
● A network is connected to the Internet only through a
single ISP.
● A large network is configured in a hub-and-spoke
topology.
Typically, most routing tables contain a combination of
static routes and dynamic routes. But, as stated earlier,
the routing table must first contain the directly
connected networks used to access these remote
networks before any static or dynamic routing can be
used.
13. OSPF
13
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)
Open Shortest Path First (OSPF ) is a link-state
routing protocol that was developed as a
replacement for the distance vector routing
protocol RIP.
14. OSPF
14
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)
OSPF Features:
Classless - It is classless by design; therefore, it supports
VLSM and CIDR.
Efficient - Routing changes trigger routing updates (no
periodic updates). It uses the SPF algorithm to choose the
best path.
Fast convergence - It quickly propagates network changes.
Scalable - It works well in small and large network sizes.
Routers can be grouped into areas to support a hierarchical
system.
Secure - It supports Message Digest 5 (MD5) authentication.
19. OSPF
19
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)
There are three basic elements of OSPF configuration:
Enable OSPF Instance
There is a default instance already created which can be
found from Routing > OSPF > Instances
OSPF Area Configuration
There is a default area already created which can be found
from Routing > OSPF > Areas
OSPF Network Configuration
The directly connected networks need to announce/configure
from Routing > OSPF > Networks
24. BGP
24
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)
The Border Gateway Protocol (BGP) is an inter-
autonomous system routing protocol based on
distance-vector algorithm. It is used to exchange
routing information across the Internet and is the
only protocol that is designed to deal with a network
of the Internet's size and the only protocol that can
deal well with having multiple connections to
unrelated routing domains.
26. BGP
26
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)
iBGP and eBGP
Two BGP neighbors from different ASs are said to
maintain an "external" link. Similarly, a BGP peer in a
different AS is referred to as an external peer. BGP
connections between peers within the same AS are
known as "internal" links. BGP speakers that are
connected by internal link are referred as internal
peers. As far as this paper is concerned, iBGP refers
to the BGP session between two peers in the same
AS, or internal link. In turn, eBGP refers to the links
between external BGP peers (these that are in
different ASs).
29. BGP
29
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)
Enabling BGP on ISP1 Router
/routing bgp instance set default as=200
BGP Peers
/routing bgp peer add name=OFFICE remote-
address=10.0.0.2 remote-as=100
Enabling BGP on ISP2 Router
/routing bgp instance set default as=300
BGP Peers
/routing bgp peer add name=OFFICE remote-
address=20.0.0.2 remote-as=100
30. BGP
30
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)
Failover in BGP (Main/Backup link setup on OFFICE router)
Outgoing filters to ISP1:
/routing filter
#accept our networks
add chain=isp1-out prefix=192.168.0.0/24 action=accept
add chain=isp1-out prefix=192.168.1.0/24 action=accept
#discard the rest
add chain=isp1-out action=discard
Outgoing filters to ISP2:
/routing filter
#accept our networks and prepend AS path three times
add chain=isp2-out prefix=192.168.0.0/24 action=accept set-bgp-prepend=3
add chain=isp2-out prefix=192.168.1.0/24 action=accept set-bgp-prepend=3
#discard the rest
add chain=isp2-out action=discard
31. BGP
31
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)
Failover in BGP (Main/Backup link setup on OFFICE router)
We also do not need any routes from both ISPs, because default route is
used to force outgoing traffic through ISP1 and leave ISP2 as backup.
/routing filter
add chain=isp1-in action=discard
add chain=isp2-in action=discard
/ip route
add gateway=10.0.0.1 distance=1 check-gateway=ping
add gateway=20.0.0.1 distance=2 check-gateway=ping
Next step is to specify which routing filter chains will be used
/routing bgp peer
set ISP1 in-filter=isp1-in out-filter=isp1-out
set ISP2 in-filter=isp2-in out-filter=isp2-out
in-filter is for incoming (received) prefixes, out-filter is for advertised
prefixes.
32. BGP
32
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)
Load Balance in BGP (on OFFICE router)
Outgoing filters to ISP1:
/routing filter
#accept our networks and prepend second network
add chain=isp1-out prefix=192.168.0.0/24 action=accept
add chain=isp1-out prefix=192.168.1.0/24 action=accept set-bgp-
prepend=3
#discard the rest
add chain=isp1-out action=discard
33. BGP
33
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)
Load Balance in BGP (on OFFICE router)
Outgoing filters to ISP2:
/routing filter
#accept our networks and prepend first network
add chain=isp2-out prefix=192.168.0.0/24 action=accept set-bgp-
prepend=3
add chain=isp2-out prefix=192.168.1.0/24 action=accept
#discard the rest
add chain=isp2-out action=discard
34. Thank you very much
34
Prepared by- M Abdullah Al Naser (mail.naserbd@yahoo.com)