Skip to content
Achmad Basuki edited this page Nov 4, 2020 · 15 revisions

Welcome to the routing_lab wiki!

Configuring Routers

Before configuring the routers, you need to refer to the topology. The scenario we suggest is to run OSPF on AS100, RIP on AS200, and iBGP on AS300, while eBGP for the inter-as networks. All routers are using a docker image based on FRR. You also need to follow all preliminary commands as described in README

Configuring OSPF and eBGP on AS100

There are 3 routers in this AS100: R1, R2, and BR01. There are also several network prefixes:

  • client1 = 10.10.1.0/24 as OSPF area 1 and client2 = 10.10.2.0/24 as OSPF area 2
  • router12 = 10.10.0.0/29, router1 = 10.10.0.8/29, and router2 = 10.10.0.16/29 as OSPF area 0
  1. Use your terminal console to access FRR configuration console on each router:
    • $ docker exec -it R1 vtysh

    if you are new to vtysh, please read FRR User Guide to continue with steps 2 to 6 below, you must first enter each router by running the above command and change R1 or R2 or BR01 as needed

  2. OSPF on router R1:
    • R1# configure terminal

    you can also an alias command such as conf t

    • R1(config)# router ospf

    this is a start to configure OSPF

    • R1(config-router)# network 10.10.1.0/24 area 1

    defining network prefix for area 1

    • R1(config-router)# network 10.10.0.0/29 area 0

    defining network prefix for area 0 (backbone area)

    • R1(config-router)# network 10.10.0.8/29 area 0
    • R1(config-router)# exit
    • R1(config)# exit
    • R1# write

    when you finished configuring all network prefixes attach to R1, you can end the configuration session and save ("write" command) the FRR configuration after typing "exit" several times, or if you just want to leave the session - press "Ctrl+d" button

  3. OSPF on router R2:

    Similar to R1, you need to configure all network prefixes attach to R2 in OSPF

    • R2# conf t
    • R2(config)# router ospf
    • R2(config-router)# network 10.10.2.0/24 area 2

    defining network prefix for area 2

    • R2(config-router)# network 10.10.0.0/29 area 0

    defining network prefix for area 0 (backbone area)

    • R2(config-router)# network 10.10.0.16/29 area 0
    • R2(config-router)# exit
    • R2(config)# exit
    • R2# write

    Press "Ctrl+d" button to end session on R2

  4. OSPF on router BR01:

    BR01 is the border router for AS100, you will also need to configure BGP in this router later

    • BR01# conf t
    • BR01(config)# router ospf
    • BR01(config-router)# network 10.10.0.8/29 area 0
    • BR01(config-router)# network 10.10.0.16/29 area 0

    BR01 will only serve OSPF area 0

    • BR01(config-router)# default-information originate always

    this is to send default route (0.0.0.0/0) from BR01 to all OSPF routers in AS100

    • BR01(config-router)# exit
    • BR01(config)# exit
    • BR01# write

    Press "Ctrl+d" button to end session on BR01

  5. BGP on router BR01:
    • BR01# conf t
    • BR01(config)# router bgp 100

    configure BGP in AS100

    • BR01(config-router)# no bgp ebgp-requires-policy

    This is to disable the default filtering BGP policy, you still be able to do inbound or outbound policy

    • BR01(config-router)# neighbor 10.10.100.253 remote-as 300

    eBGP peering with AS300 on peer router 10.10.100.253

    • BR01(config-router)# neighbor 10.10.120.254 remote-as 200

    eBGP peering with AS200 on peer router 10.10.120.254

    • BR01(config-router)# address-family ipv4

    Defining network prefixes to advertise to other ASes (100 and 200)

    • BR01(config-router-af)# network 10.10.0.0/24
    • BR01(config-router-af)# network 10.10.1.0/24
    • BR01(config-router-af)# network 10.10.2.0/24
    • BR01(config-router-af)# exit
    • BR01(config-router)# exit
    • BR01(config)# exit
    • BR01# write

    Press "Ctrl+d" button to end session on BR01

  6. Routes testing between clients C1 and C2:
    • docker exec -it C1 traceroute -n C2

    Remember, docker network using bridge mode network always set the default gateway on each connected container, don't forget to reset the default gateway on each client and each router. You can refer to example command in route_clean.sh or route_clean.ps1. Upon successful configuration, your traceroute may result like below

    • traceroute to C2 (10.10.2.2), 30 hops max, 46 byte packets
    • 1 10.10.1.254 0.030 ms 0.027 ms 0.029 ms
    • 2 10.10.0.6 0.027 ms 0.029 ms 0.027 ms
    • 3 10.10.2.2 0.028 ms 0.029 ms 0.031 ms

Configuring RIP and eBGP on AS200

  1. Use your terminal console to access FRR configuration console on each router:
    • $ docker exec -it R3 vtysh

    if you are new to vtysh, please read FRR User Guide to continue with steps 2 to 6 below, you must first enter each router by running the above command and change R3 or R4 or BR02 as needed

  2. RIP on router R3:
    • R3# configure terminal

    you can also an alias command such as conf t

    • R3(config)# router rip

    this is a start to configure RIP

    • R3(config-router)# neighbor 10.10.4.14
    • R3(config-router)# neighbor 10.10.4.6

    defining RIP router neighbor, R3 has neighbors with BR02 and R4

    • R3(config-router)# network 10.10.5.0/24
    • R3(config-router)# network 10.10.4.0/29
    • R3(config-router)# network 10.10.4.8/29

    defining connected prefixes for the interfaces to be activated in RIP routing

    • R3(config-router)# exit
    • R3(config)# exit
    • R3# write

    when you finished configuring all network prefixes attach to R3, you can end the configuration session and save ("write" command) the FRR configuration after typing "exit" several times, or if you just want to leave the session - press "Ctrl+d" button

  3. RIP on router R4:

    Similar to R3, you need to configure all network prefixes attach to R4 in RIP

    • R4# conf t
    • R4(config)# router rip

    this is a start to configure RIP

    • R4(config-router)# neighbor 10.10.4.22
    • R4(config-router)# neighbor 10.10.4.2

    defining RIP router neighbor, R4 has neighbors with BR02 and R3

    • R4(config-router)# network 10.10.6.0/24
    • R4(config-router)# network 10.10.4.0/29
    • R4(config-router)# network 10.10.4.16/29

    defining connected prefixes for the interfaces to be activated in RIP routing

    • R4(config-router)# exit
    • R4(config)# exit
    • R4# write

    Press "Ctrl+d" button to end session on R4

  4. RIP on router BR02:

    BR02 is the border router for AS200, you will also need to configure eBGP in this router later

    • BR02# conf t
    • BR02(config)# router rip
    • BR02(config-router)# neighbor 10.10.4.10
    • BR02(config-router)# neighbor 10.10.4.18

    defining RIP router neighbor, BR02 has neighbors with R3 and R4

    • BR02(config-router)# network 10.10.4.8/29
    • BR02(config-router)# network 10.10.4.16/29

    defining connected prefixes for the interfaces to be activated in RIP routing

    • BR02(config-router)# default-information originate

    this is to send default route (0.0.0.0/0) from BR02 to all RIP routers in AS200

    • BR02(config-router)# exit
    • BR02(config)# exit
    • BR02# write

    Press "Ctrl+d" button to end session on BR02

  5. BGP on router BR02:
    • BR02# conf t
    • BR02(config)# router bgp 200

    configure BGP in AS200

    • BR02(config-router)# no bgp ebgp-requires-policy

    This is to disable the default filtering BGP policy, you still be able to do inbound or outbound policy

    • BR02(config-router)# neighbor 10.10.120.253 remote-as 100

    eBGP peering with AS100 on peer router 10.10.120.253

    • BR02(config-router)# neighbor 10.10.200.253 remote-as 300

    eBGP peering with AS300 on peer router 10.10.200.253

    • BR02(config-router)# address-family ipv4

    Defining network prefixes to advertise to other ASes (100 and 300)

    • BR02(config-router-af)# network 10.10.4.0/24
    • BR02(config-router-af)# network 10.10.5.0/24
    • BR02(config-router-af)# network 10.10.6.0/24
    • BR02(config-router-af)# exit
    • BR02(config-router)# exit
    • BR02(config)# exit
    • BR02# write

    Press "Ctrl+d" button to end session on BR02

  6. Routes testing between clients C5 and C6:
    • docker exec -it C5 traceroute -n C6

    Remember, docker network using bridge mode network always set the default gateway on each connected container, don't forget to reset the default gateway on each client and each router. You can refer to example command in route_clean.sh or route_clean.ps1. Upon successful configuration, your traceroute may result like below

    • traceroute to C6 (10.10.6.2), 30 hops max, 46 byte packets
    • 1 10.10.5.254 0.004 ms 0.003 ms 0.002 ms
    • 2 10.10.4.6 0.002 ms 0.001 ms 0.002 ms
    • 3 10.10.6.2 0.002 ms 0.002 ms 0.002 ms

Configuring iBGP and eBGP on AS300

  1. Use your terminal console to access FRR configuration console on each router:
    • $ docker exec -it R5 vtysh

    if you are new to vtysh, please read FRR User Guide to continue with steps 2 to 6 below, you must first enter each router by running the above command and change R5 or R6 or BR03 as needed

  2. iBGP on router R5:
    • R5# configure terminal

    you can also an alias command such as conf t

    • R5(config)# router bgp 300

    this is a start to configure BGP

    • R5(config-router)# neighbor 10.10.8.6 remote-as 300
    • R5(config-router)# neighbor 10.10.8.14 remote-as 300

    defining iBGP router neighbor using the same ASN 300, R5 has neighbors with BR03 and R6

    • R5(config-router)# network 10.10.8.0/29
    • R5(config-router)# network 10.10.8.8/29
    • R5(config-router)# network 10.10.9.0/24

    defining connected prefixes for the interfaces to be activated in iBGP routing

    • R5(config-router)# neighbor 10.10.8.6 next-hop-self
    • R5(config-router)# neighbor 10.10.8.14 next-hop-self

    activating next-hop-self for iBGP

    • R5(config-router)# exit
    • R5(config)# exit
    • R5# write

    when you finished configuring all network prefixes attach to R5, you can end the configuration session and save ("write" command) the FRR configuration after typing "exit" several times, or if you just want to leave the session - press "Ctrl+d" button

  3. iBGP on router R6:

    Similar to R4, you need to configure all network prefixes attach to R6 in BGP

    • R6# conf t
    • R6(config)# router bgp 300

    this is a start to configure BGP

    • R6(config-router)# neighbor 10.10.8.2 remote-as 300
    • R6(config-router)# neighbor 10.10.8.22 remote-as 300

    defining iBGP router neighbor using the same ASN 300, R6 has neighbors with BR03 and R5

    • R6(config-router)# network 10.10.8.0/29
    • R6(config-router)# network 10.10.8.16/29
    • R6(config-router)# network 10.10.10.0/24

    defining connected prefixes for the interfaces to be activated in iBGP routing

    • R6(config-router)# neighbor 10.10.8.2 next-hop-self
    • R6(config-router)# neighbor 10.10.8.22 next-hop-self

    activating next-hop-self for iBGP

    • R6(config-router)# exit
    • R6(config)# exit
    • R6# write

    Press "Ctrl+d" button to end session on R6

  4. iBGP on router BR03:

    BR03 is the border router for AS300, you will also need to configure eBGP in this router later

    • BR03# conf t
    • BR03(config)# router bgp 300

    this is a start to configure BGP

    • BR03(config-router)# neighbor 10.10.8.10 remote-as 300
    • BR03(config-router)# neighbor 10.10.8.18 remote-as 300

    defining iBGP router neighbor using the same ASN 300, R6 has neighbors with BR03 and R5

    • BR03(config-router)# network 10.10.8.0/24
    • BR03(config-router)# network 10.10.9.0/24
    • BR03(config-router)# network 10.10.10.0/24

    defining connected prefixes for the interfaces to be activated in iBGP routing

    • BR03(config-router)# neighbor 10.10.8.10 next-hop-self
    • BR03(config-router)# neighbor 10.10.8.10 default-originate
    • BR03(config-router)# neighbor 10.10.8.18 next-hop-self
    • BR03(config-router)# neighbor 10.10.8.18 default-originate

    activating next-hop-self and also sending default route (0.0.0.0/0) from BR03 to all iBGP routers in AS300

    • BR03(config-router)# exit
    • BR03(config)# exit
    • BR03# write

    Press "Ctrl+d" button to end session on BR03

  5. BGP on router BR03:
    • BR03# conf t
    • BR03(config)# router bgp 300

    configure BGP in AS300

    • BR03(config-router)# no bgp ebgp-requires-policy

    This is to disable the default filtering BGP policy, you still be able to do inbound or outbound policy

    • BR03(config-router)# neighbor 10.10.100.254 remote-as 100

    eBGP peering with AS100 on peer router 10.10.120.254

    • BR03(config-router)# neighbor 10.10.200.254 remote-as 200

    eBGP peering with AS200 on peer router 10.10.200.254

    • BR03(config-router)# address-family ipv4

    Defining network prefixes to advertise to other ASes (100 and 200)

    • BR03(config-router-af)# network 10.10.8.0/24
    • BR03(config-router-af)# network 10.10.9.0/24
    • BR03(config-router-af)# network 10.10.10.0/24
    • BR03(config-router-af)# exit
    • BR03(config-router)# exit
    • BR03(config)# exit
    • BR03# write

    Press "Ctrl+d" button to end session on BR03

  6. Routes testing between clients C9 and C10:
    • docker exec -it C9 traceroute -n C10

    Remember, docker network using bridge mode network always set the default gateway on each connected container, don't forget to reset the default gateway on each client and each router. You can refer to example command in route_clean.sh or route_clean.ps1. Upon successful configuration, your traceroute may result like below

    • traceroute to C10 (10.10.10.2), 30 hops max, 46 byte packets
    • 1 10.10.9.254 0.002 ms 0.001 ms 0.001 ms
    • 2 10.10.8.6 0.002 ms 0.001 ms 0.002 ms
    • 3 10.10.10.2 0.002 ms 0.002 ms 0.001 ms

Testing the connectivity of clients between ASes

Upon successful configuration, when we test with a traceroute from AS 100 to AS 300, the result may look like below

  • docker exec -it C1 traceroute -n C10
  • traceroute to C10 (10.10.10.2), 30 hops max, 46 byte packets
  • 1 10.10.1.254 0.004 ms 0.002 ms 0.002 ms
  • 2 10.10.0.14 0.002 ms 0.002 ms 0.001 ms
  • 3 10.10.100.253 0.001 ms 0.002 ms 0.001 ms
  • 4 10.10.8.18 0.002 ms 0.002 ms 0.002 ms
  • 5 10.10.10.2 0.002 ms 0.001 ms 0.002 ms

Your traceroute result from AS 300 to AS 200 may look like below

  • docker exec -it C9 traceroute -n C6
  • traceroute to C6 (10.10.6.2), 30 hops max, 46 byte packets
  • 1 10.10.9.254 0.004 ms 0.002 ms 0.002 ms
  • 2 10.10.8.14 0.001 ms 0.002 ms 0.002 ms
  • 3 10.10.200.254 0.002 ms 0.001 ms 0.002 ms
  • 4 10.10.4.18 0.001 ms 0.002 ms 0.002 ms
  • 5 10.10.6.2 0.002 ms 0.002 ms 0.001 ms