Static Route
此内容尚不支持你的语言。
| URL | GET | POST | PATCH | PUT | DELETE |
|---|---|---|---|---|---|
| /rest/v1/rpc/show-ip-route | N | Y | N | N | N |
| /rest/v1/rpc/show-ipv6-route | N | Y | N | N | N |
| /rest/v1/running/static-routes/{vrf}/{prefix} | Y | Y | Y | N | Y |
| /rest/v1/running/static-routes/{vrf}/{prefix}/nexthops/blackhole-nexthop | N | Y | Y | N | Y |
| /rest/v1/running/static-routes/{vrf}/{prefix}/nexthops/ifindex-nexthops/{nh-vrf}/{interface} | N | Y | Y | N | Y |
| /rest/v1/running/static-routes/{vrf}/{prefix}/nexthops/ip-ifindex-nexthops/{nh-vrf}/{gateway}/{interface} | N | Y | Y | N | Y |
| /rest/v1/running/static-routes/{vrf}/{prefix}/nexthops/ip-nexthops/{nh-vrf}/{gateway} | N | Y | Y | N | Y |
Examples
Section titled “Examples”Show IPv4 route vrf all
Section titled “Show IPv4 route vrf all”POST HTTPS://{switch IP}/rest/v1/rpc/show-ip-route{ "vrf": "all"}response:
{ "data": [ { "prefix": "10.1.0.174/32", "prefixLen": 32, "protocol": "connected", "vrfId": 0, "vrfName": "default", "selected": true, "destSelected": true, "distance": 0, "metric": 0, "installed": true, "table": 254, "internalStatus": 16, "internalFlags": 8, "internalNextHopNum": 1, "internalNextHopActiveNum": 1, "nexthopGroupId": 88, "installedNexthopGroupId": 88, "uptime": "2d05h13m", "nexthops": [ { "flags": 3, "fib": true, "directlyConnected": true, "interfaceIndex": 248, "interfaceName": "Loopback0", "active": true } ] }, { "prefix": "10.250.0.0/24", "prefixLen": 24, "protocol": "connected", "vrfId": 0, "vrfName": "default", "selected": true, "destSelected": true, "distance": 0, "metric": 0, "installed": true, "table": 254, "internalStatus": 16, "internalFlags": 8, "internalNextHopNum": 1, "internalNextHopActiveNum": 1, "nexthopGroupId": 92, "installedNexthopGroupId": 92, "uptime": "2d05h13m", "nexthops": [ { "flags": 3, "fib": true, "directlyConnected": true, "interfaceIndex": 2, "interfaceName": "Mgmt0", "active": true } ] }, { "prefix": "43.0.0.0/24", "prefixLen": 24, "protocol": "connected", "vrfId": 0, "vrfName": "default", "selected": true, "destSelected": true, "distance": 0, "metric": 0, "installed": true, "table": 254, "internalStatus": 16, "internalFlags": 8, "internalNextHopNum": 1, "internalNextHopActiveNum": 1, "nexthopGroupId": 188, "installedNexthopGroupId": 188, "uptime": "03:19:19", "nexthops": [ { "flags": 3, "fib": true, "directlyConnected": true, "interfaceIndex": 291, "interfaceName": "Ethernet43", "active": true } ] } ]}Show IPv6 route
Section titled “Show IPv6 route”POST HTTPS://{switch IP}/rest/v1/rpc/show-ipv6-route{ "vrf": "Vrftest"}response:
{ "data": [ { "prefix": "fe80::/64", "prefixLen": 64, "protocol": "connected", "vrfId": 311, "vrfName": "Vrftest", "selected": true, "destSelected": true, "distance": 0, "metric": 0, "installed": true, "table": 1001, "internalStatus": 16, "internalFlags": 8, "internalNextHopNum": 1, "internalNextHopActiveNum": 1, "nexthopGroupId": 197, "installedNexthopGroupId": 197, "uptime": "00:44:35", "nexthops": [ { "flags": 3, "fib": true, "directlyConnected": true, "interfaceIndex": 303, "interfaceName": "Ethernet53:3", "active": true } ] } ]}Create a static route.
Section titled “Create a static route.”POST HTTPS://{switch IP}/rest/v1/running/static-routes/{ "vrf": "Vrf200", "prefix": "224.0.0.1/32", "nexthops": { "ip-ifindex-nexthops": [ { "gateway": "50.0.0.1", "interface": "Ethernet24" } ] }}Modify a static route with a blackhole next hop.
Section titled “Modify a static route with a blackhole next hop.”POST HTTPS://{switch IP}/rest/v1/running/static-routes/Vrf200/10.1.1.0%2F24/nexthops/blackhole-nexthop/{ "bh-type": "null"}Create an interface nexthop for static route.
Section titled “Create an interface nexthop for static route.”POST HTTPS://{switch IP}/rest/v1/running/static-routes/Vrftest/100.0.0.0/24/nexthops/ifindex-nexthops{ "nh-vrf": "Vrftest", "interface": "Vlan100"}Modify an ip & interface nexthop for static route
Section titled “Modify an ip & interface nexthop for static route”PATCH HTTPS://{switch IP}/rest/v1/running/static-routes/Vrf200/10.1.1.0%2F24/nexthops/ip-ifindex-nexthops/Vrf100/10.0.0.1/Ethernet24{ "bfd": { "enable": "true" }}Modify an ip nexthop for static route.
Section titled “Modify an ip nexthop for static route.”PATCH HTTPS://{switch IP}/rest/v1/running/static-routes/Vrf200/10.1.1.0%2F24/nexthops/ip-nexthops/default/10.0.0.1{ "bfd": { "enable": "true" }}Properties Descriptions
Section titled “Properties Descriptions”Static route blackhole entry
Section titled “Static route blackhole entry”Tree Diagrams
+--rw static-routes +--rw static-route* [vrf prefix] +--rw vrf +--rw prefix +--rw nexthops +--rw (nexthop) +--:(blackhole) | +--rw blackhole-nexthop | +--rw bh-type | +--rw distance? | +--rw tag? | +--rw description?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| static-routes | M | Path-only node, has no configurable value. | |
| vrf | M | ”default” | |
| vrf name | (sub-property of static-routes) | ||
| VRF of staticd IP route. | |||
| prefix | M | A.B.C.D/M | |
| XX:XX:XX:XX:XX:XX:XX:XX/M | (sub-property of static-routes) | ||
| IP prefix. | |||
| nexthops | M | (sub-property of static-routes) | |
| Path-only node, has no configurable value. | |||
| nexthop object. | |||
| blackhole-nexthop | M | (sub-property of nexthops) | |
| Path-only node, has no configurable value. | |||
| bh-type | M | ”unspec" "null" "reject" "prohibited” | (sub-property of blackhole-nexthop) |
| A blackhole sub-type, if the nexthop is a blackhole type. - “unspec”: “Generic unreachable.” | |||
- “null”: “Null type.” - “reject”: “ICMP unreachable.” - “prohibited”: “ICMP admin-prohibited.” Default value: “null” | |||
| distance | O | 1..255 | (sub-property of blackhole-nexthop) |
| Admin distance associated with this route. | |||
| Default value: 1 | |||
| tag | O | 1..4294967295 | (sub-property of blackhole-nexthop) |
| Route tag | |||
| description | O | string within 255 characters | (sub-property of blackhole-nexthop) |
| A textual description of the nexthop. Spaces are not permitted in the description. |
Static route non-blackhole entry
Section titled “Static route non-blackhole entry”Tree Diagrams
+--rw static-routes +--rw static-route* [vrf prefix] +--rw vrf +--rw prefix +--rw nexthops +--rw (nexthop) +--:(non-blackhole) +--rw ifindex-nexthops* [nh-vrf interface] | +--rw interface | +--rw nh-vrf | +--rw distance? | +--rw tag? | +--rw description? +--rw ip-nexthops* [nh-vrf gateway] | +--rw nh-vrf | +--rw gateway | +--rw distance? | +--rw tag? | +--rw description? | +--rw bfd | | +--rw enable? | | +--rw multihop? | | +--rw local-address? | +--rw track? +--rw ip-ifindex-nexthops* [nh-vrf gateway interface] +--rw gateway +--rw nh-vrf +--rw interface +--rw onlink? +--rw distance? +--rw tag? +--rw description? +--rw bfd | +--rw enable? | +--rw multihop? | +--rw local-address? +--rw track?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| static-routes | M | Path-only node, has no configurable value. | |
| vrf | M | ”default” | |
| vrf name | (sub-property of static-routes) | ||
| VRF of staticd IP route. | |||
| prefix | M | A.B.C.D/M | |
| XX:XX:XX:XX:XX:XX:XX:XX/M | (sub-property of static-routes) | ||
| IP prefix. | |||
| nexthops | M | (sub-property of static-routes) | |
| Path-only node, has no configurable value. | |||
| nexthop object. | |||
| ifindex-nexthops | O | (sub-property of nexthops) | |
| Path-only node, has no configurable value. | |||
| A list of nexthop objects. | |||
| interface | M | Ethernet name | |
| Lag1..9999 | |||
| Vlan1..4094 | |||
| Vxlan vni name | (sub-property of ifindex-nexthops) | ||
| The nexthop egress interface. | |||
| nh-vrf | M | ”default” | |
| vrf name | (sub-property of ifindex-nexthops) | ||
| The nexthop vrf name, if different from the route. | |||
| distance | O | 1..255 | (sub-property of ifindex-nexthops) |
| Admin distance associated with this route. | |||
| Default value: 1 | |||
| tag | O | 1..4294967295 | (sub-property of ifindex-nexthops) |
| Route tag | |||
| description | O | string within 255 characters | (sub-property of ifindex-nexthops) |
| A textual description of the nexthop. Spaces are not permitted in the description. | |||
| ip-nexthops | O | (sub-property of nexthops) | |
| Path-only node, has no configurable value. | |||
| A list of nexthop objects of type ip4 or ip6. | |||
| nh-vrf | M | ”default” | |
| vrf name | (sub-property of ip-nexthops) | ||
| The nexthop vrf name, if different from the route. | |||
| gateway | M | A.B.C.D | |
| XX:XX:XX:XX:XX:XX:XX:XX | (sub-property of ip-nexthops) | ||
| The nexthop gateway address. | |||
| distance | O | 1..255 | (sub-property of ip-nexthops) |
| Admin distance associated with this route. | |||
| Default value: 1 | |||
| tag | O | 1..4294967295 | (sub-property of ip-nexthops) |
| Route tag | |||
| description | O | string within 255 characters | (sub-property of ip-nexthops) |
| A textual description of the nexthop. Spaces are not permitted in the description. | |||
| bfd | O | (sub-property of ip-nexthops) | |
| Path-only node, has no configurable value. | |||
| FRR nexthop bfd object. | |||
| enable | O | ”true" | |
| "false” | (sub-property of bfd) | ||
| Nexthop open bfd | |||
| Default value: “false” | |||
| multihop | CO | ”true" | |
| "false” | (sub-property of bfd) | ||
| Only applicable when enable = “true”. | |||
| Open bfd multihop mode | |||
| Default value: “false” | |||
| local-address | CO | A.B.C.D | |
| XX:XX:XX:XX:XX:XX:XX:XX | (sub-property of bfd) | ||
| Only applicable when enable = “true” and multihop = “true”. | |||
| The bfd local-address. | |||
| track | O | 1..4294967295 | (sub-property of ip-nexthops) |
| Route track | |||
| ip-ifindex-nexthops | O | (sub-property of nexthops) | |
| Path-only node, has no configurable value. | |||
| A list of nexthop objects of type ip4-ifindex or ip6-ifindex. | |||
| gateway | M | A.B.C.D | |
| XX:XX:XX:XX:XX:XX:XX:XX | (sub-property of ip-ifindex-nexthops) | ||
| The nexthop gateway address. | |||
| nh-vrf | M | ”default” | |
| vrf name | (sub-property of ip-ifindex-nexthops) | ||
| The nexthop vrf name, if different from the route. | |||
| interface | M | Ethernet name | |
| Lag1..9999 | |||
| Vlan1..4094 | |||
| Vxlan vni name | (sub-property of ip-ifindex-nexthops) | ||
| The nexthop egress interface. | |||
| onlink | O | ”true" | |
| "false” | (sub-property of ip-ifindex-nexthops) | ||
| Treat the nexthop as directly attached to the interface. | |||
| Default value: “false” | |||
| distance | O | 1..255 | (sub-property of ip-ifindex-nexthops) |
| Admin distance associated with this route. | |||
| Default value: 1 | |||
| tag | O | 1..4294967295 | (sub-property of ip-ifindex-nexthops) |
| Route tag | |||
| description | O | string within 255 characters | (sub-property of ip-ifindex-nexthops) |
| A textual description of the nexthop. Spaces are not permitted in the description. | |||
| bfd | O | (sub-property of ip-ifindex-nexthops) | |
| Path-only node, has no configurable value. | |||
| FRR nexthop bfd object. | |||
| enable | O | ”true" | |
| "false” | (sub-property of bfd) | ||
| Nexthop open bfd | |||
| Default value: “false” | |||
| multihop | CO | ”true" | |
| "false” | (sub-property of bfd) | ||
| Only applicable when enable = “true”. | |||
| Open bfd multihop mode | |||
| Default value: “false” | |||
| local-address | CO | A.B.C.D | |
| XX:XX:XX:XX:XX:XX:XX:XX | (sub-property of bfd) | ||
| Only applicable when enable = “true” and multihop = “true”. | |||
| The bfd local-address. | |||
| track | O | 1..4294967295 | (sub-property of ip-ifindex-nexthops) |
| Route track |
Show IPv4 route
Section titled “Show IPv4 route”Tree Diagrams
+---x show-ip-route +---w input | +---w vrf? +--ro output +--ro data?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-ip-route | M | Path-only node, has no configurable value. | |
| Show IPv4 routes. | |||
| vrf | O | ”all" | |
| "default” | |||
| vrf name | (sub-property of input) | ||
| VRF of IPv4 route. | |||
| data | RO | (sub-property of output) |
Show IPv6 route
Section titled “Show IPv6 route”Tree Diagrams
+---x show-ipv6-route +---w input | +---w vrf? +--ro output +--ro data?Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-ipv6-route | M | Path-only node, has no configurable value. | |
| Show IPv6 routes. | |||
| vrf | O | ”all" | |
| "default” | |||
| vrf name | (sub-property of input) | ||
| VRF of IPv6 route. | |||
| data | RO | (sub-property of output) |