The target option above is only used to specify the template directory to use in the generation of the configuration - specifically: application/views/router-cli/as112/{$target}/index.cfg. There is a full Quagga example available in the default templates at application/views/router-cli/as112/quagga/index.cfg. NB: Note that the target can also be specified on the command line - see below.

If dstpath is not set, the configuration will be generated to stdout. Otherwise, the configuration will be placed in the specified path in a file called as112-{$vlanid}.conf where $vlanid is the database ID of the VLAN for which we are generating the configuration.

Writing / Altering Configuration Templates

Remember - use skinning to make changes to this or add your own. For example, if you set target above to bird and had you skin configured as myixpskin, then the configuration would be generated from application/views/_skins/myixpskin/router-cli/as112/bird/index.cfg.

Contribute back - if you write a config generator for another router, please open a pull request and contribute it back to the project.

The follow variables are available for each member's IPv4 / IPv6 VLAN interface in the $v4ints array:

As mentioned above, there is a complete example provided in application/views/router-cli/as112/quagga which should give you all the details you need.

Generating the Configuration

Once you have set the application.ini settings, all you need is the database ID of the VLAN you wish to generate the configuration for. You'll get this by hovering over any of the actions in the VLAN section of IXP Manager and examining the URL.

Then, by executing the following, all active VLAN interfaces will have a BGP configuration generated for them via:

You can also pass additional options - do this using comma separated option=value pairs on the -p switch above - e.g. -p vlanid=X,rc=1.

The available additional options are:

target=qwerty - the target directory (in router-cli/as112/) from which to load the index.cfg` template file;

rc=1 - add a (MD5-less) session for any IPv4 route collectors defined in your VLAN's [network information](Network Information). NB: to have a session created for your AS112 service on the route collector, add a pro-bono AS112 member to your IXP. This will also advertise the AS112 service on member lists, the peering manager, etc.

Syncing the Configuration with the Router

Note that the provided Quagga example does not generate a complete router configuration - rather it just generates the necessary BGP clauses (and a few other bits). This is because, unfortunately, Quagga does not have a reload method for it's BGP daemon - updating a complete configuration would require a daemon restart which is unacceptable.

Instead, we start with a [base Quagga configuration](AS112 - Sample Quagga Base Config) and then use RANCID to push the generated changes to it. For example, if /tmp/as112-X.conf is the generated configuration, we push that via:

/path/to/clogin -x /tmp/as112-X.conf as112.example.com

Other BGP daemons such as OpenBGPd and Bird do have a reload function and, for these, your templates could easily contain a complete configuration.

Please note - due to the way these changes are pushed to Quagga / Cisco IOS, you will need to manually remove sessions for departed members until we develop a way of automating that.

If your AS112 router is listening on multiple VLANs, just push a configuration separately for each VLAN.