BGP Origin Validation Using RPKI
This example shows how to configure RPKI, configure RPKI validator, RPKI validator verification and operation, and the Origin Validation.
Configure RPKI
This configuration example provides instructions to configure RPKI.
Requirements
This example uses the following hardware and software components:
Tested with Junos OS 19.2R1.8 (Origin Validation supported since Junos OS Release 12.2).
Two MX204 routers.
A virtual machine (VM)
Overview
Figure 1 shows a high-level network diagram used for reference throughout this document.
The two MX204 routers, Router1 and Router2, are border routers that control the routes received from upstream ISPs. RPKI is configured on these two routers. The virtual machine (VM) (IP address 172.18.158.39) runs the RIPE NCC RPKI Validator. This VM downloads the RPKI ROA’s from the 5 RIRs.

Configure RPKI
The BGP import policy accepts both VALID and UNKOWN validation states and rejects routes that have a RPKI INVALID validation state.
The relevant configuration for the Router1 MX204 are highlighted in the following router options:
Configure the RPKI Validator
RPKI validator configuration uses the RPKI validator from RIPE NCC, and the other validators are available from NLnet Labs, and Cloudflare.
In the case of the RIPE NCC validator, a Linux operating system with OpenJDK 8 or higher and rsync support is required. The validation software is available at the RIPE’s website and it is downloaded to the server. Figure 2 shows the RIPE NCC download screen for the RPKI validator software.

This configuration uses a VM running Ubuntu 18.04.4 LTS. This RPKI validator package does not require installation. The package is ready to run when you extract it. The package supports a Web-based interface on port 8080 for monitoring and configuring the validator. Without changes to the configuration, the package listens on port 8323 for RPKI-RTR communications. The configuration is shown below.
root@dev01:/var/tmp# wget https://ftp.ripe.net/tools/rpki/validator3/prod/generic/rpki-validator-3-latest-dist.tar.gz
--2020-03-31 23:07:38-- https://ftp.ripe.net/tools/rpki/validator3/prod/generic/rpki-validator-3-latest-dist.tar.gz Resolving ftp.ripe.net (ftp.ripe.net)... 193.0.6.140, 2001:67c:2e8:22::c100:68c Connecting to ftp.ripe.net (ftp.ripe.net)|193.0.6.140|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 42677891 (41M) [application/x-gzip] Saving to: 'rpki-validator-3-latest-dist.tar.gz' rpki-validator-3-latest-dist.tar.gz 100%[=================================================================================================>] 40.70M 34.9MB/s in 1.2s 2020-03-31 23:07:39 (34.9 MB/s) - 'rpki-validator-3-latest-dist.tar.gz' saved [42677891/42677891]
root@dev01:/var/tmp# tar zxvf rpki-validator-3-latest-dist.tar.gz
rpki-validator-3.1-2020.01.13.09.31.26/lib/rpki-validator-3.jar rpki-validator-3.1-2020.01.13.09.31.26/README.txt rpki-validator-3.1-2020.01.13.09.31.26/ rpki-validator-3.1-2020.01.13.09.31.26/preconfigured-tals/ rpki-validator-3.1-2020.01.13.09.31.26/db/ rpki-validator-3.1-2020.01.13.09.31.26/rsync/ rpki-validator-3.1-2020.01.13.09.31.26/preconfigured-tals/ripe-ncc.tal rpki-validator-3.1-2020.01.13.09.31.26/preconfigured-tals/afrinic.tal rpki-validator-3.1-2020.01.13.09.31.26/preconfigured-tals/lacnic.tal rpki-validator-3.1-2020.01.13.09.31.26/preconfigured-tals/apnic.tal rpki-validator-3.1-2020.01.13.09.31.26/conf/ rpki-validator-3.1-2020.01.13.09.31.26/conf/application.properties rpki-validator-3.1-2020.01.13.09.31.26/conf/application-defaults.properties rpki-validator-3.1-2020.01.13.09.31.26/LICENSE.txt rpki-validator-3.1-2020.01.13.09.31.26/rpki-validator-3.sh rpki-validator-3.1-2020.01.13.09.31.26/upload-tal.sh
root@vm1:/var/tmp# cd rpki-validator-3.1-2020.01.13.09.31.26/
By default, the validator listens to the localhost only. If you need to change this behavior, comment the optserver.address=localhostion or specify a different IP address in the application.properties file in the conf/ directory.
The next step is to start the validator:
root@dev01:~/rpki-validator-3.1-2020.01.13.09.31.26#
./rpki-validator-3.sh
2020-04-01 08:16:09,039 INFO main n.r.r.v.Validator3Application Starting Validator3Application v3.1-SNAPSHOT on dev01 with PID 30718 (/tmp/rpki-validator-3.1-2020.01.13.09.31.26/lib/rpki-validator-3.jar started by root in /tmp/rpki-validator-3.1-2020.01.13.09.31.26)
Console shows output and after some time a pattern of retrieving and validating ROAs is noticed.
You must download and install the ARIN TAL for a fully functional validator. See https://github.com/RIPE-NCC/rpki-validator-3/wiki for the installation procedure.
In summary, the steps include:
Download TAL from https://www.arin.net/resources/manage/rpki/tal/
Execute: ./upload-tal.sh arin-rfc7730.tal http://localhost:8080/
Start the RPKI-RTR daemon that handles the connection between the validator and the router.
For a reachable RTR server, besides localhost, you need to change the application.properties file in the conf/ directory for the validator.
RPKI Validator Verification and Operation
You can use the Web interface to view the state of the RPKI validator process. Figure 3 shows how to check the state of downloading and validating ROAs from the preconfigured RIR RPKI repository (Trust Anchors).

You can check the connection state from the routers to the RPKI roots as well. Figure 4 shows the view of the validated ROAs from various NICs and the RIPE NCC.

The RPKI validator has a very useful feature, the Whitelist, which lets you create your own ROAs locally as seen in Figure 5.

Origin Validation Using RPKI Configured on a Junos OS Router
The Junos OS has the following two commands focused on Origin Validation:
- The show validation command displays the state
of the router with regard to the RPKI validators.
user@Router1> show validation ?
Possible completions: database Show contents of route validation database group Show route validation redundancy groups replication Show route validation replication information session Show route validation session information statistics Show route validation statistics
user@Router1> show validation session
Session State Flaps Uptime #IPv4/Ipv6 records 172.18.158.39 Up 0 06:33:59 3985/668
user@Router1> show validation database
RV database for instance master Prefix Origin-AS Session State Mismatch 10.0.0.0/12-16 64508 172.18.158.39 valid 10.0.0.0/16-16 64508 172.18.158.39 valid 10.0.0.0/22-24 64500 172.18.158.39 valid 10.1.0.0/16-16 64508 172.18.158.39 valid 10.2.0.0/16-16 64508 172.18.158.39 valid 10.3.0.0/16-16 64508 172.18.158.39 valid 10.4.0.0/16-16 64508 172.18.158.39 valid 10.5.0.0/16-16 64508 172.18.158.39 valid 10.6.0.0/16-16 64508 172.18.158.39 valid 10.8.0.0/16-16 64508 172.18.158.39 valid 10.9.0.0/16-16 64508 172.18.158.39 valid 10.10.0.0/16-16 64508 172.18.158.39 valid 10.11.0.0/16-16 64508 172.18.158.39 valid 10.110.0.0/16-16 64508 172.18.158.39 valid 10.13.0.0/16-16 64508 172.18.158.39 valid 10.14.0.0/16-16 64508 172.18.158.39 valid 10.80.0.0/14-14 64507 172.18.158.39 valid 172.16.0.0/16-16 64500 172.18.158.39 valid <…>
user@Router1> show validation statistics
Total RV records: 4653 Total Replication RV records: 4653 Prefix entries: 4434 Origin-AS entries: 4653 Memory utilization: 907142 bytes Policy origin-validation requests: 700 Valid: 4 Invalid: 232 Unknown: 464 BGP import policy reevaluation notifications: 100 inet.0, 100 inet6.0, 0
- The show route validation-state command displays
routes having a certain validation state.
user@Router1> show route validation-state ?
Possible completions: invalid Invalid route validation state unknown Unknown route validation state unverified Unverified route validation state valid Valid route validation state
The following three examples provide received routes and the resultant validation states on Router1.
10.0.0/24 thru 10.0.9/24
The RPKI validator has ROAs for 10.0.0/22 with a maximum prefix length of 24, which means all of the routes should have a state of VALID; however, there is also an ROA for 10.0.0.0/12-16 (maximum /16) for origin AS of 64508. This marks 10.0.4/24 thru 10.0.9/24 as INVALID.
172.16.0/24 thru 172.16.9/24
The RPKI validator has ROAs for 172.16.0.0/16 and a maximum prefix length of 16, which means all of these routes should have a state of INVALID. Even though the origin AS number is correct, they have exceeded the maximum prefix length of /16.
172.30.0.0/24 thru 172.30.9.0/24
The RPKI validator does not have ROAs for any of these routes, which means all of these should have a state of UNKNOWN.
user@Router1> show route validation-state valid
inet.0: 40 destinations, 40 routes (40 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.0/24 *[BGP/170] 00:36:02, localpref 100 AS path: 64500 ?, validation-state: valid > to 10.104.3.2 via ge-1/0/1.3110 10.0.1.0/24 *[BGP/170] 00:36:02, localpref 100 AS path: 64500 ?, validation-state: valid > to 10.104.3.2 via ge-1/0/1.3110 10.0.2.0/24 *[BGP/170] 00:36:02, localpref 100 AS path: 64500 ?, validation-state: valid > to 10.104.3.2 via ge-1/0/1.3110 10.0.3.0/24 *[BGP/170] 00:36:02, localpref 100 AS path: 64500 ?, validation-state: valid > to 10.104.3.2 via ge-1/0/1.3110
user@Router1> show route validation-state unknown
inet.0: 40 destinations, 40 routes (40 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 172.30.0.0/24 *[BGP/170] 00:36:06, localpref 100 AS path: 64500 ?, validation-state: unknown > to 10.104.3.2 via ge-1/0/1.3110 172.30.1.0/24 *[BGP/170] 00:36:06, localpref 100 AS path: 64500 ?, validation-state: unknown > to 10.104.3.2 via ge-1/0/1.3110 172.30.2.0/24 *[BGP/170] 00:36:06, localpref 100 AS path: 64500 ?, validation-state: unknown > to 10.104.3.2 via ge-1/0/1.3110 172.30.3.0/24 *[BGP/170] 00:36:06, localpref 100 AS path: 64500 ?, validation-state: unknown > to 10.104.3.2 via ge-1/0/1.3110 172.30.4.0/24 *[BGP/170] 00:36:06, localpref 100 AS path: 64500 ?, validation-state: unknown > to 10.104.3.2 via ge-1/0/1.3110 172.30.5.0/24 *[BGP/170] 00:36:06, localpref 100 AS path: 64500 ?, validation-state: unknown > to 10.104.3.2 via ge-1/0/1.3110 172.30.6.0/24 *[BGP/170] 00:36:06, localpref 100 AS path: 64500 ?, validation-state: unknown > to 10.104.3.2 via ge-1/0/1.3110 172.30.7.0/24 *[BGP/170] 00:36:06, localpref 100 AS path: 64500 ?, validation-state: unknown > to 10.104.3.2 via ge-1/0/1.3110 172.30.8.0/24 *[BGP/170] 00:36:06, localpref 100 AS path: 64500 ?, validation-state: unknown > to 10.104.3.2 via ge-1/0/1.3110 172.30.9.0/24 *[BGP/170] 00:36:06, localpref 100 AS path: 64500 ?, validation-state: unknown > to 10.104.3.2 via ge-1/0/1.3110
user@Router1> show route validation-state invalid
inet.0: 40 destinations, 40 routes (40 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.4.0/24 *[BGP/170] 00:36:09, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 10.0.5.0/24 *[BGP/170] 00:36:09, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 10.0.6.0/24 *[BGP/170] 00:36:09, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 10.0.7.0/24 *[BGP/170] 00:36:09, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 10.0.8.0/24 *[BGP/170] 00:36:09, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 10.0.9.0/24 *[BGP/170] 00:36:09, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 172.16.0.0/24 *[BGP/170] 00:36:08, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 172.16.1.0/24 *[BGP/170] 00:36:08, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 172.16.2.0/24 *[BGP/170] 00:36:08, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 172.16.3.0/24 *[BGP/170] 00:36:08, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 172.16.4.0/24 *[BGP/170] 00:36:08, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 172.16.5.0/24 *[BGP/170] 00:36:08, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 172.16.6.0/24 *[BGP/170] 00:36:08, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 172.16.7.0/24 *[BGP/170] 00:36:08, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 172.16.8.0/24 *[BGP/170] 00:36:08, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110 172.16.9.0/24 *[BGP/170] 00:36:08, localpref 100 AS path: 64500 ?, validation-state: invalid > to 10.104.3.2 via ge-1/0/1.3110