ip route – a family of commands for configuring IP routes

ip route <subnet> netmask <mask> vrf <vrf-name> gateway <address> [ad <number>]

Add static unicast route. By default, the administrative distance (ad) is 1.

ip route <subnet> netmask <mask> vrf <vrf-name> blackhole [ad <number>]

Add static blackhole route. By default, the administrative distance (ad) is 200.

Examples:

ngfw> ip route 0.0.0.0 netmask 0.0.0.0 vrf Main blackhole
ngfw> ip route 10.0.2.3 netmask 255.255.255.0 vrf test gateway 10.0.2.4 ad 2
ngfw> ip route 192.168.0.1 netmask 240.0.0.0 vrf Main gateway 192.168.0.2

no ip route <subnet> netmask <mask> vrf <vrf-name> [ad <number>] gateway <address>

Remove static unicast route.

no ip route <subnet> netmask <mask> vrf <vrf-name> [ad <number>] blackhole

Remove static blackhole route.

show routes

Show routing and forwarding table.

show routes rib [json] all

Show the entire RIB table (in JSON format, if json). Examples:

ngfw> show routes rib all
Codes: K - kernel route, C - connected, S - static,
       O - OSPF, B - BGP, T - Table,
       > - selected route, * - FIB route, q - queued, r - rejected
       t - trapped, o - offload failure

VRF Main:
S>* 0.0.0.0/0 [1/0] is directly connected, port2, weight 1, 00:06:54
  *                 via 192.168.0.1, port2, weight 1, 00:06:54
  *                 via 192.168.0.2, port2, weight 1, 00:06:54
  *                 via 192.168.0.3, port2, weight 1, 00:06:54
S>* 10.3.0.0/24 [200/0] unreachable (blackhole), weight 1, 00:06:55
C>* 192.168.0.0/24 is directly connected, port2, 00:06:54

VRF Management:
K>* 0.0.0.0/0 [0/1024] via 10.0.2.2, port1, src 10.0.2.15, 00:07:41
C>* 10.0.2.0/24 [0/1024] is directly connected, port1, 00:07:41
K>* 10.0.2.2/32 [0/1024] is directly connected, port1, 00:07:41
K>* 10.0.2.3/32 [0/1024] is directly connected, port1, 00:07:41
ngfw> show routes rib json all
{
  "ngfw-routing:routing": {
    "rib": {
      "routes": {
        "route": [
          {
            "destination": "0.0.0.0/0",
            "vrfName": "Main",
            "protocol": "static",
            "distance": 1,
            "metric": 0,
            "table": 254,
            "uptime": "00:07:24",
            "selected": true,
            "nexthop": [
              {
                "id": 0,
                "interfaceName": "port2",
                "flags": 3,
                "weight": 1,
                "fib": true,
                "directlyConnected": true,
                "active": true
              },
              {
                "id": 1,
                "interfaceName": "port2",
                "flags": 3,
                "weight": 1,
                "fib": true,
                "ip": "192.168.0.1",
                "afi": "ipv4",
                "active": true
              },
              {
                "id": 2,
                "interfaceName": "port2",
                "flags": 3,
                "weight": 1,
                "fib": true,
                "ip": "192.168.0.2",
                "afi": "ipv4",
                "active": true
              },
              {
                "id": 3,
                "interfaceName": "port2",
                "flags": 3,
                "weight": 1,
                "fib": true,
                "ip": "192.168.0.3",
                "afi": "ipv4",
                "active": true
              }
            ]
          },
          {
            "destination": "10.3.0.0/24",
            "vrfName": "Main",
            "protocol": "static",
            "distance": 200,
            "metric": 0,
            "table": 254,
            "uptime": "00:07:25",
            "selected": true,
            "nexthop": [
              {
                "id": 0,
                "flags": 3,
                "weight": 1,
                "fib": true,
                "active": true,
                "blackhole": true
              }
            ]
          },
          {
            "destination": "192.168.0.0/24",
            "vrfName": "Main",
            "protocol": "connected",
            "distance": 0,
            "metric": 0,
            "table": 254,
            "uptime": "00:07:24",
            "selected": true,
            "nexthop": [
              {
                "id": 0,
                "interfaceName": "port2",
                "flags": 3,
                "fib": true,
                "directlyConnected": true,
                "active": true
              }
            ]
          },
          {
            "destination": "0.0.0.0/0",
            "vrfName": "Management",
            "protocol": "kernel",
            "distance": 0,
            "metric": 1024,
            "table": 2,
            "uptime": "00:08:11",
            "selected": true,
            "nexthop": [
              {
                "id": 0,
                "interfaceName": "port1",
                "flags": 3,
                "fib": true,
                "ip": "10.0.2.2",
                "afi": "ipv4",
                "active": true,
                "source": "10.0.2.15"
              }
            ]
          },
          {
            "destination": "10.0.2.0/24",
            "vrfName": "Management",
            "protocol": "connected",
            "distance": 0,
            "metric": 1024,
            "table": 2,
            "uptime": "00:08:11",
            "selected": true,
            "nexthop": [
              {
                "id": 0,
                "interfaceName": "port1",
                "flags": 3,
                "fib": true,
                "directlyConnected": true,
                "active": true
              }
            ]
          },
          {
            "destination": "10.0.2.2/32",
            "vrfName": "Management",
            "protocol": "kernel",
            "distance": 0,
            "metric": 1024,
            "table": 2,
            "uptime": "00:08:11",
            "selected": true,
            "nexthop": [
              {
                "id": 0,
                "interfaceName": "port1",
                "flags": 3,
                "fib": true,
                "directlyConnected": true,
                "active": true
              }
            ]
          },
          {
            "destination": "10.0.2.3/32",
            "vrfName": "Management",
            "protocol": "kernel",
            "distance": 0,
            "metric": 1024,
            "table": 2,
            "uptime": "00:08:11",
            "selected": true,
            "nexthop": [
              {
                "id": 0,
                "interfaceName": "port1",
                "flags": 3,
                "fib": true,
                "directlyConnected": true,
                "active": true
              }
            ]
          }
        ]
      }
    }
  }
}

show routes rib [json] destination <address> vrf (<vrf-name>|all)

Show RIB table (in JSON format if json) with filtering by destination address and by virtual router (Virtual Routing and Forwarding; VRF).

Examples:

show routes rib destination 0.0.0.0 vrf all
show routes rib destination 0.0.0.0/0 vrf Main
show routes rib destination 0.0.0.0/0 vrf Management
ngfw> show routes rib destination 0.0.0.0 vrf Main
Codes: K - kernel route, C - connected, S - static,
       O - OSPF, B - BGP, T - Table,
       > - selected route, * - FIB route, q - queued, r - rejected
       t - trapped, o - offload failure

VRF Main:
S>* 0.0.0.0/0 [1/0] is directly connected, port2, weight 1, 00:08:45
  *                 via 192.168.0.1, port2, weight 1, 00:08:45
  *                 via 192.168.0.2, port2, weight 1, 00:08:45
  *                 via 192.168.0.3, port2, weight 1, 00:08:45
ngfw> show routes rib json destination 0.0.0.0/0 vrf Main

Формат вывода аналогичен команде show routes rib json all.

show routes rib [json] longer-prefixes <address> vrf (<vrf-name>|all)

Показать RIB-таблицу (в формате JSON, если json) с фильтрацией по адресу назначения и по VRF, при этом разрешены более длинные маски.

Examples:

ngfw> show routes rib longer-prefixes 10.0.3.0/23 vrf Management
Codes: K - kernel route, C - connected, S - static,
       O - OSPF, B - BGP, T - Table,
       > - selected route, * - FIB route, q - queued, r - rejected
       t - trapped, o - offload failure

VRF Management:
C>* 10.0.2.0/24 [0/1024] is directly connected, port1, 00:11:03
K>* 10.0.2.2/32 [0/1024] is directly connected, port1, 00:11:03
K>* 10.0.2.3/32 [0/1024] is directly connected, port1, 00:11:03
ngfw> show routes rib json longer-prefixes 10.0.3.0/23 vrf Management

Формат вывода аналогичен команде show routes rib json all.

show routes rib [json] vrf <vrf-name>

Показать RIB-таблицу (в формате JSON, если json) с фильтрацией по VRF.

Examples:

ngfw> show routes rib vrf Management
Codes: K - kernel route, C - connected, S - static,
       O - OSPF, B - BGP, T - Table,
       > - selected route, * - FIB route, q - queued, r - rejected
       t - trapped, o - offload failure

VRF Management:
K>* 0.0.0.0/0 [0/1024] via 10.0.2.2, port1, src 10.0.2.15, 00:12:15
C>* 10.0.2.0/24 [0/1024] is directly connected, port1, 00:12:15
K>* 10.0.2.2/32 [0/1024] is directly connected, port1, 00:12:15
K>* 10.0.2.3/32 [0/1024] is directly connected, port1, 00:12:15
ngfw> show routes rib json vrf Management

Формат вывода аналогичен команде show routes rib json all.

show routes rib [json] interface <interface> vrf (<vrf-name>|all)

Показать RIB-таблицу (в формате JSON, если json) с фильтрацией по имени интерфейса и по VRF.

Examples:

ngfw> show routes rib interface port2 vrf Main
Codes: K - kernel route, C - connected, S - static,
       O - OSPF, B - BGP, T - Table,
       > - selected route, * - FIB route, q - queued, r - rejected
       t - trapped, o - offload failure

VRF Main:
S>* 0.0.0.0/0 [1/0] is directly connected, port2, weight 1, 00:12:00
  *                 via 192.168.0.1, port2, weight 1, 00:12:00
  *                 via 192.168.0.2, port2, weight 1, 00:12:00
  *                 via 192.168.0.3, port2, weight 1, 00:12:00
C>* 192.168.0.0/24 is directly connected, port2, 00:12:00
ngfw> show routes rib json interface port2 vrf Main

Формат вывода аналогичен команде show routes rib json all.

show routes fib all

Show entire FIB table. Example:

ngfw> interface port2
ngfw> interface=['port2']> protocol staticIpv4
ngfw> interface=['port2']> ip 192.168.0.1/24
ngfw> interface=['port2']> up
ngfw> interface=['port2']> exit
ngfw> commit
ngfw> ip route 0.0.0.0 netmask 0.0.0.0 vrf Main gateway 192.168.0.1
ngfw> ip route 0.0.0.0 netmask 0.0.0.0 vrf Main gateway 192.168.0.2
ngfw> ip route 0.0.0.0 netmask 0.0.0.0 vrf Main gateway 192.168.0.3
ngfw> commit
ngfw> show routes fib all
{
  "ngfw-routing:routing": {
    "static": {
      "route": [
        {
          "id": "1",
          "vrfName": "Main",
          "target": "0.0.0.0",
          "netmask": "0.0.0.0",
          "gateway": "192.168.0.1",
          "interface": "port2"
        },
        {
          "id": "2",
          "vrfName": "Main",
          "target": "0.0.0.0",
          "netmask": "0.0.0.0",
          "gateway": "192.168.0.2",
          "interface": "port2"
        },
        {
          "id": "3",
          "vrfName": "Main",
          "target": "0.0.0.0",
          "netmask": "0.0.0.0",
          "gateway": "192.168.0.3",
          "interface": "port2"
        },
        {
          "id": "4",
          "vrfName": "Main",
          "target": "192.168.0.1",
          "netmask": "255.255.255.0",
          "interface": "port2"
        },
        {
          "id": "5",
          "vrfName": "Main",
          "target": "192.168.0.0",
          "netmask": "255.255.255.255"
        },
        {
          "id": "6",
          "vrfName": "Main",
          "target": "192.168.0.1",
          "netmask": "255.255.255.255",
          "gateway": "192.168.0.1",
          "interface": "port2"
        },
        {
          "id": "7",
          "vrfName": "Main",
          "target": "192.168.0.255",
          "netmask": "255.255.255.255"
        }
      ]
    }
  }
}

show routes fib destination <address> vrf (<vrf-name>|all)

Show FIB table filtered by destination address and by VRF.

Examples:

ngfw> show routes fib destination 10.0.3.1 vrf all
ngfw> show routes fib destination 10.0.3.1/24 vrf Main

The output format is similar to the 'show routes fib all' command.

show routes fib interface <interface> vrf (<vrf-name>|all)

Show FIB table filtered by interface name and by VRF.

Example:

ngfw> show routes fib interface port2 vrf all

The output format is similar to the 'show routes fib all' command.

show routes fib vrf <vrf-name>

Show FIB table filtered by VRF.

Example:

ngfw> show routes fib vrf Main

The output format is similar to the 'show routes fib all' command.

show routes config

Show static route configuration.

Example:

ngfw> show routes config
{
  "ngfw-routing:routing": {
    "static": {
      "route": [
        {
          "id": "65d5d134-032b-456d-ab95-910f5e66368b",
          "vrfName": "test",
          "target": "0.0.0.0",
          "netmask": "0.0.0.0",
          "interface": "port5",
          "type": "unicast",
          "ad": 1,
          "nextHopVrf": "test"
        }
      ]
    }
  }
}

| Prev | Home | Next |