> 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-mo/20201230-cisco-stp.md).

# 20201230 cisco STP

## 課堂資料

{% embed url="<https://www.jannet.hk/zh-Hant/post/spanning-tree-protocol-stp/>" %}

{% embed url="<https://www.jannet.hk/zh-Hant/post/etherchannel-pagp-lacp/>" %}

{% embed url="<https://www.jannet.hk/zh-Hant/post/authentication-authorization-accounting-aaa/>" %}

{% embed url="<https://www.twblogs.net/a/5c220b1bbd9eee16b4a769ce>" %}

{% file src="/files/-MPlD\_kh1uZROUdv09lM" %}

### FDB

![](/files/-MPlJ3YsPyif0XvMyl6x)

### Spanning Tree Steps

* **Find the Root Bridge**
  * 最小：priority ( 可手動設定，預設值&#x70BA;**`32768 + Vlan ID`**) + MAC address
* **Find the Root Port**

![](/files/-MPlL-7Ia3c27EtCuSuO)

* **Find the Designated Port ( D Port )**

![](/files/-MPlL733m8U-MtIhhhrt)

### AAA Tacacs

![](/files/-MPlVacvlXWK2creMSMG)

## 課堂練習

### STP

![](/files/-MPlSOOSlnTgT7ZawMnT)

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

```
do sh spanning-tree
```

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

{% tab title="sw2" %}

```
do sh spanning-tree
```

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

{% tab title="sw3" %}

```
do sh spanning-tree
```

![](/files/-MPlQ6VycFlUnrQZ9vyT)

{% endtab %}

{% tab title="VPC4" %}

```
ip 192.168.1.1 255.255.255.0
```

![](/files/-MPlQVIZwiNWvEfTl8mw)

```
ping 192.168.1.2
```

{% endtab %}

{% tab title="VPC5" %}

```
ip 192.168.1.2 255.255.255.0
```

![](/files/-MPlQaSLI7ItUxCjQa25)

```
ping 192.168.1.1
```

{% endtab %}
{% endtabs %}

### Ether Channel

###

![](/files/-MPlTrshnkKK-0HNkwpf)

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

```
int range e0/0 - 1
```

```
channel-group 1 mode on
```

```
do sh etherchannel summary
```

![](/files/-MPlUKbZQqZKOS7Qy9IU)

```
do sh spanning-tree
```

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

{% tab title="sw7" %}

```
int range e0/0 - 1
```

```
shut
```

```
channel-group 1 mode on
```

```
no shut
```

```
do sh etherchannel summary
```

![](/files/-MPlUhdSwEHZhR_pnZJC)

```
do sh spanning-tree
```

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

### AAA Tacacs

#### Part 01.

![](/files/-MPlXNHTfUPtP5FNhqkX)

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

```
wget ftp://ftp.shrubbery.net/pub/tac_plus/tacacs-F4.0.4.28.tar.gz
```

![](/files/-MPlY6OhkC00B3ggeahW)

```
tar zxvf tacacs-F4.0.4.28.tar.gz
```

![](/files/-MPlYt0T29gmBKsKrsPB)

```
cd tacacs-F4.0.4.28
```

```
./configure
```

![](/files/-MPlZAL63pQYZ6y7sGDw)

```
apt install bison
```

```
apt install bison --fix-missing
```

```
apt install libwrap0-dev
```

```
./configure
```

```
make install 
```

![](/files/-MPlbiA9DLxQbZwdfRDs)

```
gedit /etc/ld.so.conf
```

{% hint style="info" %}

#### ld.so.conf

```
include /etc/ld.so.conf.d/*.conf
/usr/lib
```

{% endhint %}
{% endtab %}
{% endtabs %}

#### Part 02.

![](/files/-MPldPcV0_A49Z0zLmVP)

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

```
ip addr add 192.168.1.2/24 brd + dev eth0
```

```
ping 192.168.1.1
```

![](/files/-MPlnpn09g2uSTt3Xsjb)

> #### 新增 user

```
useradd anida
```

```
passwd anida
```

> #### 安裝 tac plus

```
./tac_pwd
```

```
gedit tac_plus.conf
```

{% hint style="info" %}

#### tac\_plus.conf

```
key = ccie

accounting file = /var/log/tac.acct

user = user {
    member = user5
    login = des aerYSwBGbhIlo
}
group = user5 {
    service = exec {
        priv-lvl = 5
    }
}
```

{% endhint %}

![](/files/-MQDAagzoZgaPj0vmYt6)

> #### 執行 tacacs+ server

```
./tac_plus -C ./tac_plus.conf -G
```

{% endtab %}

{% tab title="R2" %}

```
int e0/0
```

```
ip add 23.1.1.2 255.255.255.0
```

```
no shut
```

```
exit
```

> #### 啟動 AAA New-Model

```
aaa new-model
```

> #### 設定 TACACS+ 資料

```
tacacs server TACACS-SERVER
```

```
add ipv4 192.168.1.2
```

```
key ccie
```

```
exit
```

![](/files/-MPllvyJ3uyWFgfcMmT4)

> #### 設定 Authentication

```
aaa authentication login List_Login group tacacs+ local
```

```
line console 0 
```

```
login authentication List_Login
```

```
line vty 0 4
```

```
login authentication List_Login
```

```
aaa authentication enable default group tacacs+ enable
```

![](/files/-MPlm5PciY8Rr30vD3Tz)

> #### 設定 Authorization

```
aaa authorization exec List_Priv group tacacs+ local
```

```
line console 0 
```

```
authorization exec List_Priv
```

```
exit
```

```
aaa authorization console
```

```
line vty 0 4
```

```
authorization exec List_Priv
```

![](/files/-MPlmi-Afhdzj5GOXSeK)

> #### 設定 Accounting

```
line console 0 
```

```
accounting exec List_Acc
```

```
accounting commands 5 List_Comm_5
```

```
accounting commands 10 List_Comm_10
```

```
accounting commands 15 List_Comm_15
```

```
line vty 0 4
```

```
accounting exec List_Acc
```

```
accounting commands 5 List_Comm_5
```

```
accounting commands 10 List_Comm_10
```

```
accounting commands 15 List_Comm_15
```

![](/files/-MPln918-n1Tg9Zyr1Hs)

```
do telnet 23.1.1.3
```

{% endtab %}

{% tab title="R3" %}

```
int e0/0
```

```
ip add 23.1.1.3 255.255.255.0
```

```
no shut
```

```
int e0/1
```

```
ip add 192.168.1.1 255.255.255.0
```

```
no shut
```

![](/files/-MPln_-GF-BEqzgRbW6P)
{% endtab %}
{% endtabs %}
