I think we need to provide this information in a normalized manner, and have scripts for various router implementations:
Common -> JNOS
Common -> Cisco
Common -> MikroTik
Common -> IPTables
Etc.
The current parsing is a pain.
Something in JSON on XML would be nice, or at least fixed length records, using CIDR and gating hosts.
e.g.
{ gateway: 192.231.186.124, transport : {method: BGP}, subnets : [{net:44.24.10.0,mask:24},{net:44.24.100.12,mask:32}]}
BGP routes shouldn't need any special rules
{ gateway: 192.231.186.124, transport : {method: tunnel, protocols: [ipip,l2tp]}, subnets : [{net:44.24.10.0,mask:24},{net:44.24.100.12,mask:32}]}
On an IPIP tunnel:
[admin@MikroTik] interface ipip> add
local-address: x.x.x.x
remote-address: 192.231.186.124
[admin@MikroTik] interface ipip> print
Flags: X - disabled, R - running
# NAME MTU LOCAL-ADDRESS REMOTE-ADDRESS
0 X ipip1 1480 x.x.x.x 192.231.186.124
[admin@MikroTik] interface ipip> en 0
[admin@MikroTik] interface ipip> /ip address add address=44.24.10.0/24 interface=ipip1
[admin@MikroTik] interface ipip> /ip address add address=44.24.100.12/32 interface=ipip1
Given the above JSON object [pseudo-Javascript Code to generate MikroTik].
document.write('/interface ipip add local-address: x.x.x.x remote-address: ' . gateway);
document.write('/interface ipip en 0');
document.write('/interface ipip address add address=' . subnets[0].net . '/' . subnets[0].mask . ' interface=ipip1');
document.write('/interface ipip address add address=' . subnets[1].net . '/' . subnets[1].mask . ' interface=ipip1');