“CABUORCH-1799”的版本间的差异
来自qingwei personal wiki
(→NSO curl Delete) |
(→scope) |
||
(未显示同一用户的39个中间版本) | |||
第1行: | 第1行: | ||
+ | {{HeaderOfTask | ||
+ | | content=remove L3 static routes by NSO REST API not using no command | ||
+ | | wiki=http://cmtswiki.cisco.com:8080/display/cmtsdpub/Sereno+Static+Route+Configuration%28RPD+online+in+L3+topology%29 | ||
+ | }} | ||
+ | |||
== 描述 == | == 描述 == | ||
remove L3 static routes by NSO REST API not using no command | remove L3 static routes by NSO REST API not using no command | ||
第4行: | 第9行: | ||
http://cmtswiki.cisco.com:8080/display/cmtsdpub/Sereno+Static+Route+Configuration%28RPD+online+in+L3+topology%29 | http://cmtswiki.cisco.com:8080/display/cmtsdpub/Sereno+Static+Route+Configuration%28RPD+online+in+L3+topology%29 | ||
== scope == | == scope == | ||
− | === | + | |
+ | === cBR8上需要配置 === | ||
+ | <source lang="shell"> | ||
+ | CRDC-NG-E09#sh run interface tenGigabitEthernet 7/1/7 | ||
+ | Load for five secs: 4%/1%; one minute: 11%; five minutes: 17% | ||
+ | Time source is NTP, 02:21:19.507 PDT Tue Jun 26 2018 | ||
+ | |||
+ | Building configuration... | ||
+ | |||
+ | Current configuration : 138 bytes | ||
+ | ! | ||
+ | interface TenGigabitEthernet7/1/7 | ||
+ | ip address 100.1.1.1 255.255.255.254 ##### ipv4 掩码必须是31 | ||
+ | cdp enable | ||
+ | ipv6 address 2001:100:1:1::1/127 | ||
+ | ipv6 enable | ||
+ | end | ||
+ | |||
+ | </source > | ||
+ | |||
+ | === ipv4 - nso delete === | ||
+ | ==== no vrf ==== | ||
<source lang="shell"> | <source lang="shell"> | ||
+ | # ios cmd | ||
+ | ip route 60.10.13.61 255.255.255.255 100.1.1.0 | ||
+ | |||
+ | # 不带vrf | ||
curl -i -u admin:admin http://127.0.0.1:8080/api/running/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ip/route | curl -i -u admin:admin http://127.0.0.1:8080/api/running/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ip/route | ||
<ip-route-forwarding-list> | <ip-route-forwarding-list> | ||
− | <prefix>10. | + | <prefix>60.10.13.61</prefix> |
− | <mask>255.255.255. | + | <mask>255.255.255.255</mask> |
− | <forwarding-address> | + | <forwarding-address>100.1.1.0</forwarding-address> |
</ip-route-forwarding-list> | </ip-route-forwarding-list> | ||
− | <vrf> | + | # delete 第一种情况 |
− | <name>lcha- | + | curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ip/route/ip-route-forwarding-list/60.10.13.61,255.255.255.255,100.1.1.0 |
− | </vrf> | + | |
+ | </source > | ||
+ | |||
+ | ==== vrf ==== | ||
+ | <source lang="shell"> | ||
+ | # ios cmd | ||
+ | ip route vrf lcha-617 60.10.13.61 255.255.255.255 100.1.1.2 | ||
+ | |||
+ | # 带vrf | ||
+ | curl -i -u admin:admin http://127.0.0.1:8080/api/running/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ip/route/vrf | ||
+ | <vrf xmlns="urn:ios"> | ||
+ | <name>lcha-617</name> # 只要删除这一条 | ||
+ | <ip-route-forwarding-list xmlns="urn:ios"> | ||
+ | <prefix>60.10.13.61</prefix> | ||
+ | <mask>255.255.255.255</mask> | ||
+ | <forwarding-address>100.1.1.2</forwarding-address> | ||
+ | </ip-route-forwarding-list> | ||
+ | <ip-route-forwarding-list xmlns="urn:ios"> | ||
+ | <prefix>60.10.13.62</prefix> | ||
+ | <mask>255.255.255.255</mask> | ||
+ | <forwarding-address>100.1.1.2</forwarding-address> | ||
+ | </ip-route-forwarding-list> | ||
+ | </vrf> | ||
+ | |||
+ | # 删除带vrf的 | ||
+ | curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ip/route/vrf/lcha-617/ip-route-forwarding-list/60.10.13.62,255.255.255.255,100.1.1.2 | ||
+ | </source > | ||
+ | |||
+ | === ipv6 - nso delete === | ||
+ | ==== no vrf ==== | ||
+ | <source lang="shell"> | ||
+ | # ios cmd | ||
+ | ipv6 route 2001:20:1:1::33/128 2001:20:5:30::1 | ||
+ | |||
+ | # 不带vrf | ||
+ | curl -i -u admin:admin http://127.0.0.1:8080/api/running/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route | ||
+ | <no-vrf> | ||
+ | <ipv6-route-destination-list> | ||
+ | <prefix>2001:20:1:1::33/128</prefix> | ||
+ | <destination>2001:20:5:30::1</destination> | ||
+ | </ipv6-route-destination-list> | ||
+ | </no-vrf> | ||
+ | |||
+ | # delete 第一种情况 | ||
+ | curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/no-vrf/ipv6-route-destination-list/2001:20:1:1::33/128,2001:20:5:30::1 | ||
+ | ### : 要URL转意 | ||
+ | curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/no-vrf/ipv6-route-destination-list/2001%3a20%3a1%3a1%3a%3a33%2f128,2001%3a20%3a5%3a30%3a%3a1 | ||
+ | |||
+ | # 2001:20:1:1::33 === 2001:20:1:1:0:0:0:33 (2001%3a20%3a1%3a1%3a0%3a0%3a0%3a33) | ||
+ | # 验证NSO是否支持 -> 支持! | ||
+ | curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/no-vrf/ipv6-route-destination-list/2001%3a20%3a1%3a1%3a0%3a0%3a0%3a33%2f128,2001%3a20%3a5%3a30%3a%3a1 | ||
+ | |||
+ | # 当前只要 prefix,这样一次可以删除下面两条 | ||
+ | # ipv6 route 2001:20:1:1::33/128 2001:20:5:33::1 | ||
+ | # ipv6 route 2001:20:1:1::33/128 2001:20:5:30::1 | ||
+ | ### : 要URL转意 | ||
+ | # !!!不行, nso not support!!! curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/no-vrf/ipv6-route-destination-list/2001%3a20%3a1%3a1%3a%3a33%2f128 | ||
+ | </source > | ||
+ | |||
+ | ==== vrf ==== | ||
+ | <source lang="shell"> | ||
+ | # ios cmd | ||
+ | ipv6 route vrf lcha-617 2001:60:10:13::25C/128 2001:100:1:1::4 | ||
+ | |||
+ | # 带vrf | ||
+ | curl -i -u admin:admin http://127.0.0.1:8080/api/running/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/vrf | ||
+ | <vrf xmlns="urn:ios"> | ||
+ | <name>lcha-617</name> | ||
+ | <ipv6-route-destination-list xmlns="urn:ios"> | ||
+ | <prefix>2001:60:10:13::25c/128</prefix> | ||
+ | <destination>2001:100:1:1::4</destination> | ||
+ | </ipv6-route-destination-list> | ||
+ | </vrf> | ||
+ | |||
− | # | + | # 删除带vrf的 |
− | curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios: | + | curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/vrf/lcha-617/ipv6-route-destination-list/2001:60:10:13::25c/128,2001:100:1:1::4 |
+ | ### : 要URL转意 | ||
+ | curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/vrf/lcha-617/ipv6-route-destination-list/2001%3a60%3a10%3a13%3a%3a25c%2f128,2001%3a100%3a1%3a1%3a%3a4 | ||
</source > | </source > | ||
− | |||
− |
2018年6月26日 (二) 09:17的最新版本
目录
描述
remove L3 static routes by NSO REST API not using no command
wiki
scope
cBR8上需要配置
CRDC-NG-E09#sh run interface tenGigabitEthernet 7/1/7
Load for five secs: 4%/1%; one minute: 11%; five minutes: 17%
Time source is NTP, 02:21:19.507 PDT Tue Jun 26 2018
Building configuration...
Current configuration : 138 bytes
!
interface TenGigabitEthernet7/1/7
ip address 100.1.1.1 255.255.255.254 ##### ipv4 掩码必须是31
cdp enable
ipv6 address 2001:100:1:1::1/127
ipv6 enable
end
ipv4 - nso delete
no vrf
# ios cmd
ip route 60.10.13.61 255.255.255.255 100.1.1.0
# 不带vrf
curl -i -u admin:admin http://127.0.0.1:8080/api/running/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ip/route
<ip-route-forwarding-list>
<prefix>60.10.13.61</prefix>
<mask>255.255.255.255</mask>
<forwarding-address>100.1.1.0</forwarding-address>
</ip-route-forwarding-list>
# delete 第一种情况
curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ip/route/ip-route-forwarding-list/60.10.13.61,255.255.255.255,100.1.1.0
vrf
# ios cmd
ip route vrf lcha-617 60.10.13.61 255.255.255.255 100.1.1.2
# 带vrf
curl -i -u admin:admin http://127.0.0.1:8080/api/running/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ip/route/vrf
<vrf xmlns="urn:ios">
<name>lcha-617</name> # 只要删除这一条
<ip-route-forwarding-list xmlns="urn:ios">
<prefix>60.10.13.61</prefix>
<mask>255.255.255.255</mask>
<forwarding-address>100.1.1.2</forwarding-address>
</ip-route-forwarding-list>
<ip-route-forwarding-list xmlns="urn:ios">
<prefix>60.10.13.62</prefix>
<mask>255.255.255.255</mask>
<forwarding-address>100.1.1.2</forwarding-address>
</ip-route-forwarding-list>
</vrf>
# 删除带vrf的
curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ip/route/vrf/lcha-617/ip-route-forwarding-list/60.10.13.62,255.255.255.255,100.1.1.2
ipv6 - nso delete
no vrf
# ios cmd
ipv6 route 2001:20:1:1::33/128 2001:20:5:30::1
# 不带vrf
curl -i -u admin:admin http://127.0.0.1:8080/api/running/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route
<no-vrf>
<ipv6-route-destination-list>
<prefix>2001:20:1:1::33/128</prefix>
<destination>2001:20:5:30::1</destination>
</ipv6-route-destination-list>
</no-vrf>
# delete 第一种情况
curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/no-vrf/ipv6-route-destination-list/2001:20:1:1::33/128,2001:20:5:30::1
### : 要URL转意
curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/no-vrf/ipv6-route-destination-list/2001%3a20%3a1%3a1%3a%3a33%2f128,2001%3a20%3a5%3a30%3a%3a1
# 2001:20:1:1::33 === 2001:20:1:1:0:0:0:33 (2001%3a20%3a1%3a1%3a0%3a0%3a0%3a33)
# 验证NSO是否支持 -> 支持!
curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/no-vrf/ipv6-route-destination-list/2001%3a20%3a1%3a1%3a0%3a0%3a0%3a33%2f128,2001%3a20%3a5%3a30%3a%3a1
# 当前只要 prefix,这样一次可以删除下面两条
# ipv6 route 2001:20:1:1::33/128 2001:20:5:33::1
# ipv6 route 2001:20:1:1::33/128 2001:20:5:30::1
### : 要URL转意
# !!!不行, nso not support!!! curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/no-vrf/ipv6-route-destination-list/2001%3a20%3a1%3a1%3a%3a33%2f128
vrf
# ios cmd
ipv6 route vrf lcha-617 2001:60:10:13::25C/128 2001:100:1:1::4
# 带vrf
curl -i -u admin:admin http://127.0.0.1:8080/api/running/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/vrf
<vrf xmlns="urn:ios">
<name>lcha-617</name>
<ipv6-route-destination-list xmlns="urn:ios">
<prefix>2001:60:10:13::25c/128</prefix>
<destination>2001:100:1:1::4</destination>
</ipv6-route-destination-list>
</vrf>
# 删除带vrf的
curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/vrf/lcha-617/ipv6-route-destination-list/2001:60:10:13::25c/128,2001:100:1:1::4
### : 要URL转意
curl -i -u admin:admin -X "DELETE" http://127.0.0.1:8080/api/config/devices/device/f0bf1cdf-bee1-3525-817c-b593fcb8c8bb/config/ios:ipv6/route/vrf/lcha-617/ipv6-route-destination-list/2001%3a60%3a10%3a13%3a%3a25c%2f128,2001%3a100%3a1%3a1%3a%3a4