IP Routing Table Management
This section describes the configuration model of an IP routing table and provides examples of XML packets.
Data Model
The configuration model file matching an IP routing table is huawei-route-management.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-route-management:route-entry-get/get-num |
Indicates the maximum number of routing entries that can be queried at a time. |
The value is an integer. A maximum of 1024 routing entries can be queried at a time even when the value is greater than 1024. |
N/A |
/huawei-route-management:route-entry-get/destination-address |
Queries routing entries based on specified parameters.
|
The values of the sub-objects are as follows:
|
N/A |
/huawei-route-management:route-entry-get/last-route-details |
Continues to query routing entries based on the routing entry information queried last time.
|
The values of the sub-objects are as follows:
|
|
/huawei-route-management:route-manage/load-balance/flow |
Configures the ECMP load balancing mode. |
The value is of the enumerated type:
By default, ECMP load balancing is performed on packets based on the source IP address, destination IP address, transport-layer source port number, and destination port number. |
NA |
Object |
Description |
---|---|
/huawei-route-management:route-entry-get/route-entry-details/ip-address |
IP address. |
/huawei-route-management:route-entry-get/route-entry-details/ip-mask |
Mask of an IP address. |
/huawei-route-management:route-entry-get/route-entry-details/vpn-instance |
Name of a VPN instance. |
/huawei-route-management:route-entry-get/route-entry-details/protocol |
Routing protocol type. |
/huawei-route-management:route-entry-get/route-entry-details/cost |
Cost of a route. |
/huawei-route-management:route-entry-get/route-entry-details/nexthop |
Next-hop IP address. |
/huawei-route-management:route-entry-get/route-entry-details/interface |
Outbound interface. |
/huawei-route-management:route-entry-get/route-entry-details/preference |
Preference of a route. |
/huawei-route-management:route-entry-get/route-entry-details/flags |
Route flags. |
/huawei-route-management:route-entry-get/summary |
Total number of obtained routing entries. |
/huawei-route-management:route-entry-get/has-more |
Query status. The value is of the Boolean type:
|
Querying Routing Entries
This section provides a sample of querying routing entries using the rpc method.
Operation |
XPATH |
---|---|
rpc |
|
Data Requirements
Item |
Data |
Description |
---|---|---|
Maximum number of routing entries that can be queried at a time |
10 |
- |
IP address |
10.1.1.1 |
- |
Mask of an IP address |
24 |
- |
Query type |
ip |
- |
Request Example
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <hw-route-management:route-entry-get xmlns:hw-route-management="urn:huawei:yang:huawei-route-management"> <hw-route-management:get-num>10</hw-route-management:get-num> <hw-route-management:destination-address> <hw-route-management:ip-address>10.1.1.1</hw-route-management:ip-address> <hw-route-management:ip-mask>24</hw-route-management:ip-mask> <hw-route-management:search-type>ip</hw-route-management:search-type> </hw-route-management:destination-address> </hw-route-management:route-entry-get> </rpc>
Response Example
# Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <route-entry-get xmlns="urn:huawei:params:xml:ns:yang:huawei-route-management"> <route-entry-details> <ip-address>10.1.1.1</ip-address> <ip-mask>24</ip-mask> <vpn-instance/> <protocol>Direct</protocol> <cost>0</cost> <nexthop>1.1.1.1</nexthop> <interface>Tunnel1</interface> <preference>0</preference> <flags>D</flags> </route-entry-details> <summary>1</summary> <has-more>false</has-more> </route-entry-get> </rpc-reply>
# Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <route-entry-get xmlns="urn:huawei:params:xml:ns:yang:huawei-route-management"> <has-more>false</has-more> </route-entry-get> </rpc-reply>
Example for Configuring the ECMP Load Balancing Mode
This section provides a sample of configuring the ECMP load balancing mode using the edit-config method.
Operation |
XPATH |
---|---|
edit-config |
/huawei-route-management:route-manage/load-balance/flow |
Data Requirements
Item |
Data |
Description |
---|---|---|
ECMP load balancing mode |
src-dst-ip |
Configure ECMP load balancing based on the source and destination IP addresses. |
Request Example
<?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <edit-config> <target> <running/> </target> <config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <hw-route-management:route-manage xmlns:hw-route-management="urn:huawei:yang:huawei-route-management"> <hw-route-management:load-balance> <hw-route-management:flow>src-dst-ip</hw-route-management:flow> </hw-route-management:load-balance> </hw-route-management:route-manage> </config> </edit-config> </rpc>
Default Configuration Restoration Example
<?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <edit-config> <target> <running/> </target> <config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <hw-route-management:route-manage xmlns:hw-route-management="urn:huawei:yang:huawei-route-management"> <hw-route-management:load-balance nc:operation="remove"> <hw-route-management:flow>src-dst-ip</hw-route-management:flow> </hw-route-management:load-balance> </hw-route-management:route-manage> </config> </edit-config> </rpc>
Response Example
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <ok/> </rpc-reply>
<?xml version="1.0" encoding="utf-8"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message>Load balancing based on the destination IP address only is not supported.</error-message> <error-info>Error on node /huawei-route-management:route-manage/load-balance</error-info> </rpc-error> </rpc-reply>