Skip to content
Ask AI

Static-Route-Netconf

YANG Pathget/get-configedit-configrpc
/show-ip-route——Y
/show-ipv6-route——Y
/static-routes/{vrf}/{prefix}Ymerge, replace, create, delete—
/static-routes/{vrf}/{prefix}/nexthops/blackhole-nexthopYmerge, replace, create, delete—
/static-routes/{vrf}/{prefix}/nexthops/ifindex-nexthops/{nh-vrf}/{interface}Ymerge, replace, create, delete—
/static-routes/{vrf}/{prefix}/nexthops/ip-ifindex-nexthops/{nh-vrf}/{gateway}
/{interface}
Ymerge, replace, create, delete—
/static-routes/{vrf}/{prefix}/nexthops/ip-nexthops/{nh-vrf}/{gateway}Ymerge, replace, create, delete—

This chapter provides examples on how to use Netconf to manage static routes on AsterNOS devices.

Request example to create a static route entry via edit-config.

<config><top>
<static-routes>
<static-route operation="create">
<vrf>default</vrf>
<prefix>20.0.0.1/32</prefix>
<nexthops>
<ip-ifindex-nexthops>
<gateway>200.0.0.1</gateway>
<interface>Vlan100</interface>
</ip-ifindex-nexthops>
</nexthops>
</static-route>
</static-routes>
</top></config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f0664782-0072-4b64-990b-228306437b46">
<ok/>
</rpc-reply>

Request example to get a static route entry via get-config.

<filter type="subtree">
<top>
<static-routes>
<static-route>
<vrf>default</vrf>
<prefix>20.0.0.1/32</prefix>
</static-route>
</static-routes>
</top>
</filter>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:905bb409-0fb4-4e29-8e98-0f0f815157f5">
<data>
<top>
<static-routes xmlns="http://asterfusion.com/ns/yang/asternos-static-route">
<static-route>
<vrf>default</vrf>
<prefix>20.0.0.1/32</prefix>
<nexthops>
<ip-ifindex-nexthops>
<gateway>200.0.0.1</gateway>
<interface>Vlan100</interface>
<bfd/>
</ip-ifindex-nexthops>
</nexthops>
</static-route>
</static-routes>
</top>
</data>
</rpc-reply>

Request example to modify a static route entry via edit-config.

<config><top>
<static-routes>
<static-route operation="merge">
<vrf>default</vrf>
<prefix>20.0.0.1/32</prefix>
<nexthops>
<ip-ifindex-nexthops>
<gateway>200.0.0.1</gateway>
<interface>Ethernet1</interface>
<bfd/>
</ip-ifindex-nexthops>
</nexthops>
</static-route>
</static-routes>
</top></config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f0664782-0072-4b64-990b-228306437b46">
<ok/>
</rpc-reply>

Request example to delete a static route entry via edit-config.

<top xmlns="http://www.asterfusion.com/asternos-schema/1.0/config">
<static-routes>
<static-route operation="delete">
<vrf>default</vrf>
<prefix>20.0.0.1/32</prefix>
</static-route>
</static-routes>
</top></config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f0664782-0072-4b64-990b-228306437b46">
<ok/>
</rpc-reply>

Request example to show ipv4 route via rpc show-ip-route.

<show-ip-route/>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9fc00984-0c97-4cb8-ad66-74d2440c5802">
<data>
<prefix>0.0.0.0/0</prefix>
<prefixLen>0</prefixLen>
<protocol>kernel</protocol>
<vrfId>0</vrfId>
<vrfName>default</vrfName>
<selected>True</selected>
<destSelected>True</destSelected>
<distance>0</distance>
<metric>201</metric>
<installed>True</installed>
<table>254</table>
<internalStatus>16</internalStatus>
<internalFlags>8</internalFlags>
<internalNextHopNum>1</internalNextHopNum>
<internalNextHopActiveNum>1</internalNextHopActiveNum>
<nexthopGroupId>7</nexthopGroupId>
<installedNexthopGroupId>7</installedNexthopGroupId>
<uptime>1d09h02m</uptime>
<nexthops>
<flags>3</flags>
<fib>True</fib>
<ip>192.168.0.1</ip>
<afi>ipv4</afi>
<interfaceIndex>3</interfaceIndex>
<interfaceName>eth0</interfaceName>
<active>True</active>
<weight>1</weight>
</nexthops>
</data>
<data>
<prefix>20.0.0.1/32</prefix>
<prefixLen>32</prefixLen>
<protocol>static</protocol>
<vrfId>0</vrfId>
<vrfName>default</vrfName>
<distance>1</distance>
<metric>0</metric>
<table>254</table>
<internalStatus>2</internalStatus>
<internalFlags>65</internalFlags>
<internalNextHopNum>1</internalNextHopNum>
<internalNextHopActiveNum>0</internalNextHopActiveNum>
<nexthopGroupId>61</nexthopGroupId>
<uptime>00:07:33</uptime>
<nexthops>
<flags>0</flags>
<ip>200.0.0.1</ip>
<afi>ipv4</afi>
<interfaceIndex>62</interfaceIndex>
<interfaceName>Ethernet1</interfaceName>
<weight>1</weight>
</nexthops>
</data>
<data>
<prefix>192.168.0.0/20</prefix>
<prefixLen>20</prefixLen>
<protocol>connected</protocol>
<vrfId>0</vrfId>
<vrfName>default</vrfName>
<selected>True</selected>
<destSelected>True</destSelected>
<distance>0</distance>
<metric>0</metric>
<installed>True</installed>
<table>254</table>
<internalStatus>16</internalStatus>
<internalFlags>8</internalFlags>
<internalNextHopNum>1</internalNextHopNum>
<internalNextHopActiveNum>1</internalNextHopActiveNum>
<nexthopGroupId>5</nexthopGroupId>
<installedNexthopGroupId>5</installedNexthopGroupId>
<uptime>1d09h02m</uptime>
<nexthops>
<flags>3</flags>
<fib>True</fib>
<directlyConnected>True</directlyConnected>
<interfaceIndex>3</interfaceIndex>
<interfaceName>eth0</interfaceName>
<active>True</active>
<weight>1</weight>
</nexthops>
</data>
</rpc-reply>

Request example to create a ipv6 static route entry via edit-config.

<config><top>
<static-routes>
<static-route>
<vrf>default</vrf>
<prefix>2001:db8:1234::/64</prefix>
<nexthops>
<ip-nexthops>
<gateway>2002::1</gateway>
<nh-vrf>default</nh-vrf>
</ip-nexthops>
</nexthops>
</static-route>
</static-routes>
</top></config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:f0664782-0072-4b64-990b-228306437b46">
<ok/>
</rpc-reply>

Request example to get a ipv6 static route entry via get-config with subtree filter.

<filter type="subtree">
<top>
<static-routes>
<static-route>
<vrf>default</vrf>
<prefix>2001:db8:1234::/64</prefix>
</static-route>
</static-routes>
</top>
</filter>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:1eaafdf3-f363-42b9-b3c5-0e6a817c7e47">
<data>
<top>
<static-routes xmlns="http://asterfusion.com/ns/yang/asternos-static-route">
<static-route>
<vrf>default</vrf>
<prefix>2001:db8:1234::/64</prefix>
<nexthops>
<ip-nexthops>
<nh-vrf>default</nh-vrf>
<gateway>2002::1</gateway>
<bfd/>
</ip-nexthops>
</nexthops>
</static-route>
</static-routes>
</top>
</data>
</rpc-reply>

Request example to delete a ipv6 static route entry via edit-config.

<config><top>
<static-routes>
<static-route operation="delete">
<vrf>default</vrf>
<prefix>2001:db8:1234::/64</prefix>
</static-route>
</static-routes>
</top></config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:133892cb-e2d7-4af8-823c-a0b34b1d00ec">
<ok/>
</rpc-reply>

Request example to show ipv6 static route via rpc show-ipv6-router.

<show-ipv6-route/>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:e1c3c49c-c8a9-4125-b19d-f493f036e789">
<data>
<prefix>2011::/20</prefix>
<prefixLen>20</prefixLen>
<protocol>connected</protocol>
<vrfId>0</vrfId>
<vrfName>default</vrfName>
<selected>True</selected>
<destSelected>True</destSelected>
<distance>0</distance>
<metric>0</metric>
<installed>True</installed>
<table>254</table>
<internalStatus>16</internalStatus>
<internalFlags>8</internalFlags>
<internalNextHopNum>1</internalNextHopNum>
<internalNextHopActiveNum>1</internalNextHopActiveNum>
<nexthopGroupId>53</nexthopGroupId>
<installedNexthopGroupId>53</installedNexthopGroupId>
<uptime>04:31:10</uptime>
<nexthops>
<flags>3</flags>
<fib>True</fib>
<directlyConnected>True</directlyConnected>
<interfaceIndex>55</interfaceIndex>
<interfaceName>Ethernet10</interfaceName>
<active>True</active>
<weight>1</weight>
</nexthops>
</data>
<data>
<prefix>2011::/20</prefix>
<prefixLen>20</prefixLen>
<protocol>kernel</protocol>
<vrfId>0</vrfId>
<vrfName>default</vrfName>
<distance>0</distance>
<metric>256</metric>
<installed>True</installed>
<table>254</table>
<internalStatus>16</internalStatus>
<internalFlags>0</internalFlags>
<internalNextHopNum>1</internalNextHopNum>
<internalNextHopActiveNum>1</internalNextHopActiveNum>
<nexthopGroupId>53</nexthopGroupId>
<uptime>04:31:10</uptime>
<nexthops>
<flags>3</flags>
<fib>True</fib>
<directlyConnected>True</directlyConnected>
<interfaceIndex>55</interfaceIndex>
<interfaceName>Ethernet10</interfaceName>
<active>True</active>
<weight>1</weight>
</nexthops>
</data>
<data>
<prefix>3011::/20</prefix>
<prefixLen>20</prefixLen>
<protocol>connected</protocol>
<vrfId>0</vrfId>
<vrfName>default</vrfName>
<selected>True</selected>
<destSelected>True</destSelected>
<distance>0</distance>
<metric>0</metric>
<installed>True</installed>
<table>254</table>
<internalStatus>16</internalStatus>
<internalFlags>8</internalFlags>
<internalNextHopNum>1</internalNextHopNum>
<internalNextHopActiveNum>1</internalNextHopActiveNum>
<nexthopGroupId>53</nexthopGroupId>
<installedNexthopGroupId>53</installedNexthopGroupId>
<uptime>04:31:10</uptime>
<nexthops>
<flags>3</flags>
<fib>True</fib>
<directlyConnected>True</directlyConnected>
<interfaceIndex>55</interfaceIndex>
<interfaceName>Ethernet10</interfaceName>
<active>True</active>
<weight>1</weight>
</nexthops>
</data>
<data>
<prefix>3011::/20</prefix>
<prefixLen>20</prefixLen>
<protocol>kernel</protocol>
<vrfId>0</vrfId>
<vrfName>default</vrfName>
<distance>0</distance>
<metric>256</metric>
<installed>True</installed>
<table>254</table>
<internalStatus>16</internalStatus>
<internalFlags>0</internalFlags>
<internalNextHopNum>1</internalNextHopNum>
<internalNextHopActiveNum>1</internalNextHopActiveNum>
<nexthopGroupId>53</nexthopGroupId>
<uptime>04:31:10</uptime>
<nexthops>
<flags>3</flags>
<fib>True</fib>
<directlyConnected>True</directlyConnected>
<interfaceIndex>55</interfaceIndex>
<interfaceName>Ethernet10</interfaceName>
<active>True</active>
<weight>1</weight>
</nexthops>
</data>
<data>
<prefix>fe80::/64</prefix>
<prefixLen>64</prefixLen>
<protocol>connected</protocol>
<vrfId>0</vrfId>
<vrfName>default</vrfName>
<distance>0</distance>
<metric>0</metric>
<installed>True</installed>
<table>254</table>
<internalStatus>16</internalStatus>
<internalFlags>0</internalFlags>
<internalNextHopNum>1</internalNextHopNum>
<internalNextHopActiveNum>1</internalNextHopActiveNum>
<nexthopGroupId>59</nexthopGroupId>
<uptime>01:07:29</uptime>
<nexthops>
<flags>3</flags>
<fib>True</fib>
<directlyConnected>True</directlyConnected>
<interfaceIndex>70</interfaceIndex>
<interfaceName>Vlan100</interfaceName>
<active>True</active>
<weight>1</weight>
</nexthops>
</data>
</rpc-reply>

Request example to create blackhole static route entry via edit-config.

<config><top>
<static-routes>
<static-route operation="create">
<vrf>default</vrf>
<prefix>10.0.0.1/24</prefix>
<nexthops>
<blackhole-nexthop>
<bh-type>unspec</bh-type>
</blackhole-nexthop>
</nexthops>
</static-route>
</static-routes>
</top></config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:b0488783-fff9-4ba2-8c4b-1df897126dc3">
<ok/>
</rpc-reply>

Request example to get blackhole static route entry via get-config with subtree filter.

<filter type="subtree">
<top>
<static-routes>
<static-route>
<vrf>default</vrf>
<prefix>10.0.0.0/24</prefix>
</static-route>
</static-routes>
</top>
</filter>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:dce27bcf-285d-44dc-a11b-5e1525354c5f">
<data>
<top>
<static-routes xmlns="http://asterfusion.com/ns/yang/asternos-static-route">
<static-route>
<vrf>default</vrf>
<prefix>10.0.0.0/24</prefix>
<nexthops>
<blackhole-nexthop>
<bh-type>unspec</bh-type>
</blackhole-nexthop>
</nexthops>
</static-route>
</static-routes>
</top>
</data>
</rpc-reply>

Tree Diagram

module: asternos-static-route
+--rw static-routes
+--rw static-route* [vrf prefix]
+--rw vrf vrf:vrf-ref
+--rw prefix inet:ip-prefix
+--rw nexthops
+--rw (nexthop)
+--:(blackhole)
| +--rw blackhole-nexthop
| +--rw bh-type blackhole-type
| +--rw distance? uint8
| +--rw tag? uint32
| +--rw srv6-segs
| | +--rw srv6-seg* [id]
| | +--rw id uint8
| | +--rw seg? inet:ipv6-address
| +--rw mpls-labels
| +--rw mpls-label* [id]
| +--rw id uint8
| +--rw label? uint32
+--:(non-blackhole)
+--rw ifindex-nexthops* [nh-vrf interface]
| +--rw interface union
| +--rw nh-vrf vrf:vrf-ref
| +--rw distance? uint8
| +--rw tag? uint32
| +--rw srv6-segs
| | +--rw srv6-seg* [id]
| | +--rw id uint8
| | +--rw seg? inet:ipv6-address
| +--rw mpls-labels
| +--rw mpls-label* [id]
| +--rw id uint8
| +--rw label? uint32
+--rw ip-nexthops* [nh-vrf gateway]
| +--rw nh-vrf vrf:vrf-ref
| +--rw gateway inet:ip-address-no-zone
| +--rw distance? uint8
| +--rw tag? uint32
| +--rw srv6-segs
| | +--rw srv6-seg* [id]
| | +--rw id uint8
| | +--rw seg? inet:ipv6-address
| +--rw mpls-labels
| | +--rw mpls-label* [id]
| | +--rw id uint8
| | +--rw label? uint32
| +--rw bfd
| | +--rw enable? boolean
| | +--rw multihop? boolean
| | +--rw source? inet:ip-address-no-zone
| +--rw track? uint32
+--rw ip-ifindex-nexthops* [nh-vrf gateway interface]
+--rw gateway inet:ip-address-no-zone
+--rw nh-vrf vrf:vrf-ref
+--rw interface union
+--rw distance? uint8
+--rw tag? uint32
+--rw srv6-segs
| +--rw srv6-seg* [id]
| +--rw id uint8
| +--rw seg? inet:ipv6-address
+--rw mpls-labels
| +--rw mpls-label* [id]
| +--rw id uint8
| +--rw label? uint32
+--rw bfd
| +--rw enable? boolean
| +--rw multihop? boolean
| +--rw source? inet:ip-address-no-zone
+--rw track? uint32

Table of Properties

NameRequiredType/RangeDescription
static-routesMPath-only node, has no configurable value.
static-routeMPath-only node, has no configurable value.
List of staticd IP routes.
vrfOvrf:vrf-refVRF of staticd IP route.
prefixOinet:ip-prefixIP prefix.
nexthopsMPath-only node, has no configurable value.
nexthop object.
blackhole-nexthopMPath-only node, has no configurable value.
For blackhole type nexthops, there is only one configurable.
bh-typeM”unspec"
"null"
"reject"
"prohibited”
A blackhole sub-type, if the nexthop is a blackhole type.
distanceO1..255Admin distance associated with this route.
tagO1..4294967295Route tag
srv6-segsMPath-only node, has no configurable value.
Container for a list of SRv6 segs SIDs entries.
srv6-segMPath-only node, has no configurable value.
List of SRv6 segs SIDs entries.
idO0..3Identifies the entry in a sequence of SRv6 segs SIDs entries.
segOinet:ipv6-address
mpls-labelsMPath-only node, has no configurable value.
Container for a list of MPLS label stack entries.
mpls-labelMPath-only node, has no configurable value.
List of MPLS label stack entries.
idO0..2Identifies the entry in a sequence of MPLS label stack entries. An entry with a smaller identifier value precedes an entry with a larger identifier value in the label stack. The value of this ID has no semantic meaning other than relative ordering and referencing the entry.
labelO16..1048575Label value.
ifindex-nexthopsMPath-only node, has no configurable value.
A list of nexthop objects.
interfaceOEthernet name
→ asternos-gre:gre-interface-name
1..16777215
The nexthop egress interface.
nh-vrfOvrf:vrf-refThe nexthop vrf name, if different from the route.
distanceO1..255Admin distance associated with this route.
tagO1..4294967295Route tag
srv6-segsMPath-only node, has no configurable value.
Container for a list of SRv6 segs SIDs entries.
srv6-segMPath-only node, has no configurable value.
List of SRv6 segs SIDs entries.
idO0..3Identifies the entry in a sequence of SRv6 segs SIDs entries.
segOinet:ipv6-address
mpls-labelsMPath-only node, has no configurable value.
Container for a list of MPLS label stack entries.
mpls-labelMPath-only node, has no configurable value.
List of MPLS label stack entries.
idO0..2Identifies the entry in a sequence of MPLS label stack entries. An entry with a smaller identifier value precedes an entry with a larger identifier value in the label stack. The value of this ID has no semantic meaning other than relative ordering and referencing the entry.
labelO16..1048575Label value.
ip-nexthopsMPath-only node, has no configurable value.
A list of nexthop objects of type ip4 or ip6.
nh-vrfOvrf:vrf-refThe nexthop vrf name, if different from the route.
gatewayOinet:ip-address-no-zoneThe nexthop gateway address.
distanceO1..255Admin distance associated with this route.
tagO1..4294967295Route tag
srv6-segsMPath-only node, has no configurable value.
Container for a list of SRv6 segs SIDs entries.
srv6-segMPath-only node, has no configurable value.
List of SRv6 segs SIDs entries.
idO0..3Identifies the entry in a sequence of SRv6 segs SIDs entries.
segOinet:ipv6-address
mpls-labelsMPath-only node, has no configurable value.
Container for a list of MPLS label stack entries.
mpls-labelMPath-only node, has no configurable value.
List of MPLS label stack entries.
idO0..2Identifies the entry in a sequence of MPLS label stack entries. An entry with a smaller identifier value precedes an entry with a larger identifier value in the label stack. The value of this ID has no semantic meaning other than relative ordering and referencing the entry.
labelO16..1048575Label value.
bfdMPath-only node, has no configurable value.
FRR nexthop bfd object.
enableO”true"
"false”
Nexthop open bfd
Default value: False
multihopO”true"
"false”
Open bfd multihop mode
Default value: False
sourceOinet:ip-address-no-zoneThe bfd local-address.
trackO1..4294967295Route track
ip-ifindex-nexthopsMPath-only node, has no configurable value.
A list of nexthop objects of type ip4-ifindex or ip6-ifindex.
gatewayOinet:ip-address-no-zoneThe nexthop gateway address.
nh-vrfOvrf:vrf-refThe nexthop vrf name, if different from the route.
interfaceOEthernet nameThe nexthop egress interface.
distanceO1..255Admin distance associated with this route.
tagO1..4294967295Route tag
srv6-segsMPath-only node, has no configurable value.
Container for a list of SRv6 segs SIDs entries.
srv6-segMPath-only node, has no configurable value.
List of SRv6 segs SIDs entries.
idO0..3Identifies the entry in a sequence of SRv6 segs SIDs entries.
segOinet:ipv6-address
mpls-labelsMPath-only node, has no configurable value.
Container for a list of MPLS label stack entries.
mpls-labelMPath-only node, has no configurable value.
List of MPLS label stack entries.
idO0..2Identifies the entry in a sequence of MPLS label stack entries. An entry with a smaller identifier value precedes an entry with a larger identifier value in the label stack. The value of this ID has no semantic meaning other than relative ordering and referencing the entry.
labelO16..1048575Label value.
bfdMPath-only node, has no configurable value.
FRR nexthop bfd object.
enableO”true"
"false”
Nexthop open bfd
Default value: False
multihopO”true"
"false”
Open bfd multihop mode
Default value: False
sourceOinet:ip-address-no-zoneThe bfd local-address.
trackO1..4294967295Route track

Tree Diagram

module: asternos-static-route
+--rw static-routes

Tree Diagram

module: asternos-static-route
+--rw static-routes

Tree Diagram

module: asternos-static-route
+--rw static-routes

Tree Diagram

module: asternos-static-route
+--rw static-routes

Tree Diagram

module: asternos-static-route
rpcs:
+---x show-ip-route
+---w input
| +---w vrf? union
+--ro output
+--ro data? <anydata>

Table of Properties

NameRequiredType/RangeDescription
show-ip-routeO
vrfOstringVRF of IPv4 route.
dataO

Tree Diagram

module: asternos-static-route
rpcs:
+---x show-ipv6-route
+---w input
| +---w vrf? union
+--ro output
+--ro data? <anydata>

Table of Properties

NameRequiredType/RangeDescription
show-ipv6-routeO
vrfOstringVRF of IPv6 route.
dataO