diff --git "a/45 \345\210\230\350\213\217\350\220\214/20240510_\344\270\211\345\261\202\344\272\244\346\215\242\346\234\272.md" "b/45 \345\210\230\350\213\217\350\220\214/20240510_\344\270\211\345\261\202\344\272\244\346\215\242\346\234\272.md" index dc884220d50f1566cbeaa2b26f067c3607fd5df7..933d3a25f0945d4c41feaa283e9cdcf3980c3e1c 100644 --- "a/45 \345\210\230\350\213\217\350\220\214/20240510_\344\270\211\345\261\202\344\272\244\346\215\242\346\234\272.md" +++ "b/45 \345\210\230\350\213\217\350\220\214/20240510_\344\270\211\345\261\202\344\272\244\346\215\242\346\234\272.md" @@ -60,14 +60,11 @@ SW1(config-if)#ip add 192.168.1.254 255.255.255.0 SW1(config-if)#int vlan 200 SW1(config-if)#ip add 192.168.2.254 255.255.255.0 - SW1(config-if)#int fa0/3 - SW1(config-if)#sw trunk encapsulation dot1q //将trunk模式先封装成dot1q协议模式 - SW1(config-if)#sw mode trunk //启用为trunk模式 + //不同网络可以不用设trunk模式 + //SW1(config-if)#int fa0/3 + //SW1(config-if)#sw trunk encapsulation dot1q //将trunk模式先封装成dot1q协议模式 + //SW1(config-if)#sw mode trunk //启用为trunk模式 SW1(config)#ip routing - SW1(config)#route rip - SW1(config-router)#v 2 - SW1(config-router)#network 192.168.1.0 - SW1(config-router)#network 192.168.2.0 SW1(config-if)#int fa 0/3 SW1(config-if)#no switch //开启三层交换机 SW1(config-if)#ip add 192.168.10.1 255.255.255.0 @@ -77,7 +74,7 @@ SW1(config-router)#net 192.168.2.0 0.0.0.255 area 0 SW1(config-router)#net 192.168.10.0 0.0.0.255 area 0 ``` - + - SW2 ```c# @@ -95,9 +92,10 @@ SW2(config-if)#ip add 192.168.3.254 255.255.255.0 SW2(config-if)#int vlan 200 SW2(config-if)#ip add 192.168.4.254 255.255.255.0 - SW2(config-if)#int fa 0/3 - SW2(config-if)#sw trunk encapsulation dot1q //将trunk模式先封装成dot1q协议模式 - SW2(config-if)#sw mode trunk //启用为trunk模式 + //不同网络可以不用设trunk模式 + //SW2(config-if)#int fa 0/3 + //SW2(config-if)#sw trunk encapsulation dot1q //将trunk模式先封装成dot1q协议模式 + //(config-if)#sw mode trunk //启用为trunk模式 SW2(config)#int fa 0/3 SW2(config-if)#no switch //开启三层交换机 SW2(config-if)#ip add 192.168.10.2 255.255.255.0 @@ -112,7 +110,7 @@ SW2(config-router)#network 192.168.20.0 0.0.0.255 area 0 ``` -- R1 +- R1 单臂路由配置 ```c# Router>en diff --git "a/45 \345\210\230\350\213\217\350\220\214/20240511_ \347\273\203\344\271\240&\344\275\234\344\270\232.md" "b/45 \345\210\230\350\213\217\350\220\214/20240511_ \347\273\203\344\271\240&\344\275\234\344\270\232.md" new file mode 100644 index 0000000000000000000000000000000000000000..596475ea5e50db9f876589e11a00cf7de2d050bd --- /dev/null +++ "b/45 \345\210\230\350\213\217\350\220\214/20240511_ \347\273\203\344\271\240&\344\275\234\344\270\232.md" @@ -0,0 +1,74 @@ +#### 练习1: + +![20240511_练习1](./imgs/20240511_练习1.png) + +- SW1 + + ```c# + Switch>en + Switch#conf t + Enter configuration commands, one per line. End with CNTL/Z. + Switch(config)#host SW1 + SW1(config)#int fa 0/1 + SW1(config-if)#sw mode trunk + SW1(config-if)#int fa 0/2 + SW1(config-if)#sw acc vlan 100 + % Access VLAN does not exist. Creating vlan 100 + SW1(config-if)#int fa 0/3 + SW1(config-if)#sw acc vlan 200 + % Access VLAN does not exist. Creating vlan 200 + ``` + +- SW2 + +```c# +Switch>en +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#host SW2 +SW2(config)#ip routing +SW2(config)#int fa 0/1 +SW2(config-if)#vlan 100 +SW2(config-vlan)#int vlan 100 +SW2(config-if)#ip add 192.168.1.254 255.255.255.0 +SW2(config-if)#vlan 200 +SW2(config-vlan)#int vlan 200 +SW2(config-if)#ip add 192.168.2.254 255.255.255.0 +SW2(config-if)#int fa 0/2 //将pc +SW2(config-if)#sw acc vlan 100 +``` + +- 终端显示 + + ![20240511_练习1终端显示](./imgs/20240511_练习1终端显示.png) + + + +#### 练习2:改错 + +![20240511_练习2改错](./imgs/20240511_练习2改错.png) + +![20240511_练习2](./imgs/20240511_练习2.png) + +```c# +R1>en +R1#conf t +R1(config)#do show run +R1(config-subif)#int g 0/1.10 +R1(config-subif)#no encapsulation dot1Q 30 +R1(config-subif)#int g 0/1.30 +R1(config-subif)#no encapsulation dot1Q 10 +R1(config-subif)#int g 0/1.10 +R1(config-subif)#encapsulation dot1Q 10 +R1(config-subif)#ip add 172.17.10.1 255.255.255.0 +R1(config-subif)#no shut +R1(config-subif)#int g 0/1.30 +R1(config-subif)#encapsulation dot1Q 30 +R1(config-subif)#ip add 172.17.30.1 255.255.255.0 +R1(config-subif)#no shut +``` + +- 终端显示 + + ![20240511_练习2终端显示](./imgs/20240511_练习2终端显示.png) + diff --git "a/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2401.png" "b/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2401.png" new file mode 100644 index 0000000000000000000000000000000000000000..d8a970c19367287555f927ef9349dbe89b1b9249 Binary files /dev/null and "b/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2401.png" differ diff --git "a/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2401\347\273\210\347\253\257\346\230\276\347\244\272.png" "b/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2401\347\273\210\347\253\257\346\230\276\347\244\272.png" new file mode 100644 index 0000000000000000000000000000000000000000..cdcd37f138c7eaacf876bdb756bdfdd6dab6a21d Binary files /dev/null and "b/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2401\347\273\210\347\253\257\346\230\276\347\244\272.png" differ diff --git "a/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2402.png" "b/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2402.png" new file mode 100644 index 0000000000000000000000000000000000000000..19e360e7e10c01844776f214c882c3b14fb4ec21 Binary files /dev/null and "b/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2402.png" differ diff --git "a/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2402\346\224\271\351\224\231.png" "b/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2402\346\224\271\351\224\231.png" new file mode 100644 index 0000000000000000000000000000000000000000..960847c8d0b86e644cc24a64da3cceb6a20d770a Binary files /dev/null and "b/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2402\346\224\271\351\224\231.png" differ diff --git "a/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2402\347\273\210\347\253\257\346\230\276\347\244\272.png" "b/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2402\347\273\210\347\253\257\346\230\276\347\244\272.png" new file mode 100644 index 0000000000000000000000000000000000000000..3c02703fbf56344213f10f39b2b716d8cc72244e Binary files /dev/null and "b/45 \345\210\230\350\213\217\350\220\214/imgs/20240511_\347\273\203\344\271\2402\347\273\210\347\253\257\346\230\276\347\244\272.png" differ