> 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/cisco-eigrp.md).

# 20201104 cisco EIGRP (一)

## 課堂資料

#### Enhanced Interior Gateway Routing Protocol  ( EIGRP ) 增強型內部網關路由協定：

{% embed url="<https://www.jannet.hk/en/post/enhanced-interior-gateway-routing-protocol-eigrp/>" %}

#### EIGRP 設定：

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

### CSICO EIGRP&#x20;

> **Enhanced Interior Gateway Routing Protocol**&#x20;

* 採用 DUAL Algorithm`show ip route`
* 高級 ( Advanced ) 的 DV ( Distance Vector ) or Mixed
* IP header protocol：88

|          協定         | protocol 值 |
| :-----------------: | :--------: |
| ICMP ( 網際網路控制訊息協定 ) |      1     |
|    TCP ( 傳輸控制協定 )   |      6     |
|   UDP ( 用戶資料報協定 )   |     17     |
|  EIGRP ( 混合型路由協定 )  |     88     |

* VLSM ( Variable Length Subnet Mask ) and CIDR ( Classless Inter Domain Routing )
* AD ( 動態距離：Administration Distance ) = 90

|           協定          | AD值 |
| :-------------------: | :-: |
| Static Route ( 靜態路由 ) |  1  |
|   EIGRP ( 混合型路由協定 )   |  90 |
|   OSPF ( 鏈路狀態路由協定 )   | 110 |
|     RIP ( 路由資訊協定 )    | 120 |

* metrics ( 指標 )：BW ( 帶寬：BandWidth )、Delay ( 延時 )、Load ( 加載 )、Reliabily ( 可靠性 )、MTU ( 最大傳輸單元：Maximum Transmission Unit )
* trigger update：224.0.0.10 (增量更新，可靠更新：Reliabily update)
  * RIPv1：255.255.255.255
  * RIPv2：224.0.0.9

#### 補充

| 封包類型   | 作用                   |
| ------ | -------------------- |
| Hello  | 用於建立和維持 Neighborhood |
| Update | 用於傳送路由條目             |
| Ack    | 用於實現可靠傳輸             |
| Query  | 用於路由丟失時，向鄰居發送路由請求    |
| Reply  | 收到路由請求，給予回覆          |

> EIGRP有三張表：
>
> 1. 鄰居表 ( neighbor table )
> 2. 拓樸表 ( protocol table )
> 3. 路由表 ( routing table )

## 課堂練習

### Neighbor

![](/files/-MLNS6vF6lF5HOcact5U)

#### IP 設定

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

```
conf t
```

```
hostname R1
```

```
do writ
```

```
int e0/0
```

```
ip addr 192.168.12.1 255.255.255.0
```

```
no shut
```

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

{% tab title="R2" %}

```
conf t
```

```
hostname R2
```

```
do writ
```

```
int e0/0
```

```
ip addr 192.168.12.2 255.255.255.0
```

```
no shut
```

```
exit
```

```
int e0/1
```

```
ip addr 192.168.23.2 255.255.255.0
```

```
no shut
```

{% endtab %}

{% tab title="R3" %}

```
conf t
```

```
hostname R3
```

```
do writ
```

```
int e0/0
```

```
ip addr 192.168.23.3 255.255.255.0
```

```
no shut
```

![](/files/-MLNjhZcEpI4Hy-H4a08)
{% endtab %}
{% endtabs %}

#### Route 設定

{% hint style="success" %}
使&#x7528;**`router eigrp [AS No.]`**&#x9032;入EIGRP設定，在同一個 AS內的EIGRP router，所有的AS Number必須相同。
{% endhint %}

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

```
router eigrp [AS No.]
```

```
auto-summary
```

```
network 192.168.12.0 0.0.0.255
```

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

{% tab title="R2" %}

```
router eigrp [AS No.]
```

```
auto-summary
```

```
network 192.168.12.0 0.0.0.255
```

```
network 192.168.23.0 0.0.0.255
```

![](/files/-MLNa-O-bkL2wtw9F9sn)
{% endtab %}

{% tab title="R3" %}

```
router eigrp [AS No.]
```

```
auto-summary
```

```
network 192.168.23.0 0.0.0.255
```

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

```
do sh ip eigrp nei
```

```
do sh ip eigrp topology
```

```
do sh ip ro eigrp
```

{% tabs %}
{% tab title="R1" %}
![](/files/-MLNnBKSpe0Le8uP7PBf)
{% endtab %}

{% tab title="R2" %}
![](/files/-MLNlvS7jRL7Hs87Yl3X)
{% endtab %}

{% tab title="R3" %}
![](/files/-MLNmO2jhQ0iXcBbCrUl)
{% endtab %}
{% endtabs %}

{% hint style="success" %}
預設情況下，Router 之間是利用 Multicast 溝通的。

如果網路不支援 Multicast 或因某些原因 Multicast 無法順利傳送，Router 就無法成為 Neighbor。

遇到這些情況，我們使用Neighbor指令利用Unicast去傳送EIGRP封包。
{% endhint %}

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

```
neighbor 192.168.12.2 e0/0
```

{% endtab %}

{% tab title="R2" %}

```
neighbor 192.168.12.1 e0/1
```

```
do sh ip eigrp neighbors
```

{% hint style="danger" %}
確認有無順利建立Neighbor，可以&#x7528;**`show ip eigrp nieghbors`**&#x6307;令
{% endhint %}
{% endtab %}
{% endtabs %}

#### Holdtime

{% hint style="success" %}
EIGRP 有兩個 Timer，分別是 Hello Timer 及 Hold Timer。

Hello 預設值為 5秒、Hold 預設值為 15秒，也就是說 EIGRP Router 會隔 5秒傳送 Hello Message，如果收到就會維持 Neighbor 關係，反之，一旦超過15秒未收到，則會中斷 Neighbor 關係。

所以Hold Timer會從15秒開始倒數，直到收到Hello後重新計數倒數15秒。

Hello Timer 及 Hold Timer 是可以在interface下更改。
{% endhint %}

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

```
int e0/0
```

```
ip hello-interval eigrp ?
```

```
ip hello-interval eigrp [AS No.] ?
```

```
ip hello-interval eigrp [AS No.] 10
```

```
ip hold-time eigrp ?
```

```
ip hold-time eigrp [AS No.] ?
```

```
ip hold-time eigrp [AS No.] 30
```

```
^z
```

{% endtab %}
{% endtabs %}

{% hint style="danger" %}
切記，兩隻成為 Neighbor 也要更改。
{% endhint %}

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

```
clear ip eigrp [AS No.] nei
```

```
sh ip eigrp nei
```

{% endtab %}
{% endtabs %}

#### Authentication

{% hint style="success" %}
在 EIGRP Neighbor 的 interface 之間設定密碼，這樣可以避免有 Router 假扮成 Neighbor 來偷取 Router 資訊。
{% endhint %}

```
conf t
```

```
key chain MyChain
```

```
key 1
```

```
key-string MyPassword
```

```
exit
```

```
exit
```

{% tabs %}
{% tab title="R1" %}
![](/files/-MLO3qNCJovpZQUNDVDn)
{% endtab %}

{% tab title="R2" %}
![](/files/-MLO4gctYanzIOjRippy)
{% endtab %}
{% endtabs %}

{% hint style="success" %}
在interface 設定 Key Chain 和 MD5 encryption
{% endhint %}

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

```
int e0/0
```

```
ip authentication key-chain eigrp [AS No.] MyChain
```

```
ip authentication mode eigrp [AS No.] md5
```

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

{% tab title="R2" %}

```
int e0/1
```

```
ip authentication key-chain eigrp [AS No.] MyChain
```

```
ip authentication mode eigrp [AS No.] md5
```

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

{% hint style="success" %}
用`sh ip eigrp int detail` 可以查看Authentication 資訊
{% endhint %}

```
do sh ip eigrp int detail
```

{% tabs %}
{% tab title="R1" %}
![](/files/-MLO4KADT-aQvMUtX6-r)
{% endtab %}

{% tab title="R2" %}
![](/files/-MLO57wU1lyk8Rg6zLKq)
{% endtab %}
{% endtabs %}

## 期中練習

{% tabs %}
{% tab title="01." %}

## 題目：

![](/files/-MLMNmBYhHGo3SAJq21O)

## 結果：

![](/files/-MLXiy0iElOkXS4EhWAE)

![](/files/-MLXjDL2iiTZaNsa9Iym)

![](/files/-MLXjKXXQmG7RIMSE26J)

> ## R1

```
int e0/0
```

```
ip add 12.1.1.1 255.255.255.0
```

```
no shut
```

```
int e0/1
```

```
ip add 45.1.1.1 255.255.255.0
```

```
no shut
```

```
int e0/2
```

```
ip add 192.168.1.1 255.255.255.0
```

```
no shut
```

![](/files/-MLXK0gACYaOZSbS6PWl)

```
ip route 192.168.2.0 255.255.255.0 e0/0 12.1.1.2
```

```
ip route 192.168.2.0 255.255.255.0 e0/1 45.1.1.3 10
```

![](/files/-MLXij3x4mbP_cvh64IW)

> ## R2

```
int e0/0
```

```
ip add 12.1.1.2 255.255.255.0
```

```
no shut
```

```
int e0/1
```

```
ip add 23.1.1.2 255.255.255.0
```

```
no shut
```

```
int e0/2
```

```
ip add 192.168.2.1 255.255.255.0
```

```
no shut
```

![](/files/-MLXKl6f8QOAbncQs15i)

```
ip route 192.168.1.0 255.255.255.0 e0/0 12.1.1.1 10
```

```
ip route 192.168.1.0 255.255.255.0 e0/1 23.1.1.4
```

![](/files/-MLXk3w72dX7Gj37536w)

> ## R3

```
int e0/0
```

```
ip add 34.1.1.3 255.255.255.0
```

```
no shut
```

```
int e0/1
```

```
ip add 45.1.1.3 255.255.255.0
```

```
no shut
```

![](/files/-MLXLSbu_0AgKmBUp5Fi)

```
ip route 192.168.1.0 255.255.255.0 e0/1 45.1.1.1
```

![](/files/-MLXkp8aaidPLUbAdg61)

> ## R4

```
int e0/0
```

```
ip add 34.1.1.4 255.255.255.0
```

```
no shut
```

```
int e0/1
```

```
ip add 23.1.1.4 255.255.255.0
```

```
no shut
```

![](/files/-MLXMVQQX0a3K-Hnmhti)

```
ip route 192.168.1.0 255.255.255.0 e0/0 34.1.1.3
```

![](/files/-MLXlfLm9OPtad1l2HuA)

> ## VPC1

```
ip 192.168.1.2 255.255.0.0
```

![](/files/-MLXLlZU3qjg9yW0NdsQ)

> ## VPC2

```
ip 192.168.2.2 255.255.0.0
```

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

{% tab title="02." %}

## 題目：

![](/files/-MLMj9b-6WICccweWIzM)

## 結果：

![](/files/-MLWr-exCU98jSz86GkD)

> ## R1

```
hostname R1
```

```
do writ
```

```
int e0/0
```

```
ip addr 12.1.1.1 255.255.255.0
```

```
no shut
```

```
int e0/1
```

```
ip addr 192.168.1.1 255.255.255.0
```

```
no shut
```

![](/files/-MLWk8mZy20X9pYFEjn4)

```
exit
```

```
ip dhcp pool DHCP
```

```
network 192.168.1.0 /24
```

```
default-router 192.168.1.1
```

```
dns-server 8.8.8.8
```

![](/files/-MLWq2UnUCLNMQuS8LOs)

> ### VPC 1

```
ip dhcp
```

![](/files/-MLWqk_WHBZWWlj8VL7B)

```
ping 192.168.2.2
```

> ## R2

```
hostname R2
```

```
do writ
```

```
int e0/0
```

```
ip addr 12.1.1.2 255.255.255.0
```

```
no shut
```

```
int e0/1
```

```
ip addr 192.168.2.1 255.255.255.0
```

```
no shut
```

![](/files/-MLWo_pCI_mPOfLqr0CT)

```
exit
```

```
ip dhcp pool DHCP2
```

```
network 192.168.2.0 /24
```

```
default-router 192.168.2.1
```

```
dns-server 8.8.8.8
```

![](/files/-MLWqLo5jHpDuh3tJ2b4)

> ### VPC 2

```
ip dhcp
```

![](/files/-MLWqrbUY081IAP69Zo6)

```
ping 192.168.1.2
```

{% endtab %}

{% tab title="03." %}

## 題目：

![](/files/-MLMPThbnBPKAZweaNvc)

## 結果：

![](/files/-MLX80xWdqfgO8RsAEvi)

> ## R1

```
int e0/0
```

```
ip addr 12.1.1.1 255.255.255.0
```

```
no shut
```

```
int e0/1
```

```
ip addr 45.1.1.1 255.255.255.0
```

```
no shut
```

```
int e0/2
```

```
ip addr 192.168.1.1 255.255.255.0
```

```
no shut
```

```
int lo 0
```

```
ip addr 1.1.1.1 255.255.255.255
```

```
no shut
```

```
exit
```

```
router rip
```

```
ver 2
```

```
no auto-summary
```

```
network 12.1.1.0
```

```
network 45.1.1.0
```

```
network 1.1.1.0
```

```
network 192.168.1.0
```

```
do sh run
```

![](/files/-MLX271vNioDrLBVzPaa)

> ## R2

```
int e0/0
```

```
ip addr 12.1.1.2 255.255.255.0
```

```
no shut
```

```
int e0/1
```

```
ip addr 23.1.1.2 255.255.255.0
```

```
no shut
```

```
int lo 0
```

```
ip addr 2.2.2.2 255.255.255.255
```

```
no shut
```

```
exit
```

```
router rip
```

```
ver 2
```

```
no auto-summary
```

```
network 12.1.1.0
```

```
network 23.1.1.0
```

```
network 2.2.2.0
```

```
do sh run
```

![](/files/-MLX0fxgJd7c1nH3ZP7X)

> ## R3

```
int e0/0
```

```
ip addr 34.1.1.3 255.255.255.0
```

```
no shut
```

```
int e0/1
```

```
ip addr 45.1.1.3 255.255.255.0
```

```
no shut
```

```
int lo 0
```

```
ip addr 3.3.3.3 255.255.255.255
```

```
no shut
```

```
exit
```

```
router rip
```

```
ver 2
```

```
no auto-summary
```

```
network 34.1.1.0
```

```
network 45.1.1.0
```

```
network 3.3.3.0
```

```
do sh run
```

![](/files/-MLX44Iq_HVgLrS6b8me)

> ## R4

```
int e0/0
```

```
ip addr 34.1.1.4 255.255.255.0
```

```
no shut
```

```
int e0/1
```

```
ip addr 23.1.1.4 255.255.255.0
```

```
no shut
```

```
int e0/2
```

```
ip addr 192.168.2.1 255.255.255.0
```

```
no shut
```

```
int lo 0
```

```
ip addr 4.4.4.4 255.255.255.255
```

```
no shut
```

```
exit
```

```
router rip
```

```
ver 2
```

```
no auto-summary
```

```
network 23.1.1.0
```

```
network 34.1.1.0
```

```
network 4.4.4.0
```

```
network 192.168.2.0
```

```
do sh run
```

> ## VPC 1

```
ip 192.168.1.2 255.255.0.0
```

![](/files/-MLX7bvuZj91I-Tp0vUa)

```
ping 192.168.2.2
```

> ## VPC 2

```
ip 192.168.2.2 255.255.0.0
```

![](/files/-MLX7inimzNQ09QyY8Rp)

```
ping 192.168.1.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/cisco-eigrp.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.
