# 9.2 配置默认路由

默认路由又称为缺省静态路由，是静态路由的特例，它表示把所有本机不能处理的数据报发往指定的设备。

## 模式：

全局配置模式。

## 1、配置默认路由：

```java
Ruijie(config)#ip route 0.0.0.0 0.0.0.0 ip-address
```

## 参数：

`0.0.0.0 0.0.0.0` 表示任意地址。

`ip-address` 是下一跳地址。

## 说明：

默认路由的优先级是最低的，设备首先会匹配静态路由和由路由协议生成的路由，只有当没有相匹配的项目时，才按照默认路由指定的地址发送。

## 2、删除默认路由：

```java
Ruijie(config)#no ip route 0.0.0.0 0.0.0.0
```

## 配置举例：

```java
Ruijie>enable
Ruijie#configure terminal
Ruijie(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.2
```

`ip route 0.0.0.0 0.0.0.0 192.168.10.2` 命令表示把所有没有匹配成功的目的地址发往地址 `192.168.10.2` 处。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kerwin.gitbook.io/ruijie/jiao-huan-chan-pin/path2/9.-lu-you-de-pei-zhi-yu-cha-kan/9.2-pei-zhi-mo-ren-lu-you.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
