Skip to main content.

Route Module

This module allows to manage routes. With this module, it is possible to add and delete routes. The Route module is bound to the following namespace: urn:loria:madynes:ensuite:yencap:module:Route:1.0
Route module can be used with IPv4 or IPv6. This must be configured in the modules.xml file. For example, to use IPv4:

<module>
    <name>Route</name>
    <xpath>/ycp:netconf/ycp:network/rt:routes</xpath>
    <namespace>urn:loria:madynes:ensuite:yencap:module:Route:1.0</namespace>
    <cache-lifetime>100000</cache-lifetime>
    <parameters>
	<ip-version>4</ip-version>
    </parameters>
</module>

Here is an example of the Route document with IPv4:

<routes xmlns="urn:loria:madynes:ensuite:yencap:module:Route:1.0" ip-version="IPv4">
  <route>
    <target>192.168.0.0</target>
    <gateway>0.0.0.0</gateway>
    <genmask>255.255.255.0</genmask>
    <flags>0001</flags>
    <metric>0</metric>
    <ref>0</ref>
    <use>0</use>
    <ifname>eth0</ifname>
  </route>
  <!-- … other route elements here… -->
</routes>

With IPv6:

<routes xmlns="urn:loria:madynes:ensuite:yencap:module:Route:1.0" ip-version="IPv6">
  <route>
    <target>fe80::/64</target>
    <next-hop>*</next-hop>
    <flags>00000001</flags>
    <metric>256</metric>
    <ref>0</ref>
    <use>0</use>
    <ifname>eth0</ifname>
  </route>
  <!-- … other route elements here… -->
</routes>
	 
Concerning edit-config operation, the implicit keys are: The XML schema of the route module is:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
	elementFormDefault="qualified"
	targetNamespace"urn:loria:madynes:ensuite:yencap:module:Route:1.0"
	xmlns:routes="urn:loria:madynes:ensuite:yencap:module:Route:1.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<simpleType name="IPv4AddressType">
    <restriction base="string">
      <pattern value="([d]{1,3}.){3}[d]{1,3}" />
       <minLength value="7" />
       <maxLength value="15" />
    </restriction>
  </simpleType>
<complexType name="routeType">
    <sequence>
      <element name="target" type="routes:IPv4AddressType"/>
      <element name="gateway" type="routes:IPv4AddressType"/>
      <element name="genmask" type="routes:IPv4AddressType"/>
      <element name="flags" type="string"/>
      <element name="metric" type="integer"/>
      <element name="ref" type="string"/>
      <element name="use" type="string"/>
      <element name="ifname" type="string"/>
    </sequence>
    <attribute name="ip-version" type="routes:IPVersionType" use="required"/>
  </complexType>
<element name="routes">
    <complexType>
       <sequence>
         <element name="route" type="routes:routeType" minOccurs="0" maxOccurs="unbounded"/>
       </sequence>
     </complexType>
  </complexType>
</schema>
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
	elementFormDefault="qualified"
	targetNamespace="urn:loria:madynes:ensuite:yencap:module:Route:1.0"
	xmlns:routes="urn:loria:madynes:ensuite:yencap:module:Route:1.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<simpleType name="IPv6AddressType">
    <restriction base="string">
      <pattern value="(([dA-Fa-f]{1,4}:){7}[dA-Fa-f]{1,4})?"/>
      <minLength value="16"/>
      <maxLength value="39"/>
    </restriction>
  </simpleType>
 <complexType name="routeType">
    <sequence>
      <element name="target" type="routes:IPv4AddressType"/>
      <element name="next-hop" type="routes:IPv4AddressType"/>
      <element name="flags" type="string"/>
      <element name="metric" type="integer"/>
      <element name="ref" type="string"/>
      <element name="use" type="string"/>
      <element name="ifname" type="string"/>
    </sequence>
    <attribute name="ip-version" type="routes:IPVersionType" use="required"/>
  </complexType>
<element name="routes">
    <complexType>
       <sequence>
         <element name="route" type="routes:routeType" minOccurs="0" maxOccurs="unbounded"/>
       </sequence>
     </complexType>
  </complexType>
</schema>