# 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

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLNRqWCuLhldqiUJbvE%2F-MLNS6vF6lF5HOcact5U%2Fimage.png?alt=media\&token=9b0115fb-780d-47a4-824d-4fbdecdfd55f)

#### 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLNZIa_Lo96VruCB0Tl%2F-MLNZPdUCeRh0rMZ-gGi%2Fimage.png?alt=media\&token=d5c95da6-4845-4c20-afa7-285056dc7c60)
{% 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLNfXmWUjgk4YgEVlB1%2F-MLNjhZcEpI4Hy-H4a08%2Fimage.png?alt=media\&token=41af36a0-5a7c-4645-99c4-20304f72f851)
{% 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLNRqWCuLhldqiUJbvE%2F-MLNTdS63F7yk5dMihXX%2Fimage.png?alt=media\&token=0c7e6417-62b5-4c2a-b662-54641065fb46)
{% 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLNZIa_Lo96VruCB0Tl%2F-MLNa-O-bkL2wtw9F9sn%2Fimage.png?alt=media\&token=03ced1e8-02be-41e9-ab8f-baba54e10051)
{% endtab %}

{% tab title="R3" %}

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

```
auto-summary
```

```
network 192.168.23.0 0.0.0.255
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLNfXmWUjgk4YgEVlB1%2F-MLNjqjqs3wY88qfz_6n%2Fimage.png?alt=media\&token=5e855778-f317-42d2-9e1b-117daa61a5ec)
{% endtab %}
{% endtabs %}

```
do sh ip eigrp nei
```

```
do sh ip eigrp topology
```

```
do sh ip ro eigrp
```

{% tabs %}
{% tab title="R1" %}
![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLNfXmWUjgk4YgEVlB1%2F-MLNnBKSpe0Le8uP7PBf%2Fimage.png?alt=media\&token=cc6edcbc-cb69-47af-8209-5f44c9630a9e)
{% endtab %}

{% tab title="R2" %}
![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLNfXmWUjgk4YgEVlB1%2F-MLNlvS7jRL7Hs87Yl3X%2Fimage.png?alt=media\&token=fab51f67-6b16-4416-99e7-3f85de4e57bd)
{% endtab %}

{% tab title="R3" %}
![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLNfXmWUjgk4YgEVlB1%2F-MLNmO2jhQ0iXcBbCrUl%2Fimage.png?alt=media\&token=b194470c-8d87-432d-be0e-7683bb41d0e0)
{% 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" %}
![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLO3VHzXBq1c4cw_zZm%2F-MLO3qNCJovpZQUNDVDn%2Fimage.png?alt=media\&token=9955f66c-d404-4873-b6b8-df7a85364775)
{% endtab %}

{% tab title="R2" %}
![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLO3VHzXBq1c4cw_zZm%2F-MLO4gctYanzIOjRippy%2Fimage.png?alt=media\&token=ffff9064-93a7-464b-863e-39e4c6dfa647)
{% 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLO3VHzXBq1c4cw_zZm%2F-MLO46x7ixtkszs_4b8C%2Fimage.png?alt=media\&token=3dd4d737-5370-40e9-8cbb-d2215f1fcbaf)
{% endtab %}

{% tab title="R2" %}

```
int e0/1
```

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

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

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLO3VHzXBq1c4cw_zZm%2F-MLO4ryOkyeLrodfygCz%2Fimage.png?alt=media\&token=7ebeffb1-5f6a-4b72-bd38-575456e6363d)
{% endtab %}
{% endtabs %}

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

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

{% tabs %}
{% tab title="R1" %}
![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLO3VHzXBq1c4cw_zZm%2F-MLO4KADT-aQvMUtX6-r%2Fimage.png?alt=media\&token=aacc4029-aca5-4612-93cf-ea4f2010430f)
{% endtab %}

{% tab title="R2" %}
![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLO3VHzXBq1c4cw_zZm%2F-MLO57wU1lyk8Rg6zLKq%2Fimage.png?alt=media\&token=b56e06af-c576-4ca0-bc45-bf75dfb23fc4)
{% endtab %}
{% endtabs %}

## 期中練習

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

## 題目：

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLMGz2oZ2b-08BSg2MI%2F-MLMNmBYhHGo3SAJq21O%2F%E6%9C%9F%E4%B8%AD%E8%80%83%E9%A1%8C%20-%20Part%2001.jpg?alt=media\&token=a09a0d3e-bc7e-49e6-b975-bde1e380344c)

## 結果：

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXMY4oFIttE70iTBXb%2F-MLXiy0iElOkXS4EhWAE%2Fimage.png?alt=media\&token=9149cd32-0eaf-4119-8586-e5d5c27f693c)

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXMY4oFIttE70iTBXb%2F-MLXjDL2iiTZaNsa9Iym%2Fimage.png?alt=media\&token=bca7e6f2-ac3b-45da-899b-dd1021612c49)

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXMY4oFIttE70iTBXb%2F-MLXjKXXQmG7RIMSE26J%2Fimage.png?alt=media\&token=87566eb3-0bbb-41d2-aa7a-60a02567070b)

> ## 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXB1faXkFlzKzkQ6pH%2F-MLXK0gACYaOZSbS6PWl%2Fimage.png?alt=media\&token=28231ee5-4cae-4610-8700-3ba80405a5c1)

```
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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXMY4oFIttE70iTBXb%2F-MLXij3x4mbP_cvh64IW%2Fimage.png?alt=media\&token=e55d70c9-9c67-4e44-99dc-08c0660e23bb)

> ## 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXB1faXkFlzKzkQ6pH%2F-MLXKl6f8QOAbncQs15i%2Fimage.png?alt=media\&token=c41bf648-4b42-49dd-b9b7-ad97c88c5a48)

```
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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXMY4oFIttE70iTBXb%2F-MLXk3w72dX7Gj37536w%2Fimage.png?alt=media\&token=70b3a94f-1875-433d-86cd-f9a32e2412d1)

> ## 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXB1faXkFlzKzkQ6pH%2F-MLXLSbu_0AgKmBUp5Fi%2Fimage.png?alt=media\&token=6c502c15-61ad-4fa6-b1a5-591dfa615f70)

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

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXMY4oFIttE70iTBXb%2F-MLXkp8aaidPLUbAdg61%2Fimage.png?alt=media\&token=61fda611-639c-4d91-b65c-2d488e912cb1)

> ## 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXB1faXkFlzKzkQ6pH%2F-MLXMVQQX0a3K-Hnmhti%2Fimage.png?alt=media\&token=5b6770ee-e333-434e-b23b-0a0b5edd7d0f)

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

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXMY4oFIttE70iTBXb%2F-MLXlfLm9OPtad1l2HuA%2Fimage.png?alt=media\&token=d6700812-004b-41fc-98ee-693a42e6c366)

> ## VPC1

```
ip 192.168.1.2 255.255.0.0
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXB1faXkFlzKzkQ6pH%2F-MLXLlZU3qjg9yW0NdsQ%2Fimage.png?alt=media\&token=640ef244-6157-4209-9ebb-a5efedcab915)

> ## VPC2

```
ip 192.168.2.2 255.255.0.0
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLXB1faXkFlzKzkQ6pH%2F-MLXLy8C5bz2oR6O13Eu%2Fimage.png?alt=media\&token=fb6fc8bb-7df4-420c-ae1f-c0d6776dd10d)
{% endtab %}

{% tab title="02." %}

## 題目：

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLMhl--BBbh1htapfbe%2F-MLMj9b-6WICccweWIzM%2F%E6%9C%9F%E4%B8%AD%E8%80%83%E9%A1%8C%20-%20Part%2002.jpg?alt=media\&token=59f1fee7-9d99-4178-befc-be2313e8824d)

## 結果：

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLWr-exCU98jSz86GkD%2Fimage.png?alt=media\&token=f65221f6-ac72-4b42-9b1b-a754ff3adf93)

> ## 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLWk8mZy20X9pYFEjn4%2Fimage.png?alt=media\&token=df35b548-afc7-4d60-8e3a-2eafe15e380f)

```
exit
```

```
ip dhcp pool DHCP
```

```
network 192.168.1.0 /24
```

```
default-router 192.168.1.1
```

```
dns-server 8.8.8.8
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLWq2UnUCLNMQuS8LOs%2Fimage.png?alt=media\&token=de62891e-48ab-404c-90ae-6153af8b69d1)

> ### VPC 1

```
ip dhcp
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLWqk_WHBZWWlj8VL7B%2Fimage.png?alt=media\&token=02153738-91c1-4531-99e2-642157749257)

```
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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLWo_pCI_mPOfLqr0CT%2Fimage.png?alt=media\&token=9ecdc8db-6d84-4929-9fa2-3374342f2c9e)

```
exit
```

```
ip dhcp pool DHCP2
```

```
network 192.168.2.0 /24
```

```
default-router 192.168.2.1
```

```
dns-server 8.8.8.8
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLWqLo5jHpDuh3tJ2b4%2Fimage.png?alt=media\&token=ae590862-ecac-4dda-8c86-c6813014c01e)

> ### VPC 2

```
ip dhcp
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLWqrbUY081IAP69Zo6%2Fimage.png?alt=media\&token=aae0ce83-7667-42ce-bc77-4bd2651f96dd)

```
ping 192.168.1.2
```

{% endtab %}

{% tab title="03." %}

## 題目：

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLMGz2oZ2b-08BSg2MI%2F-MLMPThbnBPKAZweaNvc%2F%E6%9C%9F%E4%B8%AD%E8%80%83%E9%A1%8C%20-%20Part%2003.jpg?alt=media\&token=a7a694d9-c162-4785-a46b-c1f806f3824d)

## 結果：

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLX80xWdqfgO8RsAEvi%2Fimage.png?alt=media\&token=4e266355-a1f4-436a-9d06-beed816e9bb0)

> ## 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLX271vNioDrLBVzPaa%2Fimage.png?alt=media\&token=8bf9158d-a1a0-4629-9006-95a31048e603)

> ## 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLX0fxgJd7c1nH3ZP7X%2Fimage.png?alt=media\&token=cbe8e3bc-13ba-4ff8-90de-14416dc411fb)

> ## 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLX44Iq_HVgLrS6b8me%2Fimage.png?alt=media\&token=6ea6984c-63c7-43b6-b71b-439c2c89058d)

> ## 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
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLX7bvuZj91I-Tp0vUa%2Fimage.png?alt=media\&token=bdca5f94-ff2e-4b9a-977c-d0b82465052d)

```
ping 192.168.2.2
```

> ## VPC 2

```
ip 192.168.2.2 255.255.0.0
```

![](https://1182807199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MHJUVmIukmM2g9Ai7CY%2F-MLWgcOYl1kf8aUg1X8D%2F-MLX7inimzNQ09QyY8Rp%2Fimage.png?alt=media\&token=2bc9961c-ee45-4447-9bf1-810fa7a2bfce)

```
ping 192.168.1.2
```

{% endtab %}
{% endtabs %}
