OCNI VRF

Package: openconfig-network-instance.yang

Creating a New VRF

Creating a New VRF
Request:
<?xml version="1.0" encoding="UTF-8"?>
<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>vrf1</name>
      </network-instance>      
    </network-instances>
  </config>
</edit-config>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <ok/>
</rpc-reply>

Container: OCNI VRF

Type: Config Data


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right.

vrf context vrf1

Querying a Specific VRF

Querying a Specific VRF 
Request:
<get-config>
   <source>
<running/>
</source>
    <filter>
      <network-instances xmlns="http://openconfig.net/yang/network-instance">
          <network-instance>
              <name>vrf1</name>
          </network-instance>
       </network-instances>
    </filter>
</get-config>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <data>
    <network-instances xmlns="http://openconfig.net/yang/network-instance">
      <network-instance>
        <name>vrf1</name>
        <config>
          <description/>
          <enabled>true</enabled>
          <name>vrf1</name>
            <type>L3VRF</type>
</config>
                              <protocols>
                                <protocol>
                                  <identifier>STATIC</identifier>
                                    <name>DEFAULT</name>
                                  </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.

show vrf vrf1

Querying All Configured VRFs

Querying All Configured VRFs
Request:
<get-config>
    <source>
      <running/>
    </source>
    <filter>
      <network-instances xmlns="http://openconfig.net/yang/network-instance">
        <network-instance/>
      </network-instances>
    </filter>

Response:
                   <?xml version="1.0" encoding="UTF-8"?>
                    <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
                      <data>
                        <network-instances xmlns="http://openconfig.net/yang/network-instance">
                         <network-instance>
                          <config>
                           <description/>
                           <enabled>true</enabled>
                           <name>default</name>
                           <type>L3VRF</type>
                          </config>
                          <name>default</name>
                         </network-instance>
                        <network-instance>
                       <config>
                         <description/>
                         <enabled>true</enabled>
                         <name>Testing1</name>
                         <type>L3VRF</type>
                       </config>
                      <name>Testing1</name>
                     <protocols>
                      <protocol>
                        <identifier>STATIC</identifier>
                        <name>DEFAULT</name>
                      </protocol>
                     </protocols>
                   </network-instance>
                   <network-instance>
                    <config>
                      <description/>
                      <enabled>true</enabled>
                      <name>management</name>
                      <type>L3VRF</type>
                    </config>
                      <name>management</name>
                     <protocols>
                       <protocol>
                         <identifier>STATIC</identifier>
                           <static-routes>
                             <static>
                    <config>
                      <set-tag>0</set-tag>
                        <prefix>0.0.0.0/0</prefix>
                    </config>
                    <next-hops>
                      <next-hop>
                       <config>
                         <index>+172.19.216.1/32+management</index>
                          <metric>0</metric>
                         <next-hop>172.19.216.1/32</next-hop>
                      </config>
                         <index>+172.19.216.1/32+management</index>
                           <interface-ref>
                      <config>
                         <interface>unspecified</interface>
                      </config>
                         </interface-ref>
                      </next-hop>
                      </next-hops>
                        <prefix>0.0.0.0/0</prefix>
                        </static>
                      </static-routes>
                      <name>DEFAULT</name>
                    </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.

show vrf all

Deleting a VRF

Deleting a VRF
Request:
<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 xc:operation="delete">
          <name>vrf1</name>
        </network-instance>
      </network-instances>
    </config>
</edit-config>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <ok/>
</rpc-reply>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right.

no vrf context vrf1

Querying the Enable Status of a VRF

Querying the Enable Status of a VRF
Request:
<get-config>
    <source>
      <running/>
    </source>
    <filter>
      <network-instances xmlns="http://openconfig.net/yang/network-instance">
       <network-instance>
        <name>vrf1</name>
        <config><enabled/></config>
       </network-instance>
      </network-instances>
    </filter>
</get-config>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <data>
    <network-instances xmlns="http://openconfig.net/yang/network-instance">
      <network-instance>
        <name>vrf1</name>
        <config>
          <enabled>true</enabled>
        </config>
      </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.

show vrf vrf1 detail

Configuring the Status of a VRF to Enable/Disable

Configuring the status of a VRF to Enable/Disable
Request:

<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>vrf1</name>
        <config>
          <enabled>true</enabled>
        </config>
      </network-instance>
    </network-instances>
  </config>
</edit-config>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <ok/>
</rpc-reply>

Note: Replace true with false to disable.


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right.

vrf context vrf1  shutdown

Configuring the Description of a VRF

Configuring the Description of a VRF
Request:
<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>vrf1</name>
        <config>
          <description>Testing the description</description>
        </config>
      </network-instance>
    </network-instances>
  </config>
</edit-config>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <ok/>
</rpc-reply>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right.

show vrf vrf1 detail

Querying the Description of a VRF

Querying the Description of a VRF
Request:
<get-config>
  <source>
    <running/>
    </source>
    <filter>
      <network-instances xmlns="http://openconfig.net/yang/network-instance">
        <network-instance>
          <name>vrf1</name>
            <config><description/></config>
        </network-instance>
      </network-instances>
    </filter>
</get-config>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <data>
    <network-instances xmlns="http://openconfig.net/yang/network-instance">
      <network-instance>
        <name>vrf1</name>
        <config>
          Testing the description <description/>
        </config>
      </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.

show vrf vrf1 detail

Adding BGP to a VRF

Adding BGP to a VRF
Request:
<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>vrf1</name>
        <protocols>
          <protocol>
            <name>bgp</name>
            <identifier>BGP</identifier>
             <bgp xmlns="http://openconfig.net/yang/bgp">
              <global>
                <config xmlns="">
                  <as>100</as>
                  <router-id>2.2.2.2</router-id>
                </config>
              </global>
            </bgp>
           </protocol>
        </protocols>
      </network-instance>
    </network-instances>
  </config>
</edit-config>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <ok/>
</rpc-reply>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right.

feature bgp
router bgp 100
 vrf vrf1
 router-id 2.2.2.2

Adding OSPF to a VRF

Adding OSPF to a VRF
Request:
<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>vrf1</name>
        <protocols>
          <protocol>
            <name>ospf</name>
            <identifier>OSPF</identifier>
          </protocol>
        </protocols>
      </network-instance>
    </network-instances>
  </config>
</edit-config>

Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <ok/>
</rpc-reply>


CLI Commands

The CLI commands are equivalent to the payload examples displayed in the pane on the right.

feature ospf
 router ospf ospf
 vrf vrf1