Local Routing
Packages:
- openconfig-local-routing.yang
- openconfig-network-instance.yang
- openconfig-interface.yang
- openconfig-interfaces.yang
Configuring an IPv4 Static Route
Configuring an IPv4 Static Route
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target><running/></target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>112.112.112.112/32</prefix>
<next-hops>
<next-hop>
<index>vlan502+12.5.1.12+</index>
<config>
<index>vlan502+12.5.1.12+</index>
<next-hop>12.5.1.12</next-hop>
<metric>10</metric>
</config>
<interface-ref>
<config>
<interface>vlan502</interface>
</config>
</interface-ref>
</next-hop>
</next-hops>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
Deviation: subinterfaces
Container: Config data
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
ip route 112.112.112.112/32 Vlan502 12.5.1.12 10
Configuring an IPv4 Static Route to Null0
Configuring an IPv4 Static Route to Null0
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target><running/></target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>36.36.36.36/32</prefix>
<next-hops>
<next-hop>
<index>+DROP+</index>
<config>
<index>+DROP+</index>
<next-hop>0.0.0.0</next-hop>
<metric>100</metric>
</config>
</next-hop>
</next-hops>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
ip route 36.36.36.36/32 Null0 100
Configuring an IPv4 Static Route to Null0 on a Non-Default VRF
Configuring an IPv4 Static Route to Null0 on a Non-Default VRF
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target><running/></target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>4</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>36.36.36.36/32</prefix>
<next-hops>
<next-hop>
<index>+DROP+</index>
<config>
<index>+DROP+</index>
<next-hop>0.0.0.0</next-hop>
</config>
<interface-ref>
<config>
<interface>null0</interface>
</config>
</interface-ref>
</next-hop>
</next-hops>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
vrf context 4
ip route 36.36.36.36/32 Null0
Querying an IPv4 Static Route Prefix
Querying an IPv4 Static Route Prefix
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get>
<filter>
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>36.36.36.36/32</prefix>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</filter>
</get>
</rpc>
Response:
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<data>
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>36.36.36.36/32</prefix>
<config>
<prefix>36.36.36.36/32</prefix>
</config>
<next-hops>
<next-hop>
<config>
<index>+DROP+default</index>
<metric>100</metric>
<next-hop>0.0.0.0</next-hop>
</config>
<index>+DROP+default</index>
<interface-ref>
<config>
<interface>null0</interface>
</config>
</interface-ref>
</next-hop>
</next-hops>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</data>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
ip route 36.36.36.36/32 Null0 100
Deleting an IPv4 Static Route with a Prefix
Deleting an IPv4 Static Route with a Prefix
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target><running/></target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>4</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static xc:operation="delete">
<prefix>36.36.36.36/32</prefix>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
vrf context 4; no ip route 36.36.36.36/32 null0
Deleting an IPv4 Static Route with a Nexthop
Deleting an IPv4 Static Route with a Nexthop
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target><running/></target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>36.36.36.36/32</prefix>
<next-hops>
<next-hop xc:operation="delete">
<index>+DROP+</index>
<config>
<index>+DROP+</index>
<next-hop>0.0.0.0</next-hop>
</config>
<interface-ref>
<config>
<interface>null0</interface>
</config>
</interface-ref>
</next-hop>
</next-hops>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
no ip route 36.36.36.36/32 null0
Deleting an IPv4 Static Routes
Deleting an IPv4 Static Routes
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target><running/></target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>4</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes xc:operation="delete"/>
</protocol>
</protocols>
</network-instance>
</network-instances>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
vrf context 4
no ip route 36.36.36.36/32 null0
'no ip route 100.100.100.100/32 vlan121'
Configuring an IPv6 Static Route
Configuring an IPv6 Static Route
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target><running/></target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>112:112:112::112/128</prefix>
<next-hops>
<next-hop>
<index>vlan502+12:5:1::12+</index>
<config>
<index>vlan502+12:5:1::12+</index>
<next-hop>12:5:1::12</next-hop>
<metric>10</metric>
</config>
<interface-ref>
<config>
<interface>vlan502</interface>
</config>
</interface-ref>
</next-hop>
</next-hops>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
ipv6 route 112:112:112::112/128 Vlan502 12:5:1::12 10
Configuring an IPv6 Static Route to Null0
Configuring an IPv6 Static Route to Null0
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target><running/></target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>36:36:36::36/128</prefix>
<next-hops>
<next-hop>
<index>+DROP+</index>
<config>
<index>+DROP+</index>
<next-hop>0::0</next-hop>
<metric>100</metric>
</config>
</next-hop>
</next-hops>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
ipv6 route 36:36:36::36/128 Null0 100
Configuring an IPv6 Static Route on a Non-Default VRF
Configuring an IPv6 Static Route on a Non-Default VRF
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target><running/></target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>4</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>112:112:112::112/128</prefix>
<next-hops>
<next-hop>
<index>vlan1504+18:2:1::1+</index>
<config>
<index>vlan1504+18:2:1::1+</index>
<next-hop>18:2:1::1</next-hop>
<metric>100</metric>
</config>
<interface-ref>
<config>
<interface>vlan1504</interface>
</config>
</interface-ref>
</next-hop>
</next-hops>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
vrf context 4
ipv6 route 112:112:112::112/128 vlan1504 18:2:1::1 100
Querying an IPv6 Static Route
Querying an IPv6 Static Route
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get>
<filter>
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>112:112:112::112/128</prefix>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</filter>
</get>
</rpc>
Response:
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<data>
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>112:112:112::112/128</prefix>
<config>
<prefix>112:112:112::112/128</prefix>
</config>
<next-hops>
<next-hop>
<config>
<index>vlan502+12:5:1::12+default</index>
<metric>10</metric>
<next-hop>12:5:1::12</next-hop>
</config>
<index>vlan502+12:5:1::12+default</index>
<interface-ref>
<config>
<interface>vlan502</interface>
</config>
</interface-ref>
</next-hop>
</next-hops>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</data>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
ipv6 route 112:112:112::112/128 vlan502 12:5:1::12 10
Querying an IPv6 Static Route with a Nexthop Index
Querying an IPv6 Static Route with a Nexthop Index
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get-config>
<source><running/></source>
<filter>
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>4</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>112:112:112::112/128</prefix>
<next-hops>
<next-hop>
<index>vlan1504+18:2:1::1+</index>
</next-hop>
</next-hops>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</filter>
</get-config>
</rpc>
Response:
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<data>
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>4</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>112:112:112::112/128</prefix>
<next-hops>
<next-hop>
<index>vlan1504+18:2:1::1+4</index>
<config>
<index>vlan1504+18:2:1::1+4</index>
<metric>10</metric>
<next-hop>18:2:1::1</next-hop>
</config>
<interface-ref>
<config>
<interface>vlan1504</interface>
</config>
</interface-ref>
</next-hop>
</next-hops>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</data>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
ipv6 route 112:112:112::112/128 vlan1502 18:2:1::1 10
Deleting an IPv6 Static Route
Deleting an IPv6 Static Route
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target><running/></target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static xc:operation="delete">
<prefix>112:112:112::112/128</prefix>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
No ipv6 route 112:112:112::112/128 vlan1502 18:2:1::1 100
Deleting an IPv6 Static Route with a Configured Nexthop
Deleting an IPv6 Static Route with a Configured Nexthop (Non-Default VRF)
Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target><running/></target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>4</name>
<protocols>
<protocol>
<identifier>STATIC</identifier>
<name>DEFAULT</name>
<static-routes>
<static>
<prefix>112:112:112::112/128</prefix>
<next-hops>
<next-hop xc:operation="delete">
<index>vlan1504+18:2:1::1+</index>
<config>
<index>vlan1504+18:2:1::1+</index>
<next-hop>18:2:1::1</next-hop>
</config>
<interface-ref>
<config>
<interface>vlan1504</interface>
</config>
</interface-ref>
</next-hop>
</next-hops>
</static>
</static-routes>
</protocol>
</protocols>
</network-instance>
</network-instances>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
vrf context 4
no ipv6 route 112:112:112::112/128 vlan1504 18:2:1::1 100