We do have a man page manrsctl(8). Please read the following manual.
The manrsctl.yaml configuration file can be in these directories and it loaded by this order:
$HOME/.config/manrsctl/manrsctl.yaml/usr/local/etc/manrsctl/manrsctl.yaml/etc/manrsctl/manrsctl.yaml
To install manrsctl(8):
sudo make installTo uninstall:
sudo make uninstallUnder config, use me for your own AS information, and use peers for your peers' information.
Here are the me parameters:
number: Your ASNas-set: Your downstream AS setmax-prefix: Your maximum number of prefixes that you plan to advertiseprefixes: List of your current prefixes that you want to advertise
You can set these parameter under bgp key parameter of me:
router-id: BGP router-iddefault-ipv4: can be true or false (e.g:no bgp default ipv4-unicast)default-ipv6: can be true or false (e.g:no bgp default ipv6-unicast)enforce-first-as: can be true or false (e.g:no bgp enforce-first-as)suppress-fib-pending: can be true or false (e.g:no bgp suppress-fib-pending)graceful-restart: can be true or false (e.g:no bgp graceful-restart)import-check: can be true or false (e.g:no bgp network import-check)
Here are the rpki parameters, pass them as list:
preference: priority of servertype: for now, it only can betcpserver: IP address of the rpki serverport: port number
Here are the community parameters:
blackhole: blackhole communityno-export: no-export communitymy-prefix: (optional) Community tag of your own prefixes
You can set these parameter under upstream, ixp, downstream, peers of community:
adv_only: Only advertise to specific groupadv_no_export: Advertise to group category with no-export
You have 4 default standard communities with an additional extended to least significant 3 digits of the community:
bgp large-community-list standard CMS_PREFMOD_100 permit your_as:1:2100
bgp large-community-list standard CMS_PREFMOD_200 permit your_as:1:2200
bgp large-community-list standard CMS_PREFMOD_300 permit your_as:1:2300
bgp large-community-list standard CMS_PREFMOD_400 permit your_as:1:2400
bgp large-community-list expanded CME-PREFMOD_RANGE permit your_as:1:2...You have 5 informational communities:
3000: learned from upstream (CMS_LEARNT_UPSTREAM)3100: learned from downstream (CMS_LEARNT_DS)3200: learned from peer (CMS_LEARNT_PEER)3300: learned from IXP (CMS_LEARNT_IXP)
Add each peer configuration as a list. Here are the possible parameters for each upstream and ixp:
- key: Peer ASN (example: AS214145)
description: ASN Name
Add each peer configuration as a list. Here are the possible parameters for each peers and downstream:
- key: Peer ASN (example: AS214145)
description: ASN Nameas-set: AS-SET name (You can set an empty AS-SET if you want like: AS214145:AS-EMPTY)max-prefix: Peer maximum number of prefixes that you want to receiveaddpath_tx_all_paths: (optional) can be true or false.
For each peer configuration, optionally you can specify these parameters below:
neighbors: (optional) List of neighbor IP addressesupd-src: (optional) Source IP address of your BGPdisable-connected-check: (optional) can be true or false (e.g:neighbor ASx disable-connected-check). (except for IXP peers)ebgp-multihop: (optional) TTL value of BGP Packets (except for IXP peers)prepend: (optional) how many times should I prepend myself?
Note: disable-connected-check and ebgp-multihop will not apply to IXP peers
For each peer configuration, optionally you can specify a local preference and a community tag for valid and notfound RPKIs. For example:
config:
upstream:
AS6939:
description: HE
valid:
loc: 200
community: 2:501
notfound:
loc: 100
community: 2:511For IXP:
Import: RTM_IMPORT_FROM_ASx:
-
- permit call
RTM_INVALID_DENY
-
- deny if match rpki invalid
-
- deny if match
PFL_BOGON
- deny if match
-
- deny if match
PFL_V4_BOGON
- deny if match
-
- deny if match
ASP_REV_BOGON
- deny if match
-
- deny if match
ASP_REV_EDROP
- deny if match
-
- permit
- permit call
-
- permit call
RTM_IXP_IN
-
- permit call
RTM_CML_IN
-
- permit if match
CMS_BLACKHOLEthen callRTM_BLACKHOLE
- permit if match
-
- permit if match
CMS_NO_EXPORTthen callRTM_NO_EXPORT
- permit if match
-
- permit if match
CME_PREFMOD_RANGEthen callRTM_PREFMOD
- permit if match
-
- permit
- permit call
-
- permit set large-community
214145:1:3300 additive
- permit set large-community
- permit call
-
- permit if match rpki valid then optionally set local preference and community.
-
- permit if match rpki notfound then optionally set local preference and community.
-
- deny if match
PFL_ANY
- deny if match
Export: RTM_EXPORT_TO_ASx:
-
- permit call
RTM_INVALID_DENY
-
- deny if match rpki invalid
-
- deny if match
PFL_BOGON
- deny if match
-
- deny if match
PFL_V4_BOGON
- deny if match
-
- deny if match
ASP_REV_BOGON
- deny if match
-
- permit
- permit call
-
- permit call
RTM_CML_FLT_TO_IXP
-
- deny
CMS_UPS_ONLY
- deny
-
- deny
CMS_DS_ONLY
- deny
-
- deny
CMS_PEERS_ONLY
- deny
-
- permit if match
CMS_IXP_NO_EXPORTthen callRTM_NO_EXPORT
- permit if match
-
- permit
- permit call
-
- permit if match rpki valid AND
PFL_EXPORT_FROM_ASy.
- permit if match rpki valid AND
-
- permit if match rpki valid AND
CMS_LEARNT_DS.
- permit if match rpki valid AND
-
- deny if match
PFL_ANY
- deny if match
Checkout /usr/local/etc/manrsctl/manrsctl.conf.sample.
To generate random host (/64) address:
manrsctl ipv6 randWe use these suffixes:
PFLas prefix-listsRTMas route-mapASPas as-pathCMEas Community List ExtendedCMSas Community List Standard
You can match communities we provide actions for, on routes receives from customers, IXP, and Upstream.
Communities values of 214145:1:X, with X, have actions:
1:100- blackhole the prefix1:200- set no_export1:300- advertise only to other customers1:400- advertise only to ixp1:500- advertise only to upstreams1:600- set no_export when advertising to upstreams1:2X00- set local_preference to X00
Note: We are only using large communities to support 4-Byte ASN.
To update the as path lists, prefix lists, and the route-maps, use manrsctl cron update.
To update the Bogon as-path lists, and prefix lists use manrsctl cron bogon.
To generate the full configuration (with bgp neighborships), use manrsctl cron full.
Any PR(s) are welcomed. Check the wiki section of Github for more information.
- We refer to the
-lib.shfiles as libraries. - We refer to the non-library files in the
libdirectory as helpers. - We do not import helpers inside another helper.
- We use
fltas abbriviation for filter. - We use
upsas abbriviation for upstream.
Here is our naming standard:
${name}_${ass}_${ds}_${version}_${direction}_${rev}_${helper}_${result}- result:
- get: result of one function
- list: result of multiple functions
- check: result of verifications
- helper: name of helper file of function
cfg: Configuration Filebgp: BGPpfl: Prefix-Listasp: AS-Pathfrr: Frroutingrtm: Route-Mapcml: Community Lists
- rev: (optional) is it reverse of another function?
- direction: (optional) in or out?
- version: (optional) is it ipv4 (defined as
_v4) or not (empty)? - ds: (optional) does it have any downstream (defined as
_ds) or not (defined as_ds_rev)? - ass: (optional) does it have any as-set (defined as
_ass) or not (defined as_ass_rev)? - name: simply name of function
Add EDROP: