IP
15 min
\<font color="#1d50a2">module asternos ip\</font> this chapter provides an example of how to use netconf to manage configuring ipv4 addresses on asternos devices \<font color="#1d50a2">create ipv4 address for interface\</font> request example to create ipv4 address for interface via edit config \<config>\<top> \<interfaces> \<interface> \<name>ethernet1\</name> \<ipv4> \<address operation="create"> \<ip prefix>100 1 1 1/24\</ip prefix> \</address> \</ipv4> \</interface> \</interfaces> \</top>\</config> response example \<rpc reply xmlns="urn\ ietf\ params\ xml\ ns\ netconf\ base 1 0" message id="urn\ uuid\ a4c9a7e0 dfcb 4c63 b6c6 61e55b074876"> \<ok/> \</rpc reply> \<font color="#1d50a2">delete ipv4 address for interface\</font> request example to delete ipv4 address for interface via edit config \<config>\<top> \<interfaces> \<interface> \<name>ethernet1\</name> \<ipv4> \<address operation="delete"> \<ip prefix>100 1 1 1/24\</ip prefix> \</address> \</ipv4> \</interface> \</interfaces> \</top>\</config> response example \<rpc reply xmlns="urn\ ietf\ params\ xml\ ns\ netconf\ base 1 0" message id="urn\ uuid\ f6cebf76 83c5 4386 b4b4 f9e25b1701d0"> \<ok/> \</rpc reply> \<font color="#1d50a2">get ipv4 address for interface\</font> request example to get ipv4 address for interface via get config with subtree filter \<filter type="subtree"> \<top> \<interfaces> \<interface> \<name>ethernet1\</name> \<ipv4> \<address/> \</ipv4> \</interface> \</interfaces> \</top> \</filter> response example \<rpc reply xmlns="urn\ ietf\ params\ xml\ ns\ netconf\ base 1 0" message id="urn\ uuid 5e3eec58 8c96 4591 b140 0b84317134bd"> \<data> \<top> \<interfaces xmlns="http //asterfusion com/ns/yang/asternos interfaces"> \<interface> \<name>ethernet1\</name> \<ipv4 xmlns="http //asterfusion com/ns/yang/asternos ip"> \<address> \<ip prefix>100 1 1 1/24\</ip prefix> \</address> \</ipv4> \</interface> \</interfaces> \</top> \</data> \</rpc reply> \<font color="#1d50a2">replace ipv4 address for interface\</font> request example to replace ipv4 address for interface via edit config \<config>\<top> \<interfaces> \<interface> \<name>ethernet1\</name> \<ipv4> \<address operation="replace"> \<ip prefix>100 1 1 2/24\</ip prefix> \</address> \</ipv4> \</interface> \</interfaces> \</top>\</config> response example \<rpc reply xmlns="urn\ ietf\ params\ xml\ ns\ netconf\ base 1 0" message id="urn\ uuid\ bedd90c7 6283 4475 87f9 8f71887ee91d"> \<ok/> \</rpc reply> \<font color="#1d50a2">create ipv6 address for interface\</font> request example to create ipv6 address for interface via edit config \<config>\<top> \<interfaces> \<interface> \<name>ethernet1\</name> \<ipv6> \<address operation="create"> \<ip prefix>2001\ db8 1/64\</ip prefix> \</address> \</ipv6> \</interface> \</interfaces> \</top>\</config> response example \<rpc reply xmlns="urn\ ietf\ params\ xml\ ns\ netconf\ base 1 0" message id="urn\ uuid\ a432fe56 1d66 4641 9ee3 0488ef208eeb"> \<ok/> \</rpc reply> \<font color="#1d50a2">replace ipv6 address for interface\</font> request example to replace ipv6 address for interface via edit config \<config>\<top> \<interfaces> \<interface> \<name>ethernet1\</name> \<ipv6 operation="replace"> \<address> \<ip prefix>2001\ db8 2/64\</ip prefix> \</address> \</ipv6> \</interface> \</interfaces> \</top>\</config> response example \<rpc reply xmlns="urn\ ietf\ params\ xml\ ns\ netconf\ base 1 0" message id="urn\ uuid\ bedd90c7 6283 4475 87f9 8f71887ee91d"> \<ok/> \</rpc reply> \<font color="#1d50a2">delete ipv6 address for interface\</font> request example to delete ipv6 address for interface via edit config \<config>\<top> \<interfaces> \<interface> \<name>ethernet1\</name> \<ipv6> \<address operation="delete"> \<ip prefix>2001\ db8 1/64\</ip prefix> \</address> \</ipv6> \</interface> \</interfaces> \</top>\</config> response example \<rpc reply xmlns="urn\ ietf\ params\ xml\ ns\ netconf\ base 1 0" message id="urn\ uuid\ fdf348d6 2516 4fa4 9dd7 c088576e5d20"> \<ok/> \</rpc reply> \<font color="#1d50a2">get ipv6 address for interface\</font> request example to get ipv6 address for interface via get config with subtree filter \<filter type="subtree"> \<top> \<interfaces> \<interface> \<name>ethernet1\</name> \<ipv6> \<address/> \</ipv6> \</interface> \</interfaces> \</top> \</filter> response example \<rpc reply xmlns="urn\ ietf\ params\ xml\ ns\ netconf\ base 1 0" message id="urn\ uuid\ f5d98bea c776 4ac7 aa0c ad73b85de951"> \<data> \<top> \<interfaces xmlns="http //asterfusion com/ns/yang/asternos interfaces"> \<interface> \<name>ethernet1\</name> \<ipv6 xmlns="http //asterfusion com/ns/yang/asternos ip"> \<address> \<ip prefix>2001\ db8 1/64\</ip prefix> \</address> \</ipv6> \</interface> \</interfaces> \</top> \</data> \</rpc reply> \<font color="#1d50a2">get ipv4 and ipv6 address for interface\</font> request example to get ipv4 and ipv6 address for interface via get config with subtree filter \<filter type="subtree"> \<top> \<interfaces> \<interface> \<name>ethernet1\</name> \<ipv4> \<address/> \</ipv4> \<ipv6> \<address/> \</ipv6> \</interface> \</interfaces> \</top> \</filter> response example \<rpc reply xmlns="urn\ ietf\ params\ xml\ ns\ netconf\ base 1 0" message id="urn\ uuid 4c510c84 6c2c 408d 8729 787541dfabc0"> \<data> \<top> \<interfaces xmlns="http //asterfusion com/ns/yang/asternos interfaces"> \<interface> \<name>ethernet1\</name> \<ipv4 xmlns="http //asterfusion com/ns/yang/asternos ip"> \<address> \<ip prefix>100 1 1 2/24\</ip prefix> \</address> \</ipv4> \<ipv6 xmlns="http //asterfusion com/ns/yang/asternos ip"> \<address> \<ip prefix>2001\ db8 1/64\</ip prefix> \</address> \</ipv6> \</interface> \</interfaces> \</top> \</data> \</rpc reply>
