Apnic Elearning:: Internet Routing Registry
Apnic Elearning:: Internet Routing Registry
2
What is Routing Policy
• Public description of the relationship between external BGP
peers
• Can also describe internal BGP peer relationship
• Usually registered at an IRR (Internet Routing Registry)
such as RADB or APNIC
3
Benefit of Routing Policy
• Who are my BGP peers
• What routes are
– Originated by a peer
– Imported from each peer
– Exported to each peer
– Preferred when multiple routes exist
4
Why Define a Routing Policy
• Documentation
• Provides routing security
– Can peer originate the route?
– Can peer act as transit for the route?
5
Internet Routing Registry (IRR)
• Number of public databases that contain routing policy
information which mirror each other:
– APNIC, RIPE, RADB, JPIRR, Level3
– http://www.irr.net/
• Stability and consistency of routing – network operators
share information
• Both public and private databases
• These databases are independent – but some exchange
data
– only register your data in one database
• List of Routing Registry
– http://www.irr.net/docs/list.html
6
Internet Routing Registry (IRR)
• IRRs are used in at least three distinct ways
– To publish your own routing intentions
– To construct and maintain routing filters and router configurations
– Diagnostic and information service for more general network
management
7
IRR Objects Query
• whois query from CLI
whois -h whois.apnic.net 2406:6400::/32
• You can search from APNIC website also
8
IRR Objects Query Flags
• IRR supports a number of flag option
– ! RADB Query Flags
– - RIPE/BIRD Query Flags
9
IRR Objects Query Flags
• -K flags for primary keys of an object are returned
– whois
whois -h
-h whois.apnic.net
whois.apnic.net -K-K2406:6400::/32
2406:6400::/32
10
Whois & IRR Database
• APNIC whois database also works as IRR database
• Integrated APNIC whois database & Internet Routing
Registry
11
RPSL
• Routing Policy Specification Language
• RPSL is object oriented
– These objects are registered in the Internet Routing Registry (IRR)
– route, autonomous system, router, contact and set objects
12
What is RPSL
• Describes things interesting to routing policy
– Prefixes
– AS Numbers
– Relationships between BGP peers
– Management responsibility
• For more about RPSL
– RFC-1786: RIPE-181
– RFC-2622: Routing Policy Specification Language
– RFC-2650: Using RPSL in Practice
– RFC-2726: PGP Authentication for RIPE Database Updates
– RFC-2725: Routing Policy System Security
– RFC-2769: Routing Policy System Replication
– RFC-4012: Routing Policy System Replication next generation
13
RPSL Objects
• RPSL objects are similar to RIPE-181 objects
• Objects
– set of attributes
• Attributes
– mandatory or optional
– values: single, list, multiple
• Class “key”
– set of attributes
– usually one attribute has the same name as the object’s class
– uniquely identify each object
• Class “key” = primary key
– must be specified first
14
RPSL Attributes
• Case insensitive
• Value of an attribute has a type
– <object-name>
– <as-number>
– <ipv4-address>
– <ipv6-address>
– <address-prefix>
– etc
15
APNIC Database Objects and Routing
Registry Objects
OBJECT PURPOSE
person Technical or administrative contacts responsible for an object
role Technical or administrative contacts represented by a role,
performed by one or more people
Inetnum / Allocation or assignment of IPv4 / IPv6 address space
inet6num
aut-num Registered holder of an AS number and corresponding routing
policy
route / route6 Single IPv4/IPv6 route injected into the Internet routing mesh
mntner Authorized agent to make changes to an object
as-set Collect together Autonomous Systems with shared properties
route-set Defines a set of routes prefixes
filter-set Defines a set of routes that are matched by a filter expression
16
Import and Export Attributes
• You can document your routing policy in your aut-num
object in the APNIC Database:
– Import lines describe what routes you accept from a neighbor and
what you do with them
– Export lines describe which routes you announce to your neighbor
17
Routing Policy Scenarios
Internet
Transit Provider
AS4608
aut-num: AS17821
Downstream
import: from AS65543 accept AS65543
AS131107 Customer export: to AS65543 announce AS17821 AS131107
18
RPSL Tools
• IRRToolSet (written in C++)
– https://github.com/irrtoolset/irrtoolset
• BGPQ3 (C)
– http://snar.spb.ru/prog/bgpq3/
19
Use of IRRToolSet
• Use IRRToolSet to generate filters based on information
stored in our routing registry
– Avoid filter errors (typos)
– Filters consistent with documented policy (need to get policy correct
though)
– Engineers don’t need to understand filter rules (it just works :-)
20
IRRToolSet : Installation
• Dependency (Debian / Ubuntu)
# apt-get install build-essential libtool subversion bison
flex libreadline-dev autoconf automake
• Installation
# wget
ftp://ftp.isc.org/isc/IRRToolSet/IRRToolSet-5.0.1/
irrtoolset-5.0.1.tar.gz
# tar –zxvf irrtoolset-5.0.1.tar.gz
# cd irrtoolset-5.0.1
# ./configure
# make
# make install
21
RtConfig CLI Options
• Defaults to using RADB
– -h whois.ra.net / whois.radb.net
– -p 43
– Default protocol irrd
22
RtConfig Syntax
• import / export pair for each link; syntax
@RtConfig [import/export] <yourASN> <yourRouterIP>
<neighbourASN> <neighbourRouterIP>
23
IRRToolSet Cisco Example
bash-3.2$ rtconfig -protocol bird -config cisco -h whois.apnic.net
<output truncated>
24
IRRToolSet JunOS Example
bash-3.2$ rtconfig -protocol bird -config junos -h whois.apnic.net
<output truncated>
protocols {
bgp {
group peer-2406:6400:10::2 {
type external;
peer-as 65001;
neighbor 2406:6400:10::2 {
import policy_65001_1 ;
family inet6 {
unicast;
}
}
}
}
}
25
Getting the Complete Picture
• Automation relies on the IRR being complete
– Not all resources are registered in an IRR
– Not all information is correct
26
RPSL in Summary
27
Questions
• Please remember to fill out the
feedback form
– <survey-link>
• Slide handouts will be available
after completing the survey
28
APNIC Helpdesk Chat
Thank You!
END OF SESSION
30