-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the routing_lab wiki!
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
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
- 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
- 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 0R1(config-router)# exitR1(config)# exitR1# 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
- OSPF on router R2:
Similar to R1, you need to configure all network prefixes attach to R2 in OSPF
R2# conf tR2(config)# router ospfR2(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 0R2(config-router)# exitR2(config)# exitR2# write
Press "Ctrl+d" button to end session on R2
- OSPF on router BR01:
BR01 is the border router for AS100, you will also need to configure BGP in this router later
BR01# conf tBR01(config)# router ospfBR01(config-router)# network 10.10.0.8/29 area 0BR01(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)# exitBR01(config)# exitBR01# write
Press "Ctrl+d" button to end session on BR01
- BGP on router BR01:
BR01# conf tBR01(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/24BR01(config-router-af)# network 10.10.1.0/24BR01(config-router-af)# network 10.10.2.0/24BR01(config-router-af)# exitBR01(config-router)# exitBR01(config)# exitBR01# write
Press "Ctrl+d" button to end session on BR01
- 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 packets1 10.10.1.254 0.030 ms 0.027 ms 0.029 ms2 10.10.0.6 0.027 ms 0.029 ms 0.027 ms3 10.10.2.2 0.028 ms 0.029 ms 0.031 ms
- 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
- 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.14R3(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/24R3(config-router)# network 10.10.4.0/29R3(config-router)# network 10.10.4.8/29
defining connected prefixes for the interfaces to be activated in RIP routing
R3(config-router)# exitR3(config)# exitR3# 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
- RIP on router R4:
Similar to R3, you need to configure all network prefixes attach to R4 in RIP
R4# conf tR4(config)# router rip
this is a start to configure RIP
R4(config-router)# neighbor 10.10.4.22R4(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/24R4(config-router)# network 10.10.4.0/29R4(config-router)# network 10.10.4.16/29
defining connected prefixes for the interfaces to be activated in RIP routing
R4(config-router)# exitR4(config)# exitR4# write
Press "Ctrl+d" button to end session on R4
- RIP on router BR02:
BR02 is the border router for AS200, you will also need to configure eBGP in this router later
BR02# conf tBR02(config)# router ripBR02(config-router)# neighbor 10.10.4.10BR02(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/29BR02(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)# exitBR02(config)# exitBR02# write
Press "Ctrl+d" button to end session on BR02
- BGP on router BR02:
BR02# conf tBR02(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/24BR02(config-router-af)# network 10.10.5.0/24BR02(config-router-af)# network 10.10.6.0/24BR02(config-router-af)# exitBR02(config-router)# exitBR02(config)# exitBR02# write
Press "Ctrl+d" button to end session on BR02
- 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 packets1 10.10.5.254 0.004 ms 0.003 ms 0.002 ms2 10.10.4.6 0.002 ms 0.001 ms 0.002 ms3 10.10.6.2 0.002 ms 0.002 ms 0.002 ms
- 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
- 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 300R5(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/29R5(config-router)# network 10.10.8.8/29R5(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-selfR5(config-router)# neighbor 10.10.8.14 next-hop-self
activating next-hop-self for iBGP
R5(config-router)# exitR5(config)# exitR5# 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
- iBGP on router R6:
Similar to R4, you need to configure all network prefixes attach to R6 in BGP
R6# conf tR6(config)# router bgp 300
this is a start to configure BGP
R6(config-router)# neighbor 10.10.8.2 remote-as 300R6(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/29R6(config-router)# network 10.10.8.16/29R6(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-selfR6(config-router)# neighbor 10.10.8.22 next-hop-self
activating next-hop-self for iBGP
R6(config-router)# exitR6(config)# exitR6# write
Press "Ctrl+d" button to end session on R6
- iBGP on router BR03:
BR03 is the border router for AS300, you will also need to configure eBGP in this router later
BR03# conf tBR03(config)# router bgp 300
this is a start to configure BGP
BR03(config-router)# neighbor 10.10.8.10 remote-as 300BR03(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/24BR03(config-router)# network 10.10.9.0/24BR03(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-selfBR03(config-router)# neighbor 10.10.8.10 default-originateBR03(config-router)# neighbor 10.10.8.18 next-hop-selfBR03(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)# exitBR03(config)# exitBR03# write
Press "Ctrl+d" button to end session on BR03
- BGP on router BR03:
BR03# conf tBR03(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/24BR03(config-router-af)# network 10.10.9.0/24BR03(config-router-af)# network 10.10.10.0/24BR03(config-router-af)# exitBR03(config-router)# exitBR03(config)# exitBR03# write
Press "Ctrl+d" button to end session on BR03
- 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 packets1 10.10.9.254 0.002 ms 0.001 ms 0.001 ms2 10.10.8.6 0.002 ms 0.001 ms 0.002 ms3 10.10.10.2 0.002 ms 0.002 ms 0.001 ms
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 C10traceroute to C10 (10.10.10.2), 30 hops max, 46 byte packets1 10.10.1.254 0.004 ms 0.002 ms 0.002 ms2 10.10.0.14 0.002 ms 0.002 ms 0.001 ms3 10.10.100.253 0.001 ms 0.002 ms 0.001 ms4 10.10.8.18 0.002 ms 0.002 ms 0.002 ms5 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 C6traceroute to C6 (10.10.6.2), 30 hops max, 46 byte packets1 10.10.9.254 0.004 ms 0.002 ms 0.002 ms2 10.10.8.14 0.001 ms 0.002 ms 0.002 ms3 10.10.200.254 0.002 ms 0.001 ms 0.002 ms4 10.10.4.18 0.001 ms 0.002 ms 0.002 ms5 10.10.6.2 0.002 ms 0.002 ms 0.001 ms