Thanks for clarifying. I did misunderstand. I hope I am able to understand it better this time around. Originally, I did not mean to suggest that m work-around was compatible with rtconfig. I was offering a work-around in lieu of the rtconfig feature request, which I hope gets consideration. Outside of rtconfig, if you would like to consider a work-around, I have modified junoscript example scripts to push configs over SSL and XNM to do what you describe. In the situation you describe, I have used both "load replace" on the cli and the modified tools I have mentioned to push configurations from (for example) revision controlled source files. A text configuration such as this is similar to what I push to routers:<br>
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">policy-options {</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> replace: policy-statement INTER-CONTINENTAL-EXPORT {</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> term next-hop-self {</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> from {</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> protocol bgp;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> route-type external;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> }</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> then {</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> community add THIS.REGION;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> next-hop self;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> next term;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> }</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> }</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> /* shortened for brevity */</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> }</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">}</span><br><br>Here I have chosen to replace at the policy statement level, but the replace tag will overwrite everything in the hierarchy below the level at which it is placed. Hence, if you wanted to replace just the term, you would move the replace tag to that level and that term would be re-written (not merged).<br>
<br>Good luck with your projects.<br>Robin.<br><br><div class="gmail_quote">On Wed, Mar 7, 2012 at 2:15 AM, Vladimir Prokofyev <span dir="ltr"><<a href="mailto:themightywisp@gmail.com">themightywisp@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You got me wrong at some point.<div>I don't want it to delete old/removed peers. For one, how it would determine if a peer is removed? It has to have some old/new routing policy check/comparison tool.</div>
<div>I'm perfectly comfortable with deleting old BGP-peers manually.</div>
<div><br></div><div>I thought only about deleting policies before creating new ones.</div><div>Consider this for example - you have two entries in rtconfig configuration - first results in adding community 100:100, and second 200:200. When rtconfig builds first configuration, it will use policy 101 for first peer, and policy 102 for second. Now let's imagine that for some reason order of those two enries is switched. Rtconfig will build new configuration, where policy 101 will add community 200:200, and policy 102 will add 100:100. By itself, this new configuration is perfectly fine, but due to the nature of "load replace", new commited config will result in policy 101 adding both community 100:100 and 200:200, and the same will go for policy 102, which will shred your configuration and do horrible things with routing policy.</div>
<div><br></div><div>That's why there should be an option to delete old policy before creating new one, like in cisco-style config.</div><div class="HOEnZb"><div class="h5"><div><br><div class="gmail_quote">2012/3/7 Robin Pimentel <span dir="ltr"><<a href="mailto:robin@pimentel.me" target="_blank">robin@pimentel.me</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A quick clarification: delete does work, but the syntax is more delicate. For example to delete a neighbor you have to terminate the hierarchy with a ";" and exclude the contents "{...}" from the statement. Of course you are correct that someone would still have to implement it in a toolset, whether home-grown, or otherwise.<br>
<br>For example,<br>protocols {<br> bgp {<br> group PRIVATE-PEER {<br> delete: neighbor 1.1.1.2;<br> }<br> }<br>}<br><br>Works fine from a text standpoint. If you are using xml, you have to do something like <br>
...<br><neighbor delete="delete"><br> <name>1.1.1.2</name><br></neighbor><br>...<div><div><br><br>
<br><div class="gmail_quote">On Tue, Mar 6, 2012 at 2:36 PM, Robin Pimentel <span dir="ltr"><<a href="mailto:robin@pimentel.me" target="_blank">robin@pimentel.me</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm sure you and others are aware of workarounds for 1). One approach to try is to "replace:" at the "group" level of the hierarchy, or more generally: one level up. Of course, this means one would have to programmatically have a way of populating the correct neighbors on a per-router, per-group basis (or derive it from the existing config), but it is one way. Unfortunately, it also means you may be developing your own tool set :/ . I for one would like to see Junos implement the "delete:" tag.<br>
<br><div class="gmail_quote"><div><div>On Mon, Mar 5, 2012 at 12:52 AM, Vladimir Prokofyev <span dir="ltr"><<a href="mailto:themightywisp@gmail.com" target="_blank">themightywisp@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
Hi.<div><br></div><div>I have some suggestions for JUNOS-style configuration of rtconfig. Would be nice if someone more skilled than me could implement them.</div><div><br></div><div>1. "load set" configuration style.</div>
<div>Current JUNOS configuration is compatible only with "load merge/replace/override" style, which is not very usable. For example, there isn't any "delete" statement before any configuration statement, which means that every time you delete a peer from a list you have to manually control you configuration update, or all policy lists shift numbers, and configuration becomes incorrect.</div>
<div>For example, cisco-style configuration has a "no" statement before any policy-map/prefix-list/etc, ensuring that there won't be any configuration overlaps from old/new peers/configurations.</div><div><br>
</div><div>2. Ability to specify a VR for a peer.</div><div>For example, I have some peers in separate VR, and it would be great to have a config option that specifies VR for a peer.</div><div>If nothing is set - leave default.</div>
<div>Cisco-style would also benefit from this feature.</div><div><br></div><div>3. IPv4/IPv6 prefix lists in separate policies.</div><div>Currently if I have two peers with single BGP-neighbour(same ASN) - one IPv4 and one IPv6 - it creates single prefix-list for them both. This configuration is unable to commit.</div>
<div><br></div><div>Those three are the only things that separate me from peer update automatisation heaven :) or so I think at the moment.</div>
<br></div></div>_______________________________________________<br>
irrtoolset mailing list<br>
<a href="mailto:irrtoolset@lists.isc.org" target="_blank">irrtoolset@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/irrtoolset" target="_blank">https://lists.isc.org/mailman/listinfo/irrtoolset</a><br></blockquote></div><br>
</blockquote></div><br>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
irrtoolset mailing list<br>
<a href="mailto:irrtoolset@lists.isc.org">irrtoolset@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/irrtoolset" target="_blank">https://lists.isc.org/mailman/listinfo/irrtoolset</a><br></blockquote></div><br>