Static-Route-Netconf
Static Route
Section titled “Static Route”Resources Summary
Section titled “Resources Summary”| YANG Path | get/get-config | edit-config | rpc |
|---|---|---|---|
| /show-ip-route | — | — | Y |
| /show-ipv6-route | — | — | Y |
| /static-routes/{vrf}/{prefix} | Y | merge, replace, create, delete | — |
| /static-routes/{vrf}/{prefix}/nexthops/blackhole-nexthop | Y | merge, replace, create, delete | — |
| /static-routes/{vrf}/{prefix}/nexthops/ifindex-nexthops/{nh-vrf}/{interface} | Y | merge, replace, create, delete | — |
| /static-routes/{vrf}/{prefix}/nexthops/ip-ifindex-nexthops/{nh-vrf}/{gateway} /{interface} | Y | merge, replace, create, delete | — |
| /static-routes/{vrf}/{prefix}/nexthops/ip-nexthops/{nh-vrf}/{gateway} | Y | merge, replace, create, delete | — |
Examples
Section titled “Examples”This chapter provides examples on how to use Netconf to manage static routes on AsterNOS devices.
Create Static Route Entry
Section titled “Create Static Route Entry”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>Get Static Route Entry
Section titled “Get Static Route Entry”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>Modify Static Route Entry
Section titled “Modify Static Route Entry”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>Delete Static Route Entry
Section titled “Delete Static Route Entry”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>Show Ipv4 Route
Section titled “Show Ipv4 Route”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>Create Ipv6 Static Route Entry
Section titled “Create Ipv6 Static Route Entry”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>Get Ipv6 Static Route Entry
Section titled “Get Ipv6 Static Route Entry”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>Delete Ipv6 Static Route Entry
Section titled “Delete Ipv6 Static Route Entry”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>Show Ipv6 Static Route
Section titled “Show Ipv6 Static Route”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>Create Blackhole Static Route Entry
Section titled “Create Blackhole Static Route Entry”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>Get Blackhole Static Route Entry
Section titled “Get Blackhole Static Route Entry”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>Properties Descriptions
Section titled “Properties Descriptions”Static Routes
Section titled “Static Routes”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? uint32Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| static-routes | M | Path-only node, has no configurable value. | |
| static-route | M | Path-only node, has no configurable value. List of staticd IP routes. | |
| vrf | O | vrf:vrf-ref | VRF of staticd IP route. |
| prefix | O | inet:ip-prefix | IP prefix. |
| nexthops | M | Path-only node, has no configurable value. nexthop object. | |
| blackhole-nexthop | M | Path-only node, has no configurable value. For blackhole type nexthops, there is only one configurable. | |
| bh-type | M | ”unspec" "null" "reject" "prohibited” | A blackhole sub-type, if the nexthop is a blackhole type. |
| distance | O | 1..255 | Admin distance associated with this route. |
| tag | O | 1..4294967295 | Route tag |
| srv6-segs | M | Path-only node, has no configurable value. Container for a list of SRv6 segs SIDs entries. | |
| srv6-seg | M | Path-only node, has no configurable value. List of SRv6 segs SIDs entries. | |
| id | O | 0..3 | Identifies the entry in a sequence of SRv6 segs SIDs entries. |
| seg | O | inet:ipv6-address | |
| mpls-labels | M | Path-only node, has no configurable value. Container for a list of MPLS label stack entries. | |
| mpls-label | M | Path-only node, has no configurable value. List of MPLS label stack entries. | |
| id | O | 0..2 | Identifies 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. |
| label | O | 16..1048575 | Label value. |
| ifindex-nexthops | M | Path-only node, has no configurable value. A list of nexthop objects. | |
| interface | O | Ethernet name → asternos-gre:gre-interface-name 1..16777215 | The nexthop egress interface. |
| nh-vrf | O | vrf:vrf-ref | The nexthop vrf name, if different from the route. |
| distance | O | 1..255 | Admin distance associated with this route. |
| tag | O | 1..4294967295 | Route tag |
| srv6-segs | M | Path-only node, has no configurable value. Container for a list of SRv6 segs SIDs entries. | |
| srv6-seg | M | Path-only node, has no configurable value. List of SRv6 segs SIDs entries. | |
| id | O | 0..3 | Identifies the entry in a sequence of SRv6 segs SIDs entries. |
| seg | O | inet:ipv6-address | |
| mpls-labels | M | Path-only node, has no configurable value. Container for a list of MPLS label stack entries. | |
| mpls-label | M | Path-only node, has no configurable value. List of MPLS label stack entries. | |
| id | O | 0..2 | Identifies 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. |
| label | O | 16..1048575 | Label value. |
| ip-nexthops | M | Path-only node, has no configurable value. A list of nexthop objects of type ip4 or ip6. | |
| nh-vrf | O | vrf:vrf-ref | The nexthop vrf name, if different from the route. |
| gateway | O | inet:ip-address-no-zone | The nexthop gateway address. |
| distance | O | 1..255 | Admin distance associated with this route. |
| tag | O | 1..4294967295 | Route tag |
| srv6-segs | M | Path-only node, has no configurable value. Container for a list of SRv6 segs SIDs entries. | |
| srv6-seg | M | Path-only node, has no configurable value. List of SRv6 segs SIDs entries. | |
| id | O | 0..3 | Identifies the entry in a sequence of SRv6 segs SIDs entries. |
| seg | O | inet:ipv6-address | |
| mpls-labels | M | Path-only node, has no configurable value. Container for a list of MPLS label stack entries. | |
| mpls-label | M | Path-only node, has no configurable value. List of MPLS label stack entries. | |
| id | O | 0..2 | Identifies 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. |
| label | O | 16..1048575 | Label value. |
| bfd | M | Path-only node, has no configurable value. FRR nexthop bfd object. | |
| enable | O | ”true" "false” | Nexthop open bfd Default value: False |
| multihop | O | ”true" "false” | Open bfd multihop mode Default value: False |
| source | O | inet:ip-address-no-zone | The bfd local-address. |
| track | O | 1..4294967295 | Route track |
| ip-ifindex-nexthops | M | Path-only node, has no configurable value. A list of nexthop objects of type ip4-ifindex or ip6-ifindex. | |
| gateway | O | inet:ip-address-no-zone | The nexthop gateway address. |
| nh-vrf | O | vrf:vrf-ref | The nexthop vrf name, if different from the route. |
| interface | O | Ethernet name | The nexthop egress interface. |
| distance | O | 1..255 | Admin distance associated with this route. |
| tag | O | 1..4294967295 | Route tag |
| srv6-segs | M | Path-only node, has no configurable value. Container for a list of SRv6 segs SIDs entries. | |
| srv6-seg | M | Path-only node, has no configurable value. List of SRv6 segs SIDs entries. | |
| id | O | 0..3 | Identifies the entry in a sequence of SRv6 segs SIDs entries. |
| seg | O | inet:ipv6-address | |
| mpls-labels | M | Path-only node, has no configurable value. Container for a list of MPLS label stack entries. | |
| mpls-label | M | Path-only node, has no configurable value. List of MPLS label stack entries. | |
| id | O | 0..2 | Identifies 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. |
| label | O | 16..1048575 | Label value. |
| bfd | M | Path-only node, has no configurable value. FRR nexthop bfd object. | |
| enable | O | ”true" "false” | Nexthop open bfd Default value: False |
| multihop | O | ”true" "false” | Open bfd multihop mode Default value: False |
| source | O | inet:ip-address-no-zone | The bfd local-address. |
| track | O | 1..4294967295 | Route track |
Blackhole Nexthop
Section titled “Blackhole Nexthop”Tree Diagram
module: asternos-static-route +--rw static-routesIfindex Nexthops
Section titled “Ifindex Nexthops”Tree Diagram
module: asternos-static-route +--rw static-routesIp Ifindex Nexthops
Section titled “Ip Ifindex Nexthops”Tree Diagram
module: asternos-static-route +--rw static-routesIp Nexthops
Section titled “Ip Nexthops”Tree Diagram
module: asternos-static-route +--rw static-routesShow Ip Route
Section titled “Show Ip Route”Tree Diagram
module: asternos-static-route
rpcs: +---x show-ip-route +---w input | +---w vrf? union +--ro output +--ro data? <anydata>Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-ip-route | O | ||
| vrf | O | string | VRF of IPv4 route. |
| data | O |
Show Ipv6 Route
Section titled “Show Ipv6 Route”Tree Diagram
module: asternos-static-route
rpcs: +---x show-ipv6-route +---w input | +---w vrf? union +--ro output +--ro data? <anydata>Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-ipv6-route | O | ||
| vrf | O | string | VRF of IPv6 route. |
| data | O |