services/Distributed-Wiki.md
... ...
@@ -204,7 +204,7 @@ group gollum-watchdog {
204 204
peer-as <peeras>;
205 205
}
206 206
207
- ## (example) peer with one of our iBGP speakers:
207
+ ## (example ipv4) peer with one of our iBGP speakers:
208 208
neighbor 172.22.0.1 {
209 209
router-id 172.23.0.80;
210 210
local-address 172.22.0.2;
... ...
@@ -212,6 +212,14 @@ group gollum-watchdog {
212 212
peer-as 123456;
213 213
}
214 214
215
+ ## (example ipv6) peer with one of our iBGP speakers:
216
+ neighbor fd42:4992:6a6d::1 {
217
+ router-id 172.22.0.80;
218
+ local-address fd42:4992:6a6d::2;
219
+ local-as 123456;
220
+ peer-as 123456;
221
+ }
222
+
215 223
## ...
216 224
217 225
process watch-gollum {
... ...
@@ -233,13 +241,16 @@ Run `gollum-watchdog.sh` in a shell first to validate it's working:
233 241
CURL=curl
234 242
235 243
## url's to check (all listed must be alive to send announce)
236
-URL=( "http://172.23.0.80" "https://172.23.0.80" )
244
+URL=("http://172.23.0.80" "https://172.23.0.80" "http://[fd42:d42:d42:80::1]" "https://[fd42:d42:d42:80::1]")
237 245
238 246
## the anycast route (/28 due to prefix size limits)
239 247
ROUTE='172.23.0.80/28'
240
-
248
+## the anycast v6 route (/64 due to prefix size limits)
249
+ROUTE6='fd42:d42:d42:80::/64'
250
+
241 251
## the next-hop we'll be advertising to neighbor(s)
242 252
NEXTHOP='<source-address>'
253
+NEXTHOP6='<source-address-v6>'
243 254
244 255
## regex match this keyword against HTTP response from curl
245 256
VALIDATE_KEYWORD='gollum'
... ...
@@ -247,45 +258,45 @@ VALIDATE_KEYWORD='gollum'
247 258
INTERVAL=60
248 259
249 260
###########################
250
-
251
-RUN_STATE=0
252
-
253
-check_urls() {
254
- for url in "${URL[@]}"; do
255
-
261
+
262
+RUN_STATE=0
263
+
264
+check_urls() {
265
+ for url in "${URL[@]}"; do
266
+
256 267
## workaround curl errno 23 when piping
257 268
http_response=`${CURL} --insecure -L -o - "${url}"`
258
-
259
- echo "${http_response}" | egrep -q "${VALIDATE_KEYWORD}" || {
260
- return 1
261
- }
269
+
270
+ echo "${http_response}" | egrep -q "${VALIDATE_KEYWORD}" || {
271
+ return 1
272
+ }
262 273
263 274
## add more checks
264 275
265
- done
266
- return 0
276
+ done
277
+ return 0
267 278
}
268 279
269 280
while [ 1 ]; do
270
- if [ ${RUN_STATE} -eq 0 ]; then
271
- check_urls && {
272
- RUN_STATE=1
273
- echo "announce route ${ROUTE} next-hop ${NEXTHOP}"
274
- }
275
- else
276
- check_urls || {
277
- RUN_STATE=0
278
- echo "withdraw route ${ROUTE} next-hop ${NEXTHOP}"
279
- }
280
- fi
281
-
282
- sleep ${INTERVAL}
283
-
284
-done
281
+ if [ ${RUN_STATE} -eq 0 ]; then
282
+ check_urls && {
283
+ RUN_STATE=1
284
+ echo "announce route ${ROUTE} next-hop ${NEXTHOP}"
285
+ echo "announce route ${ROUTE6} next-hop ${NEXTHOP6}"
286
+ }
287
+ else
288
+ check_urls || {
289
+ RUN_STATE=0
290
+ echo "withdraw route ${ROUTE} next-hop ${NEXTHOP}"
291
+ echo "withdraw route ${ROUTE6} next-hop ${NEXTHOP6}"
292
+ }
293
+ fi
294
+
295
+ sleep ${INTERVAL}
296
+
297
+done
285 298
286 299
exit 0
287
-
288
-
289 300
```
290 301
291 302
#### Run
... ...
@@ -341,7 +352,6 @@ case ${1} in
341 352
esac
342 353
343 354
exit 0
344
-
345 355
```
346 356
347 357