-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify configuration, adapt packaging
- Loading branch information
Showing
15 changed files
with
223 additions
and
465 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
// The bgp-in filter works on incoming BGP UPDATE messages. | ||
// | ||
// One such message can contain multiple NLRI, thus multiple announcements or | ||
// withdrawals). To act on individual announcements or withdrawals, use the | ||
// 'rib-in' filter-map below. | ||
filter-map bgp-in( | ||
output: Log, | ||
bgp: BgpMsg, | ||
prov: Provenance, | ||
) { | ||
|
||
define { | ||
origin_to_log = AS65536; | ||
community_to_log = 0xffff029a; | ||
} | ||
|
||
apply { | ||
if bgp.aspath_origin(origin_to_log) { | ||
output.log_matched_origin(origin_to_log); | ||
} | ||
if bgp.contains_community(community_to_log) { | ||
output.log_matched_community(community_to_log) | ||
} | ||
|
||
accept | ||
} | ||
} | ||
|
||
// The bmp-in filter works on incoming BMP messages. | ||
// | ||
// While most BMP message will be of type RouteMonitoring (transporting route | ||
// information via an encapsulated BGP UPDATE message), this filter-map can act | ||
// on different types as well. Helper methods are provided, e.g. | ||
// 'is_peer_down()' returns true if the message is a BMP PeerDownNotification. | ||
filter-map bmp-in( | ||
output: Log, | ||
bmp: BmpMsg, | ||
prov: Provenance, | ||
) { | ||
define { | ||
my_asn = AS12345; | ||
asn_to_log = AS65536; | ||
community_to_log = 0xffff029a; | ||
} | ||
|
||
apply { | ||
if bmp.is_peer_down() { | ||
output.log_peer_down() | ||
} | ||
if bmp.is_ibgp(my_asn) { | ||
reject | ||
} else { | ||
if bmp.aspath_contains(asn_to_log) { | ||
output.log_matched_asn(asn_to_log); | ||
} | ||
if bmp.contains_community(community_to_log) { | ||
output.log_matched_community(community_to_log) | ||
} | ||
accept | ||
} | ||
} | ||
} | ||
|
||
// The rib-in-pre filter processes individual routes prior to insertion into the | ||
// main RIB. | ||
// | ||
// Different from the BGP UPDATE message in the bgp-in filter-map, and the BMP | ||
// RouteMonitoring message in the bmp-in filter-map, the rib-in filter works on | ||
// individual announcements and withdrawals, typed Route. | ||
// | ||
// Use the rib-in-pre filter to process routes based on their NLRI (often the | ||
// announced prefix itself), as most other things are simply more efficient to | ||
// do in the bgp-in/bmp-in stage. | ||
// Use the rib-in-post filter below to act on inserted Routes. | ||
filter-map rib-in-pre( | ||
output: Log, | ||
route: Route, | ||
context: RouteContext, | ||
) { | ||
|
||
define { | ||
attribute_to_log = 35; // OTC | ||
my_prefix = 100.40.0.0/17; | ||
//my_prefix = 2001:db8:1::/48; | ||
} | ||
|
||
apply { | ||
//if route.has_attribute(attribute_to_log) { | ||
// accept | ||
//} else { | ||
// reject | ||
//} | ||
if route.prefix_matches(my_prefix) { | ||
output.log_custom(10, 20); | ||
output.log_prefix(my_prefix); | ||
} | ||
|
||
accept | ||
} | ||
} | ||
|
||
// The rib-in-post filter processes Routes that have been accepted by the | ||
// rib-in-pre filter-map, and thus have been inserted in the RIB. | ||
// This filter-map is useful for logging/alerting purposes. | ||
|
||
//filter rib-in-post( | ||
// output: Log, | ||
// route: Route, | ||
// insertion_info: InsertionInfo, | ||
//) { | ||
// | ||
// define { | ||
// some_interesting_prefix = 100.40.0.0/17; | ||
// } | ||
// | ||
// apply { | ||
// //if route.announces(my_prefix) && insertion_info.is_new_best_path() { | ||
// // output.log_best_path() | ||
// //} | ||
// //if insertion_info.path_replaced(my_prefix) { | ||
// // output.log_best_path() | ||
// //} | ||
// | ||
// //if insertion_info.new_peer() { | ||
// // output.log_custom(1,1); | ||
// //} | ||
// //if insertion_info.prefix_new() { | ||
// // output.log_custom(2,1); | ||
// //} | ||
// | ||
// accept // no-op, but required | ||
// } | ||
//} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
log_level = "info" # "error", "warn", "info", "debug" or "trace" | ||
log_target = "stderr" # "stderr", "file" or "syslog" | ||
log_facility = "daemon" # used if log_target is "syslog" | ||
log_file = "./rotonda.log" # used if log_target is "file" | ||
|
||
roto_script = "filters.roto" | ||
|
||
http_listen = ["0.0.0.0:8080"] | ||
|
||
|
||
## BMP | ||
|
||
[units.bmp-in] | ||
type = "bmp-tcp-in" | ||
listen = "0.0.0.0:11019" | ||
http_api_path = "/bmp-routers/" | ||
tracing_mode = "Off" | ||
|
||
|
||
## BGP | ||
|
||
#[units.bgp-in] | ||
#type = "bgp-tcp-in" | ||
#listen = "10.1.0.254:179" | ||
#my_asn = 64512 | ||
#my_bgp_id = [10,1,0,254] | ||
# | ||
#[units.bgp-in.peers."10.1.0.1"] | ||
#name = "PeerA" | ||
#remote_asn = [] | ||
#protocols = ["Ipv4Unicast", "Ipv4Multicast", "Ipv6Unicast"] | ||
# | ||
#[units.bgp-in.peers."10.1.0.2"] | ||
#name = "PeerB" | ||
#remote_asn = [] | ||
#protocols = ["Ipv4Unicast", "Ipv6Unicast"] | ||
|
||
## MRT | ||
|
||
#[units.mrt-in] | ||
#type = "mrt-in" | ||
#filename = "path/to/bview.mrt" | ||
|
||
|
||
## RIB | ||
|
||
[units.rib] | ||
type = "rib" | ||
rib_type = "Physical" | ||
sources = ["bmp-in"] | ||
#sources = ["bgp-in", "bmp-in", "mrt-in"] | ||
|
||
|
||
## Targets | ||
|
||
[targets.null] | ||
type = "null-out" | ||
sources = ["rib"] | ||
|
||
#[targets.mqtt] | ||
#type = "mqtt-out" | ||
#sources = ["bmp-in", "bgp-in", "rib"] | ||
#destination = "localhost" | ||
#client_id = "rotonda" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.