howto/Bird-communities.md
... ...
@@ -96,14 +96,14 @@ function update_crypto(int link_crypto) {
96 96
}
97 97
98 98
function update_flags(int link_latency; int link_bandwidth; int link_crypto)
99
-int latency;
100
-int bandwidth;
101
-int crypto;
99
+int dn42_latency;
100
+int dn42_bandwidth;
101
+int dn42_crypto;
102 102
{
103
-latency = update_latency(link_latency);
104
-bandwidth = update_bandwidth(link_bandwidth) - 20;
105
-crypto = update_crypto(link_crypto) - 30;
106
-if bandwidth > 4 then bandwidth = 4;
103
+dn42_latency = update_latency(link_latency);
104
+dn42_bandwidth = update_bandwidth(link_bandwidth) - 20;
105
+dn42_crypto = update_crypto(link_crypto) - 30;
106
+if dn42_bandwidth > 4 then dn42_bandwidth = 4;
107 107
return true;
108 108
}
109 109
```
... ...
@@ -122,8 +122,8 @@ include "/etc/bird/community_filters.conf";
122 122
### Bird bgp_local_pref calculation
123 123
If you are running a bigger network and also want to prioritize your traffic based on the communities, then you can look at the following below:
124 124
```
125
-bgp_local_pref = 10000+100*bandwidth + 50*(10-latency)-200*bgp_path.len+100*crypto; (as suggested by tombii)
126
-bgp_local_pref = 1000*bandwidth - 10*latency; if crypto < 2 then bgp_local_pref = 0; (as suggested by Jplitza)
125
+bgp_local_pref = 10000+100*dn42_bandwidth + 50*(10-dn42_latency)-200*bgp_path.len+100*dn42_crypto; (as suggested by tombii)
126
+bgp_local_pref = 1000*dn42_bandwidth - 10*dn42_latency; if dn42_crypto < 2 then bgp_local_pref = 0; (as suggested by Jplitza)
127 127
```
128 128
This calculation goes into the /etc/bird/community_filters.conf just above the return true; line. However for starters I recommend to skip the bgp_local_pref calculation part until you fully unterstand BGP routing and how this will affect not only you but the whole network. Assigning community flags to your peerings will hoever have an impact on dn42 in total. Remember, probably none of these alternatives are a good fit for your network, you will need to apply one and see how it affects your traffic and then going back and tweaking the formula and checking again.
129 129