> For the complete documentation index, see [llms.txt](https://anida-huang.gitbook.io/computer-network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anida-huang.gitbook.io/computer-network/qi-zhong/20200930-introduction-router-setting.md).

# 20200930 Introduction Router Setting

## 課堂資料

#### Cisco router 基本設定：

{% embed url="<https://giboss.pixnet.net/blog/post/26807628>" %}

#### Administrative Distance (AD) 管理距離：

{% embed url="<https://www.jannet.hk/zh-Hant/post/administrative-distance-ad/>" %}

![模式切換](/files/-MJPgLOtl36ecYFRqFuh)

* **User Mode：一般使用者模式**
* **Priviledged Mode：特權模式**
* **Config Mode：設定模式**

## 課堂練習

### 設定Router ( R2 與 R1 設定相同 )

![](/files/-MIRuf4LLGOa-39rRVqj)

![](/files/-MIRuh_12lREJNcGFzhi)

![](/files/-MIRujwBXrYf7CyoHqgW)

![](/files/-MIRum8ByFA3bJqM4-SZ)

![](/files/-MIRuqeIA_WJVaKS5OHX)

> 進入特權模式

```
enable
```

![](/files/-MIRusYxFaqCxWu98is8)

![](/files/-MIRutxe8rmgGe0vt2FW)

> 進入設定模式

```
conf t
```

![](/files/-MIRuwCOxjYChJsZlyhk)

設定路由名稱

{% tabs %}
{% tab title="R1" %}

```
hostname R1
```

![](/files/-MIRuyWuRSTUJOsJLeFU)
{% endtab %}

{% tab title="R2" %}

```
hostname R2
```

{% endtab %}
{% endtabs %}

> 離開超級模式

```
^Z
```

![](/files/-MIRv-_feJOvoNBT5FqN)

{% hint style="info" %}

#### `^Z：ctrl + z`

{% endhint %}

> 寫入快取

```
writ

// write memory
```

![](/files/-MIRv1bigfeRJdOgCuXG)

> 進入介面進行設定

```
int e0/0
```

> 避免進行關機作業

```
no shutdown
```

![](/files/-MIRv4M6FGTL-JzGwjs7)

{% tabs %}
{% tab title="R1" %}

> 設定 R1&#x20;

```
ip addr 12.1.1.1 255.255.255.0
```

> 取消 R1 IP

```
no ip addr 12.1.1.1 255.255.255.0
```

{% hint style="danger" %}
IP 前面加個 no 同等取消 IP
{% endhint %}

> 顯示每一個路由器的 IP 位置資訊

```
show ip int brief
```

![新增 R1 IP](/files/-MJ0-5-u8_lqVfPSLM-Q)

![取消 R1 IP](/files/-MJxFZnBCaCq4OSdVvcE)

> R1 ping R2

```
ping 12.1.1.2
```

{% endtab %}

{% tab title="R2" %}

> 設定 R2

```
ip addr 12.1.1.2 255.255.255.0
```

> 取消R2 IP

```
no ip addr 12.1.1.2 255.255.255.0
```

{% hint style="danger" %}
IP 前面加個 no 同等取消 IP
{% endhint %}

> 顯示每一個路由器的 IP 位置資訊

```
show ip int brief
```

![](/files/-MJ0-99yhuVdN4GPEdY6)

![](/files/-MJxGHHqytsLgdHeOVFz)

> R2 ping R1

```
ping 12.1.1.1
```

{% endtab %}
{% endtabs %}

#### 設定enable 密碼

> 設定密碼

```
enable password [密碼]
```

![](/files/-MJx7f9GG5U33-fyxWOH)

> 登入enable

![](/files/-MJx8JPxcSxlSPnXt3QV)

{% hint style="warning" %}
在離開特權模式並重新登入後，需輸入enable 密碼進行登入
{% endhint %}

#### 設定輔助密碼(aux)

{% hint style="success" %}
允許使用Console線以Telnet方式登入
{% endhint %}

>

```
line aux 0
```

> 設定密碼

```
password [密碼]
```

> 登入

```
login
```

>

```
transport input telnet
```

![](/files/-MJxCQ4AmnNvkg0uEbiI)

>

```
show run
```

![](/files/-MJxBmR-HQMT79jnt0MP)

![](/files/-MJxCxkKqyMkuByCF5lf)

#### VPC

> 新增VPC節點

![](/files/-MJxHiYfviqsMpp81kN0)

> 進入 e0/1 介面

```
int e0/1
```

> 新增 e0/1 IP&#x20;

```
ip addr 192.168.1.1 255.255.255.0
```

>

```
no shutdown
```

> 查詢已設置IP

```
do sh ip int brief
```

{% hint style="danger" %}
設定模式下若要查詢 IP，在 show 之前加上 do 即可
{% endhint %}

> 新增 VPC IP

```
ip dhcp
```

> 查詢

```
sh ip
```

> ping

```
ping 192.168.1.1

ping 12.1.1.2

ping 12.1.1.1
```

![](/files/-MJxOok-SJBAgPD8wbeB)

#### R1、R2

> 特權模式下 debug ip

```
debug ip icmp
```

![](/files/-MK0Q7u18dNT8KDfcLUT)

![](/files/-MK0PQaVv5_gqwZtv5Ff)

{% tabs %}
{% tab title="R1" %}

#### 查詢路由IP

```
ip route ?
```

>

```
ip route 2.2.2.2 255.255.255.255 12.1.1.2
```

>

```
ip route 3.3.3.3 255.255.255.255 12.1.1.2
```

>

```
ip route 192.168.1.0 255.255.255.0 12.1.1.2
```

>

```
do ping 2.2.2.2
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://anida-huang.gitbook.io/computer-network/qi-zhong/20200930-introduction-router-setting.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.
