Skip to content

Commit 6bfa3a2

Browse files
Upgraded FRR to 10.3.0 from 9.1.0 + saner intf addresses/masks + changed FRR config to ensure Updates from FRR have NHOP + solo option workaround to avoid FRR reflecting back routes + added get_states in Makefile
1 parent 77e3e18 commit 6bfa3a2

File tree

4 files changed

+52
-30
lines changed

4 files changed

+52
-30
lines changed

docker-compose/cpdp-frr/Makefile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ deploy-lab:
6464
deploy-net:
6565
sudo /bin/bash ../../utils/connect_containers_veth.sh cpdp-frr_traffic_engine_1_1 cpdp-frr_frr_1 veth0 veth1
6666
sudo /bin/bash ../../utils/connect_containers_veth.sh cpdp-frr_traffic_engine_2_1 cpdp-frr_frr_1 veth2 veth3
67-
sleep 10
6867

6968
deploy-clab:
7069
sudo -E containerlab deploy --reconfigure
@@ -88,7 +87,7 @@ otg-set-config:
8887
@echo "############################################"
8988
@echo "# Apply OTG configuration"
9089
@echo
91-
sleep 5 # pause for keng-controller to detect newly created interfaces
90+
sleep 10 # pause for containers to get ready
9291
curl -sk "$(OTG_HOST)/config" \
9392
-H "Content-Type: application/json" \
9493
-d @otg.json | tee curl.out
@@ -121,19 +120,30 @@ otg-fetch-bgp:
121120
@echo "############################################"
122121
@echo "# Fetch BGP metrics"
123122
@echo
124-
sleep 5 # pause for BGP to converge
123+
sleep 10 # pause for BGP to converge
125124
curl -sk "$(OTG_HOST)/monitor/metrics" \
126125
-X POST \
127126
-H 'Content-Type: application/json' \
128127
-d '{ "choice": "bgpv4" }' | tee curl.out
129128
@echo
130129
cat curl.out | jq -e "if (.bgpv4_metrics | length) == 2 and \
131130
.bgpv4_metrics[0].session_state == \"up\" and \
132-
.bgpv4_metrics[0].routes_received == \"2\" and \
131+
.bgpv4_metrics[0].routes_received == \"1\" and \
133132
.bgpv4_metrics[1].session_state == \"up\" and \
134-
.bgpv4_metrics[1].routes_received == \"2\" \
133+
.bgpv4_metrics[1].routes_received == \"1\" \
135134
then true else false end"
136135

136+
sleep 4 #Next fetch the routes learned.
137+
#Note: By default FRR seems to be sending back same prefix which it learned
138+
#which it should not. Added solo mode in FRR config to work around this.
139+
@echo "# Fetch BGP prefixes"
140+
@echo
141+
curl -sk "${OTG_HOST}/monitor/states" \
142+
-X POST \
143+
-H 'Content-Type: application/json' \
144+
-d '{ "choice": "bgp_prefixes" }'
145+
146+
137147
otg-trasmit:
138148
@echo "############################################"
139149
@echo "# Start transmitting flows"

docker-compose/cpdp-frr/compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ services:
4545
environment:
4646
- INTF_LIST=veth2
4747
frr:
48-
image: quay.io/frrouting/frr:9.1.0
48+
image: quay.io/frrouting/frr:10.3.0
4949
cap_add:
5050
- NET_ADMIN
5151
- NET_RAW

docker-compose/cpdp-frr/frr/frr.conf

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,51 @@
11
!
2-
frr version 8.2.2_git
32
frr defaults traditional
43
hostname frr
54
no ipv6 forwarding
65
log stdout
76
!
87
interface veth1
9-
ip address 192.0.2.2/30
8+
ip address 192.0.2.2/24
109
exit
1110
!
1211
interface veth3
13-
ip address 192.0.2.6/30
12+
ip address 192.0.3.2/24
1413
exit
1514
!
1615
interface lo
1716
ip address 3.3.3.3/32
1817
exit
1918
!
19+
#Without the route-map forcing FRR to add the NHOP, FRR
20+
#was forwarding Updates without NHOP, causing session flap.
21+
#Root cause of this is not known. Please log an Issue in ixia-c
22+
#repo if change in FRR config/specific behaviour on ixia-c side
23+
#is known to get FRR to include NHOP without needing this.
24+
route-map SETNH permit 10
25+
set ip next-hop 192.0.2.2
26+
exit
27+
!
28+
route-map SETNH2 permit 10
29+
set ip next-hop 192.0.3.2
30+
exit
31+
!
2032
router bgp 3333
2133
bgp router-id 3.3.3.3
2234
no bgp ebgp-requires-policy
2335
neighbor 192.0.2.1 remote-as 1111
36+
neighbor 192.0.3.1 remote-as 2222
37+
#Somehow without this it sends back routes to originating port!
2438
neighbor 192.0.2.1 solo
25-
neighbor 192.0.2.1 next-hop-self
26-
neighbor 192.0.2.5 remote-as 2222
27-
neighbor 192.0.2.5 solo
28-
neighbor 192.0.2.5 next-hop-self
39+
neighbor 192.0.3.1 solo
40+
!
41+
address-family ipv4 unicast
42+
#This should have worked but need the route-map
43+
#to force FRR to include NHOP. Refer above.
44+
#neighbor 192.0.2.1 next-hop-self
45+
neighbor 192.0.2.1 route-map SETNH out
46+
neighbor 192.0.3.1 route-map SETNH2 out
47+
exit-address-family
48+
2949
exit
3050
!
3151
end

docker-compose/cpdp-frr/otg.json

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
{
2222
"gateway": "192.0.2.2",
2323
"address": "192.0.2.1",
24-
"prefix": 30,
24+
"prefix": 24,
2525
"name": "otg1.eth[0].ipv4[0]"
2626
}
2727
],
@@ -31,7 +31,7 @@
3131
}
3232
],
3333
"bgp": {
34-
"router_id": "1.1.1.1",
34+
"router_id": "192.0.2.1",
3535
"ipv4_interfaces": [
3636
{
3737
"ipv4_name": "otg1.eth[0].ipv4[0]",
@@ -51,16 +51,12 @@
5151
"step": 1
5252
}
5353
],
54-
"next_hop_mode": "manual",
55-
"next_hop_address_type": "ipv4",
56-
"next_hop_ipv4_address": "192.0.2.1",
5754
"name": "otg1.bgp4.peer[0].rr4"
5855
}
5956
],
6057
"name": "otg1.bgp4.peer[0]",
6158
"learned_information_filter": {
62-
"unicast_ipv4_prefix": true,
63-
"unicast_ipv6_prefix": true
59+
"unicast_ipv4_prefix": true
6460
}
6561
}
6662
]
@@ -78,9 +74,9 @@
7874
},
7975
"ipv4_addresses": [
8076
{
81-
"gateway": "192.0.2.6",
82-
"address": "192.0.2.5",
83-
"prefix": 30,
77+
"gateway": "192.0.3.2",
78+
"address": "192.0.3.1",
79+
"prefix": 24,
8480
"name": "otg2.eth[0].ipv4[0]"
8581
}
8682
],
@@ -90,13 +86,13 @@
9086
}
9187
],
9288
"bgp": {
93-
"router_id": "2.2.2.2",
89+
"router_id": "192.0.3.2",
9490
"ipv4_interfaces": [
9591
{
9692
"ipv4_name": "otg2.eth[0].ipv4[0]",
9793
"peers": [
9894
{
99-
"peer_address": "192.0.2.6",
95+
"peer_address": "192.0.3.2",
10096
"as_type": "ebgp",
10197
"as_number": 2222,
10298
"as_number_width": "four",
@@ -110,16 +106,12 @@
110106
"step": 1
111107
}
112108
],
113-
"next_hop_mode": "manual",
114-
"next_hop_address_type": "ipv4",
115-
"next_hop_ipv4_address": "192.0.2.5",
116109
"name": "otg2.bgp4.peer[0].rr4"
117110
}
118111
],
119112
"name": "otg2.bgp4.peer[0]",
120113
"learned_information_filter": {
121-
"unicast_ipv4_prefix": true,
122-
"unicast_ipv6_prefix": true
114+
"unicast_ipv4_prefix": true
123115
}
124116
}
125117
]

0 commit comments

Comments
 (0)