This section provides a sample of configuring NetStream flow statistics collection for IPv4 original flows using the edit-config method.
Operation | XPATH |
---|---|
edit-config |
|
Item | Data |
---|---|
Source IPv4 address of the exported packets carrying IPv4 flow statistics | 192.168.10.1 |
Destination IPv4 address of the exported packets carrying IPv4 flow statistics | 192.168.50.1 |
Destination UDP port number of the exported packets carrying IPv4 flow statistics | 65505 |
Interface where NetStream flow statistics collection is to be enabled | GigabitEthernet0/0/1 |
Direction of traffic to be sampled on the interface | inbound |
Sampling rate | 500 |
# Enable NetStream flow statistics collection for incoming IPv4 original flows on GE0/0/1.
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<hw-ns:netstream-policy xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream">
<hw-ns:export-source>
<hw-ns:ip>192.168.10.1</hw-ns:ip>
</hw-ns:export-source>
<hw-ns:export-host-no-vpn>
<hw-ns:ip>192.168.50.1</hw-ns:ip>
<hw-ns:port>65505</hw-ns:port>
</hw-ns:export-host-no-vpn>
</hw-ns:netstream-policy>
<hw-ns:netstream-apply xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream">
<hw-ns:interface>
<hw-ns:name>GigabitEthernet0/0/1</hw-ns:name>
<hw-ns:packets-samples>
<hw-ns:packets-sample>
<hw-ns:direction>inbound</hw-ns:direction>
<hw-ns:fix-packets>500</hw-ns:fix-packets>
</hw-ns:packets-sample>
</hw-ns:packets-samples>
<hw-ns:ns-enable>
<hw-ns:direction>inbound</hw-ns:direction>
</hw-ns:ns-enable>
</hw-ns:interface>
</hw-ns:netstream-apply>
</config>
</edit-config>
</rpc>
# Disable NetStream flow statistics collection for incoming IPv4 original flows on GE0/0/1.
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<hw-ns:netstream-apply xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream">
<hw-ns:interface>
<hw-ns:name>GigabitEthernet0/0/1</hw-ns:name>
<hw-ns:ns-enable xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete">
<hw-ns:direction>inbound</hw-ns:direction>
</hw-ns:ns-enable>
</hw-ns:interface>
</hw-ns:netstream-apply>
</config>
</edit-config>
</rpc>
# Disable NetStream flow statistics collection for incoming IPv4 original flows on GE0/0/1 and delete all NetStream configurations.
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<hw-ns:netstream-policy xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream">
<hw-ns:export-source xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete">
<hw-ns:ip>192.168.10.1</hw-ns:ip>
</hw-ns:export-source>
<hw-ns:export-host-no-vpn xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete">
<hw-ns:ip>192.168.50.1</hw-ns:ip>
<hw-ns:port>65505</hw-ns:port>
</hw-ns:export-host-no-vpn>
</hw-ns:netstream-policy>
<hw-ns:netstream-apply xmlns:hw-ns="urn:huawei:params:xml:ns:yang:huawei-netstream">
<hw-ns:interface>
<hw-ns:name>GigabitEthernet0/0/1</hw-ns:name>
<hw-ns:packets-samples>
<hw-ns:packets-sample xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete">
<hw-ns:direction>inbound</hw-ns:direction>
<hw-ns:fix-packets>500</hw-ns:fix-packets>
</hw-ns:packets-sample>
</hw-ns:packets-samples>
<hw-ns:ns-enable xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete">
<hw-ns:direction>inbound</hw-ns:direction>
</hw-ns:ns-enable>
</hw-ns:interface>
</hw-ns:netstream-apply>
</config>
</edit-config>
</rpc>
# Sample of successful response.
##### Ok Reply or Operation Successful ##### <?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="0"> <ok/> </rpc-reply>
# Sample of failed response.
##### Error Reply or Operation Failed ##### <?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="0"> <rpc-error> <error-type>application</error-type> <error-tag>invalid-value</error-tag> <error-severity>error</error-severity> <error-path>/huawei-netstream:netstream-apply/interface[name='GigabitEthernet0/0/1']/name</error-path> <error-message>validation failed(Leafref "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:name" of value "GigabitEthernet0/0/1" points to a non-existing leaf.).</error-message> </rpc-error> </rpc-reply>