RtConfig(1)

NAME
RtConfig

SYNOPSIS
RtConfig [flags]

DESCRIPTION

RtConfig analyzes the routing policies registered in the Internet Routing Registry (IRR) and produces router configuration files. It supports cisco, gated and RSd router configuration file formats. RtConfig reads lines form the standard input, and prints them to the standard output, except for the lines that start with "@RtConfig" which instruct RtConfig to perform special operation (please see "RtConfig Commands" Section below). RtConfig establishes an radbserver connection to query IRR.

RAToolSet COMMON OPTIONS

    -help
        Print summary of command-line options and abort.

    -T [whois_query | whois_response | input | all]
        Trace the argument. Useful for debugging.

    -D <integer>
        Print debugging messages of debug channel <integer> (if compiled with DEBUG defined).

    -version
        Print the version number and quit.

    -h <host-name>
        Establish an radbserver connection to host <host-name>.

    -p <port-no>
        Establish an radbserver connection to port <port-no>.

    -s <source-list>
        Consider the sources specified in the comma separated <source-list>. If an object is defined in multiple sources in <source-list>, RtConfig uses the definition first encountered in <source-list> from left to right.

    -rusage
        Print resource usage upon completion.

    -prompt <new-prompt>
        Change the prompt to <new-prompt> when invoked interactively. By default the prompt is "RtConfig> ".

    -ignore_errors
        Do not print error and warning messages due to communication to the database server or parsing policy objects.

    -report_errors
        Print error and warning messages due to communication to the database server or parsing policy objects.

OTHER OPTIONS

    -config <config-format>
        Produce router configuration in <config-format> which is either cisco (default), gated or rsd.

    -force_match_ip_inbound
        cisco route maps do not support in-bound ip access-list matches (at least up to IOS version 11), and RtConfig uses distribute-lists to overcome this. Under certain cases, it is not possible to use distribute-lists (e.g. if you are assigning different preferences to routes depending on the destination address prefix). This option forces RtConfig to use route maps with "match ip address" clause. This option should be used once this feature is supported in a future cisco IOS release (they have plans).

    -disable_access_list_cache
        RtConfig caches the access-lists (and in the future ip as-path access-lists and route-maps) that it generates so that the same access-list number can be reused instead of generating a new access list. If you do not want RtConfig to consume much memory, -disable_access_list_cache option can be used to turn off this feature. However, if you are short on memory on your cisco box, you should leave this feature enabled.

    -supress_martian
        This option only affects cisco configurations. All access lists generated will deny the following routes:
              host 0.0.0.0 any
              127.0.0.0 0.255.255.255 255.0.0.0 0.255.255.255
              10.0.0.0 0.255.255.255 255.0.0.0 0.255.255.255
              172.16.0.0 0.15.255.255 255.240.0.0 0.15.255.255
              192.168.0.0 0.0.255.255 255.255.0.0 0.0.255.255
              192.0.2.0 0.0.0.255 255.255.255.0 0.0.0.255
              128.0.0.0 0.0.255.255 255.255.0.0 0.0.255.255
              191.255.0.0 0.0.255.255 255.255.0.0 0.0.255.255
              192.0.0.0 0.0.0.255 255.255.255.0 0.0.0.255
              223.255.255.0 0.0.0.255 255.255.255.0 0.0.0.255
              224.0.0.0 31.255.255.255 224.0.0.0 31.255.255.255
              any 255.255.255.128 0.0.0.127

    -cisco_compress_acls
        This option only affects cisco configurations. This option is used to combine multiple cisco access list lines into a single line using wildcards whenever possible.

ENVIRONMENT VARIABLES

    IRR_HOST
        Specifies the radbserver host to connect.

    IRR_PORT
        Specifies the radbserver port number to connect.

    IRR_SOURCES
        Specifies the source list (comma separated) to consider.

Command line options take precedence over environment variables.

RtConfig COMMANDS

RtConfig copies standard input to standard output except when it encounters RtConfig commands on the standard input. All RtConfig commands start with "@RtConfig" at the beginning of a line. Currently the following commands are implemented:

    @RtConfig import <ASN-1> <rtr-1> <ASN-2> <rtr-2>
        <ASN-1> and <ASN-2> are AS numbers preceded with string "AS". For example, AS number 1 is specified as "AS1". <rtr-1> and <rtr-2> are ip addresses in prefix notation. For example, the router with address 128.9.128.9 is specified as "128.9.128.9/32". This command instructs RtConfig to generate import filters where <rtr-1> in <ASN-1> is importing routes from <rtr-2> in <ASN-2>. The appropriate filters are generated by considering the as-in lines for <ASN-2>, the interas-in lines for <ASN-2>-<rtr-1>-<rtr-2> in the aut-num object for <ASN-1>. If you have not used interas-in lines, it is possible to use "0.0.0.0/32" for <rtr-1> and <rtr-2>.

    @RtConfig export <ASN-1> <rtr-1> <ASN-2> <rtr-2>
        The arguments of the export command are the same as the import command. This command instructs RtConfig to generate export filters where <rtr-1> in <ASN-1> is exporting routes to <rtr-2> in <ASN-2>. The appropriate filters are generated by considering the as-out lines for <ASN-2>, the interas-out lines for <ASN-2>-<rtr-1>-<rtr-2> in the aut-num object for <ASN-1>.

    @RtConfig set sources = <source-list>
        <source-list> is string containing comma separated list of sources to consider. This command instruct RtConfig to change the list of sources considered.

Cisco specific commands:

    @RtConfig set cisco_map_name = <map-name>
        <map-name> is a quoted string. This command instruct RtConfig to use <map-name> as the name for the route maps generated.

    @RtConfig set cisco_map_first_no = <no>
        <no> is an integer. This command instruct RtConfig to use <no> as the first number of a newly generated route map. If missing, 1 is used.

    @RtConfig set cisco_map_increment_by = <no>
        <no> is an integer. This command instruct RtConfig to increment route map numbers by <no>. If missing, successive route maps are numbered by increments of 1.

    @RtConfig set cisco_access_list_no = <no>
        <no> is an integer. This command instruct RtConfig to start numbering access lists at number.

    @RtConfig set cisco_max_preference = <no>
        <no> is an integer defaulting to 1000. This command instruct RtConfig to start using preferences from <no> (most preferred) and counting down from there.

    @RtConfig networks <ASN-1>
        <ASN-1> is an AS number preceded with string "AS". For each route registered with origin <ASN-1>, a network statement of the form "network <prefix> mask <mask>" is generated.

    @RtConfig default <ASN-1> <ASN-2>
        <ASN-1> and <ASN-2> are AS numbers preceded with string "AS". This command instructs RtConfig to generate "ip default-network" statements where <ASN-1> is defaulting to <ASN-2>. The appropriate statements are generated for the network addresses listed in the default attribute for <ASN-2> in the aut-num object of <ASN-1>.

    @RtConfig pkt_filter <if-name> <ASN-1> <rtr-1> <ASN-2> <rtr-2>
        The arguments of the pkt_filter command are the same as the import command. This command instructs RtConfig to generate packet filters where <rtr-1> in <ASN-1> is going to drop data packets that are received from <rtr-2> in <ASN-2>, but do not have source addresses inside the address prefixes imported from this peer. The appropriate filters are generated by considering the as-in lines for <ASN-2>, the interas-in lines for <ASN-2>-<rtr-1>-<rtr-2> in the aut-num object for <ASN-1>. The filter is applied to the interface <if-name> in the inbound direction. The <if-name> is a string and must be enclosed in double quotes.

    @RtConfig outbound_pkt_filter <if-name> <ASN-1> <rtr-1> <ASN-2> <rtr-2>
        Same as the pkt_filter command, except the appropriate filters are generated by considering the as-out lines for <ASN-2>, the interas-out lines for <ASN-2>-<rtr-1>-<rtr-2> in the aut-num object for <ASN-1>. The filter is applied to the interface <if-name> in the outbound direction.

RSd specific commands:

    There is no export command for RSd. When an import command is used for RSd, both the import policies of <ASN-1> and the export policies of <ASN-2> are considered.

EXAMPLES

Here is an example input file:
	!
	version 10.3
	!
	interface Ethernet0/0
	 ip address 198.32.4.1 255.255.255.0
	!
	router bgp 4550
	 neighbor 198.32.4.25 remote-as 4551
	!
	@RtConfig set cisco_map_name = "mymap"
	@RtConfig set cisco_access_list_no = 500
	@RtConfig import AS4550 198.32.4.1/32 AS4551 198.32.4.25/32
	!
	end

Please see the tests directory in the distribution for more examples.

LIMITATIONS

Cisco Configuration Generation:

    Policies in IRR which has as-path regular expressions containing [,] are only converted if (1) it is not a negated set, (2) it does not contain ranges with more than 10 numbers in the range. The following examples are not converted:
    	[^ AS1]
    	[AS1-AS11]
    The first one is not converted because it is a negated set. The second one is not converted because AS1-AS11 contains 11 numbers. The following examples are converted:
    	[AS1 AS56 AS100]
    	[AS1-AS10]
    	[AS5 AS100-AS105 AS200 AS300-AS307]
    Note that the last example contains 16 numbers which is more than 10. This is converted since no single range (AS100-AS105 or AS300-AS307) contains more than 10 numbers.

Gated Configuration Generation:

    As path regular expressions generated for gated requires ISI's patches to gated's regular expressions.

AUTHORS
Cengiz Alaettinoglu <cengiz@isi.edu>