{"id":2655,"date":"2020-01-30T21:47:29","date_gmt":"2020-01-30T20:47:29","guid":{"rendered":"https:\/\/beufa.net\/?p=2655"},"modified":"2020-08-06T08:16:54","modified_gmt":"2020-08-06T07:16:54","slug":"rpki-more-routinator","status":"publish","type":"post","link":"https:\/\/beufa.net\/fr\/blog\/rpki-more-routinator\/","title":{"rendered":"RPKI &#8211; More Routinator &#8230;"},"content":{"rendered":"\n<p>Following previous article on <a rel=\"noreferrer noopener\" aria-label=\"RPKI \u2013 Use Routinator with Cisco IOS-XR (opens in a new tab)\" href=\"https:\/\/beufa.net\/blog\/rpki-use-routinator-rtr-cache-validator-cisco-ios-xr\/\" target=\"_blank\">RPKI \u2013 Use Routinator with Cisco IOS-XR<\/a>, you will find here some tips to run routinator in a production environnement.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">routinator configuration<\/h3>\n\n\n\n<p>Routinator can be started with a configuration file as below : <\/p>\n\n\n\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"sh\" data-theme=\"ambiance\" data-fontsize=\"13\" data-lines=\"20\" data-showlines=\"false\" data-copy=\"false\">routinator@srv-rpki01:~$ cat .routinator.conf\n# Routinator Configuration\n#\n# The configuration file is a TOML file. It consists of a sequence of\n# key-value pairs, each on its own line. Strings are to be enclosed in\n# double quotes. Lists of values can be given by enclosing a\n# comma-separated sequence of these values in square brackets.\n#\n# See https:\/\/github.com\/toml-lang\/toml for detailed information on the\n# format.\n#\n# This file contains all configuration settings with explanations and their\n# default values.\n\n# Repository directory\n#\n# This is where Routinator stores the local copy of the RPKI repository.\n# Any relative path is interpreted with respect to the directory this config\n# lives in.\n#\n# This setting is mandatory.\n#\nrepository-dir = \"\/home\/routinator\/.rpki-cache\/repository\/\"\n\n# Trust Anchor Locator (TAL) directory\n#\n# All the files with the extension \".tal\" in this directory are treated as\n# trust anchor locators for RPKI validation.\n#\n# A relative path is interpreted with respect to the directory this config\n# lives in.\n#\n# This setting is mandatory.\n#\ntal-dir = \"\/home\/routinator\/.rpki-cache\/tals\/\"\n\n# Local exceptions files\n#\n# This settings contains a array of paths to files that contain local\n# exceptions. The files are JSON files according to RFC 8416 (aka SLURM).\nexceptions = [\n\t\"\/home\/routinator\/.exceptions.slurm\"\n]\n\n# Strict mode\n#\n# If strict mode, Routinator will stick to the requirements in the respective\n# RFCs very strictly. See\n# https:\/\/github.com\/NLnetLabs\/rpki-rs\/blob\/master\/doc\/relaxed-validation.md\n# for information on what is allowed when strict mode is off.\n#strict = false\n\n# Rsync command\n#\n# This is the command to run as rsync. This is only command, no options.\nrsync-command = \"rsync\"\n\n# Rsync arguments\n#\n# This is a list of arguments to give to rsync.\n#rsync-args = []\n\n# Number of parallel rsync commands\n#\n# This is the maximum number of rsync commands that are run in parallel.\n# We are not sure, if the current default is any good. Some feedback whether\n# it is causing trouble or whether a higher value would even be fine is very\n# much appreciated.\n#\n#rsync-count = 4\n\n# Number of validation threads\n#\n# The number of threads that are used for validating the repository. The\n# default value is the number of CPUs.\nvalidation-threads = 2\n\n# Refresh interval\n#\n# How often the repository should be updated and validated in RTR mode.\n# Specifically, this is the number of seconds the process will wait after\n# having finished validation before starting the next update.\n#\n# The default is the value indirectly recommended by RFC 8210.\nrefresh = 3600\n\n# RTR retry interval\n#\n# This is the time an RTR client is told to wait before retrying a failed\n# query in seconds.\nretry = 600\n\n# RTR expire interval\n#\n# This is the time an RTR client is told to keep using data if it can't\n# refresh it.\n# default = 7200 (2h) set to 6h\nexpire = 21600\n\n# History size\n#\n# The number of deltas to keep. If a client requests an older delta, it is\n# served the entire set again.\n#\n# There was no particular reason for choosing the default ...\nhistory-size = 10\n\n# Listen addresses for RTR TCP transport.\n#\n# This is an array of strings, each string a socket address of the form\n# \"address:port\" with IPv6 address in square brackets.\nrtr-listen = [\"0.0.0.0:3323\"]\n\n# Listen addresses for Prometheus HTTP monitoring endpoint.\n#\n# This is an array of strings, each string a socket address of the form\n# \"address:port\" with IPv6 address in square brackets.\n#\n# Port 9556 is allocated for the routinator exporter.\n# https:\/\/github.com\/prometheus\/prometheus\/wiki\/Default-port-allocations\n#\nhttp-listen = [\"0.0.0.0:8080\"]\n\n# Log level\n#\n# The maximum log level (\"off\", \"error\", \"warn\", \"info\", or \"debug\") for\n# which to log messages.\nlog-level = \"info\"\n\n# Log target\n#\n# Where to log to. One of \"stderr\" for stderr, \"syslog\" for syslog, or \"file\"\n# for a file. If \"file\" is given, the \"log-file\" field needs to be given, too.\n#\n# Can also be \"default\", in which case \"syslog\" is used in daemon mode and\n# \"stderr\" otherwise\nlog = \"file\"\n\n# Syslog facility\n#\n# The syslog facility to log to if syslog logging is used.\n#syslog-facility = \"daemon\"\n\n# Log file\n#\n# The path to the file to log to if file logging is used. If the path is\n# relative, it is relative to the directory this config file lives in.\nlog-file = \"\/home\/routinator\/logs\/routinator.log\"\n\n# Daemon PID file\n#\n# When in daemon mode, Routinator can store its process ID in a file given\n# through this entry. It will keep that file locked while running. By default,\n# no pid file is used.\npid-file = \"\/home\/routinator\/routinator.pid\"\n\n# Daemon working directory\n#\n# If this entry is given, the daemon process will change its working directory\n# to this directory. Otherwise it remains in the current directory.\n#working-dir = \"\/home\/routinator\/\"\n\n# Daemon Chroot\n#\n# If this entry is given, the daemon process will change its root directory to\n# this directory. Startup will fail if any of the other directories given is\n# not within this directory.\n#chroot = ...<\/pre><\/div>\n\n\n\n<p>Please note the file<em> \/home\/routinator\/.exceptions.slurm<\/em>  will be used to create ROA\/ROV exceptions. <\/p>\n\n\n\n<p>Example below shows how to drop ROA received from TAL for ASN 65551, then create after local ROA exceptions for the prefix TEST-NET2 198.51.100.0\/24, with a maxPrefixLength \/24 and from ASN 65551.<\/p>\n\n\n\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"json\" data-theme=\"ambiance\" data-fontsize=\"13\" data-lines=\"Infinity\" data-showlines=\"false\" data-copy=\"false\">routinator@srv-rpki01:~$ cat .exceptions.slurm\n{\n  \"slurmVersion\": 1,\n  \"validationOutputFilters\": {\n   \"prefixFilters\": [\n      {\n        \"asn\": 65551,\n        \"comment\": \"All VRPs matching our ASN 65551 as we do assertions below\"\n      }\n   ],\n   \"bgpsecFilters\": [\n   ]\n  },\n  \"locallyAddedAssertions\": {\n   \"prefixAssertions\": [\n      {\n      \t\"asn\": 65551,\n      \t\"prefix\": \"198.51.100.0\/24\",\n      \t\"maxPrefixLength\": 24,\n      \t\"comment\": \"IPv4 TEST-NET2\"\n      }\n   ],\n   \"bgpsecAssertions\": [\n   ]\n  }\n}<\/pre><\/div>\n\n\n\n<p>Doing so will permit to create an ROA exception, distributed to your routers running RPKI. It will allow to permit this prefix to be considered as valid on your BGP infrastructure \/ routers running ROV, despite TAL valid, invalid and\/or unknown RPKI state.<\/p>\n\n\n\n<p><em><strong>Note : <\/strong><\/em>this is not propagated to TAL. And it should used only in emergency for certain circumstances. I create a temporary hack deployed by Ansible for invalid ROAs which are not well declared by the originator (yes it happen). It could occur for some prefixes when moving property of some blocks or moving from RIR to another. In this case, unwanted behaviour for your customer can occur and you need to create temporary exceptions to keep the route in your BGP RIB.<\/p>\n\n\n\n<p>If you need more details on how SLURM are defined and used, please take a look on :<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/tools.ietf.org\/html\/rfc8416\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">RFC 8416 : Simplified Local Internet Number Resource Management with the RPKI (SLURM)<\/a><\/li><li><a href=\"https:\/\/github.com\/NLnetLabs\/routinator\/tree\/master\/test\/slurm\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Github Routinator Examples : routinator\/test\/slurm\/ (opens in a new tab)\">Github Routinator Examples : routinator\/test\/slurm\/<\/a><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">systemd and routinator<\/h3>\n\n\n\n<p>To start automatically routinator with systemd, you just have to create the following unit file :<\/p>\n\n\n\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"sh\" data-theme=\"ambiance\" data-fontsize=\"13\" data-lines=\"Infinity\" data-showlines=\"false\" data-copy=\"false\">root@srv-rpki01:~# cat \/etc\/systemd\/system\/routinator.service\n[Unit]\nDescription=Routinator RPKI daemon\nAfter=network.target\n\n[Service]\nUser=routinator\nGroup=routinator\nRuntimeDirectory=routinator\nRuntimeDirectoryPreserve=yes\nRuntimeDirectoryMode=755\n\nEnvironment=\"\"\nPIDFile=\/home\/routinator\/routinator.pid\n\nExecStart=\/home\/routinator\/.cargo\/bin\/routinator server --pid-file \/home\/routinator\/routinator.pid --user routinator\nRestart=on-failure\n\n[Install]\nWantedBy=multi-user.target<\/pre><\/div>\n\n\n\n<p>Then enable and start it :<\/p>\n\n\n\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"sh\" data-theme=\"ambiance\" data-fontsize=\"13\" data-lines=\"Infinity\" data-showlines=\"false\" data-copy=\"false\">root@srv-rpki01:~# systemctl start routinator.service &amp;&amp; tail -f \/home\/routinator\/logs\/*\n\nroot@srv-rpki01:~# systemctl status routinator.service\n\u25cf routinator.service - Routinator RPKI daemon\n   Loaded: loaded (\/etc\/systemd\/system\/routinator.service; enabled; vendor preset: enabled)\n   Active: active (running) since Mon 2020-01-13 12:31:40 UTC; 2 weeks 3 days ago\n Main PID: 13469 (routinator)\n    Tasks: 9 (limit: 2361)\n   CGroup: \/system.slice\/routinator.service\n           \u2514\u250013469 \/home\/routinator\/.cargo\/bin\/routinator server --pid-file \/home\/routinator\/routinator.pid --user routinator\n\nJan 13 12:31:40 srv-rpki01 systemd[1]: Started Routinator RPKI daemon.\n\nroot@srv-rpki01:~# systemctl daemon-reload\n\nroot@srv-rpki01:~# systemctl enable routinator.service<\/pre><\/div>\n\n\n\n<p>Next : <a href=\"https:\/\/beufa.net\/blog\/rpki-routinator-monitoring-and-debug\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to monitor Routinator !<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Following previous article on RPKI \u2013 Use Routinator with Cisco IOS-XR, you will find here some tips to run routinator in a production environnement. routinator&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/beufa.net\/fr\/blog\/rpki-more-routinator\/\">Continue reading<span class=\"screen-reader-text\">RPKI &#8211; More Routinator &#8230;<\/span><\/a><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[93,103,73,123,107,122,124,120,121],"class_list":["post-2655","post","type-post","status-publish","format-standard","hentry","category-reseau","tag-bgp","tag-ios-xr","tag-network","tag-roa","tag-route-policy","tag-routinator","tag-rov","tag-rpki","tag-rtr","entry"],"_links":{"self":[{"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/posts\/2655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/comments?post=2655"}],"version-history":[{"count":3,"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/posts\/2655\/revisions"}],"predecessor-version":[{"id":2680,"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/posts\/2655\/revisions\/2680"}],"wp:attachment":[{"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/media?parent=2655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/categories?post=2655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/beufa.net\/fr\/wp-json\/wp\/v2\/tags?post=2655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}