07-11-2019 02:51 AM
Hi Expert,
I need your support; I am facing issue in generating "no passive-interface <interface name>" under the OSPF configuration.
NSO is able to generate below configurations XML code..
<router xmlns="urn:ios"> <ospf> <id>{process-id}</id> <vrf>{vrf-name)}</vrf> <passive-interface> <default /> <interface tags="delete"> <name>BDI{string(../vlan-id)}</name> </interface> </passive-interface> <redistribute> <connected> <subnets /> </connected> <static> <subnets /> </static> <bgp> <as-no>{bgp-as}</as-no> <metric-type>1</metric-type> <subnets /> </bgp> </redistribute> <network> <ip>{ce-network}</ip> <mask>{ce-mask}</mask> <area>{area}</area> </network> </ospf> </router>
---------------------------------------
router ospf 7600 vrf VRF:IOSXE:9281:VRF
no log-adjacency-changes
passive-interface default
redistribute connected subnets
redistribute static subnets
redistribute bgp 5000 metric-type 1 subnets
network 18.18.18.0 0.0.0.3 area 2376
exit
Target is to achieve below command set
router ospf 7600 vrf IOSXE:VRF no log-adjacency-changes no passive-interface BDI1234 (Required Command) passive-interface default redistribute connected subnets redistribute static subnets redistribute bgp 5000 metric-type 1 subnets network 18.18.18.0 0.0.0.3 area 2376 exit
Please suggest. Thanks
Solved! Go to Solution.
07-11-2019 08:37 AM - edited 07-11-2019 09:09 AM
Hello,
In the NED YANG Model - tailf-ned-cisco-ios.yang, You'll find special modeling to handle this in 'grouping passive-interface-grouping':
// Fix to handle showing "no passive-interface <ifname>"
// Replace 'disable passive-interface <ifname> with
// "no passive-interface <ifname>"
container disable {
tailf:info "Use with 'disable passive-interface' for 'no passive-interface' config";
when "../passive-interface/default" {
tailf:dependency "../passive-interface/default";
}
tailf:cli-diff-dependency "../passive-interface/default";
list passive-interface {
tailf:cli-suppress-mode;
tailf:cli-delete-when-empty;
tailf:cli-compact-syntax;
key interface;
leaf interface {
tailf:cli-multi-word-key;
tailf:cli-diff-dependency "/ios:interface";
type string {
tailf:info "WORD;;Interface name";
}
}
}
}
as you can see there is a dependency on the passive-interface/default, so configuration would be something like this:
[edit]
admin@ncs% set devices device ios0 config ios:router ospf 1 passive-interface default
[ok][2019-07-11 11:34:43]
[edit]
admin@ncs% set devices device ios0 config ios:router ospf 1 disable passive-interface BDI1234
[ok][2019-07-11 11:34:51]
admin@ncs% show devices device ios0 config ios:router ospf 1 | display xml
<config xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>ios0</name>
<config>
<router xmlns="urn:ios">
<ospf>
<id>1</id>
<passive-interface>
<default/>
</passive-interface>
<disable>
<passive-interface>
<interface>BDI1234</interface>
</passive-interface>
</disable>
</ospf>
</router>
</config>
</device>
</devices>
</config>
The 'disable' should get translated to 'no passive interface' on config generation to device:
From IOSNedCLU.java:
This is from cisco-ios NED revision 6.24:
07-11-2019 03:30 AM
Are you using the latest NED version? If you are, and the command is missing, then you can request it
07-11-2019 05:29 AM
Below is the version details;
admin@ncs# show packages package cisco-ios
packages package cisco-ios
package-version 6.15.1
description "NED package for the Cisco IOS"
ncs-min-version [ 3.4.11 4.2.2 4.3.0.2 4.4.2 ]
I have upgraded version to below version but still unable to get the required command.
admin@ncs# show packages package cisco-ios packages package cisco-ios package-version 6.20.2 description "NED package for the Cisco IOS" ncs-min-version [ 4.2.2 4.3.0.2 4.4.5 4.5.2 ]
Is there any change required in XML tags or any thing? please suggest.
Regards,
07-11-2019 06:03 AM
did you check if you can set this via the NSO CLI? I.e. do you know if the feature is supported by the NED? If not then you need to request a NED enhancement.
07-11-2019 08:37 AM - edited 07-11-2019 09:09 AM
Hello,
In the NED YANG Model - tailf-ned-cisco-ios.yang, You'll find special modeling to handle this in 'grouping passive-interface-grouping':
// Fix to handle showing "no passive-interface <ifname>"
// Replace 'disable passive-interface <ifname> with
// "no passive-interface <ifname>"
container disable {
tailf:info "Use with 'disable passive-interface' for 'no passive-interface' config";
when "../passive-interface/default" {
tailf:dependency "../passive-interface/default";
}
tailf:cli-diff-dependency "../passive-interface/default";
list passive-interface {
tailf:cli-suppress-mode;
tailf:cli-delete-when-empty;
tailf:cli-compact-syntax;
key interface;
leaf interface {
tailf:cli-multi-word-key;
tailf:cli-diff-dependency "/ios:interface";
type string {
tailf:info "WORD;;Interface name";
}
}
}
}
as you can see there is a dependency on the passive-interface/default, so configuration would be something like this:
[edit]
admin@ncs% set devices device ios0 config ios:router ospf 1 passive-interface default
[ok][2019-07-11 11:34:43]
[edit]
admin@ncs% set devices device ios0 config ios:router ospf 1 disable passive-interface BDI1234
[ok][2019-07-11 11:34:51]
admin@ncs% show devices device ios0 config ios:router ospf 1 | display xml
<config xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>ios0</name>
<config>
<router xmlns="urn:ios">
<ospf>
<id>1</id>
<passive-interface>
<default/>
</passive-interface>
<disable>
<passive-interface>
<interface>BDI1234</interface>
</passive-interface>
</disable>
</ospf>
</router>
</config>
</device>
</devices>
</config>
The 'disable' should get translated to 'no passive interface' on config generation to device:
From IOSNedCLU.java:
This is from cisco-ios NED revision 6.24:
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide