From 525989a0770df90e8e46f031a3b8e623b1e7491b Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 13 May 2024 21:27:47 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\347\241\200\357\274\21020\357\274\211.md" | 44 +++++++ ...\347\241\200\357\274\21018\357\274\211.md" | 19 +++ ...\347\241\200\357\274\21019\357\274\211.md" | 122 ++++++++++++++++++ 3 files changed, 185 insertions(+) create mode 100644 "11\347\216\213\351\200\212/2024-05.011\350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21020\357\274\211.md" create mode 100644 "11\347\216\213\351\200\212/2024-05.08 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21018\357\274\211.md" create mode 100644 "11\347\216\213\351\200\212/2024-05.10 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21019\357\274\211.md" diff --git "a/11\347\216\213\351\200\212/2024-05.011\350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21020\357\274\211.md" "b/11\347\216\213\351\200\212/2024-05.011\350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21020\357\274\211.md" new file mode 100644 index 0000000..e335d49 --- /dev/null +++ "b/11\347\216\213\351\200\212/2024-05.011\350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21020\357\274\211.md" @@ -0,0 +1,44 @@ +# 三层交换机 + +```html +1.三层交换机的vlan设置IP,当作网关使用,认的是vlan的id,而不是物理接口 +``` + +### 作业 + +![20240511](images/20240511.PNG) + +```html +交换机: +Switch>en +Switch#conf t +Switch(config)#vlan 10 +Switch(config-vlan)#vlan 20 +Switch(config-vlan)#int f 0/1 +Switch(config-if)#switch access vlan 10 +Switch(config-if)#int f 0/2 +Switch(config-if)#switch access vlan 20 +Switch(config-if)#int f 0/3 +Switch(config-if)#switch mode trunk + +三层交换机: +Switch>en +Switch#conf t +Switch(config)#vlan 10 +Switch(config-vlan)#vlan 20 +Switch(config-if)#int f0/1 +Switch(config-if)#switch access vlan 10 +Switch(config-if)#int f0/2 +Switch(config-if)#switch access vlan 10 +Switch(config-if)#switch access vlan 20 +Switch(config-if)#int vlan 10 +Switch(config-if)#ip add 192.168.1.254 255.255.255.0 +Switch(config-if)#int vlan 20 +Switch(config-if)#ip add 192.168.2.254 255.255.255.0 +Switch(config-if)#ip routing + +``` + +### 改错题 + +![20240511改错题](images/20240511改错题.PNG) diff --git "a/11\347\216\213\351\200\212/2024-05.08 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21018\357\274\211.md" "b/11\347\216\213\351\200\212/2024-05.08 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21018\357\274\211.md" new file mode 100644 index 0000000..95a822d --- /dev/null +++ "b/11\347\216\213\351\200\212/2024-05.08 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21018\357\274\211.md" @@ -0,0 +1,19 @@ +# 交换机端口安全的配置 + +![20240508](images/20240508.PNG) + +```html +Switch>en +Switch#conf t +Switch(config)#int f 0/1 //选择要进行安全配置的端口 +Switch(config-if)#switch mode access +Switch(config-if)#switch port-security //启用交换机要进行的接口安全设置 +Switch(config-if)#switch port-security maximum 1 //设置最大允许连接的终端数量 +Switch(config-if)#switch port-security violation shutdown //设置超过最大连接数的违规设备的处理方式 +Switch(config-if)#switch port-security mac-address sticky //绑定正确的MAC地址 +``` + +```html +Switch#clear port-security sticky //清除交换机记录的MAC地址,重新开始记录 +``` + diff --git "a/11\347\216\213\351\200\212/2024-05.10 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21019\357\274\211.md" "b/11\347\216\213\351\200\212/2024-05.10 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21019\357\274\211.md" new file mode 100644 index 0000000..134ce1a --- /dev/null +++ "b/11\347\216\213\351\200\212/2024-05.10 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21019\357\274\211.md" @@ -0,0 +1,122 @@ +## 三层交换机 + +```html +1.二层交换机的VLAN1地址,只能当作远程管理地址使用 + 三层交换机的SVI可以分别设置IP,并被远程访问到 + +2.三层交换机要连接不同的网络,就要启用路由功能 +命令为switch(config)#ip routing + +3.三层交换机默认是二层接口,使用命令为switch(config-if)#no switch + 可以启用三层接口,即当路由器的那种接口使用,可以直接配平IP +``` + +![alt text](./images/20240510.PNG) + +```html +三层交换机1: + +三层交换机1: +Switch>en +Switch#conf t +Switch(config)#vlan 10 +Switch(config-vlan)#vlan 20 +Switch(config-vlan)#int f 0/1 +Switch(config-if)#switchport access vlan 10 +Switch(config-if)#int f 0/2 +Switch(config-if)#switchport access vlan 20 +Switch(config-if)#int vlan 10 +Switch(config-if)#ip add 192.168.1.254 255.255.255.0 +Switch(config-if)#int vlan 20 +Switch(config-if)#ip add 192.168.2.254 255.255.255.0 +Switch(config-if)#int f 0/3 +Switch(config-if)#switch trunk encapsulation dot1q +Switch(config-if)#switch mode trunk +Switch(config-router)#int f 0/3 +Switch(config-if)#no sw +Switch(config-if)#ip add 192.168.5.1 255.255.255.0 +Switch(config-if)#router ospf 1 +Switch(config-router)#net 192.168.1.0 0.0.0.255 area 0 +Switch(config-router)#net 192.168.2.0 0.0.0.255 area 0 +Switch(config-router)#net 192.168.5.0 0.0.0.255 area 0 +Switch(config-router)#ex +Switch(config)#int f 0/4 +Switch(config-if)#no sw +Switch(config-if)#ip add 192.168.6.1 255.255.255.0 +Switch(config)#ip routing +Switch(config)#router ospf 1 +Switch(config-router)#net 192.168.6.0 0.0.0.255 area 0 +``` + +```html +三层交换机2: +Switch>en +Switch#conf t +Switch(config)#vlan 10 +Switch(config-vlan)#vlan 20 +Switch(config-vlan)#int f 0/1 +Switch(config-if)#switchport access vlan 10 +Switch(config-if)#int f 0/2 +Switch(config-if)#switchport access vlan 20 +Switch(config-if)#int vlan 10 +Switch(config-if)#ip add 192.168.3.254 255.255.255.0 +Switch(config-if)#int vlan 20 +Switch(config-if)#ip add 192.168.4.254 255.255.255.0 +Switch(config-if)#int f 0/3 +Switch(config-if)#switch trunk encapsulation dot1q +Switch(config-if)#switch mode trunk +Switch(config-router)#int f 0/3 +Switch(config-if)#no sw +Switch(config-if)#ip add 192.168.5.2 255.255.255.0 +Switch(config-if)#router ospf 1 +Switch(config-router)#net 192.168.3.0 0.0.0.255 area 0 +Switch(config-router)#net 192.168.4.0 0.0.0.255 area 0 +Switch(config-router)#net 192.168.5.0 0.0.0.255 area 0 +Switch(config)#int f 0/4 +Switch(config-if)#no sw +Switch(config-if)#ip add 192.168.6.1 255.255.255.0 +Switch(config)#ip routing +Switch(config)#router ospf 1 +Switch(config-router)#net 192.168.6.0 0.0.0.255 area 0 +``` + +```html +交换机: + +交换机: +Switch>en +Switch#conf t +Switch(config)#vlan 10 +Switch(config-vlan)#vlan 20 +Switch(config-vlan)#int f 0/1 +Switch(config-if)#switchport access vlan 10 +Switch(config-if)#int f 0/2 +Switch(config-if)#switchport access vlan 20 +Switch(config-if)#int f 0/3 +Switch(config-if)#switch mode trunk +``` + +```html +路由器: + +路由器: +Router>en +Router#conf t +Router(config)#int f 0/1 +Router(config-if)#no shutdown +Router(config-if)#ip add 192.168.6.2 255.255.255.0 +Router(config-if)#int f 0/0.1 +Router(config-subif)#encapsulation dot1Q 10 +Router(config-subif)#ip add 192.168.7.254 255.255.255.0 +Router(config-subif)#int f 0/0.2 +Router(config-subif)#encapsulation dot1Q 20 +Router(config-subif)#ip add 192.168.8.254 255.255.255.0 +Router(config-subif)#int f 0/0 +Router(config-if)#no shutdown +Router(config-if)#int f 0/1 +Router(config-if)#router ospf 1 +Router(config-router)#net 192.168.6.0 0.0.0.255 area 0 +Router(config-router)#net 192.168.7.0 0.0.0.255 area 0 +Router(config-router)#net 192.168.8.0 0.0.0.255 area 0 +Router(config-router)#do show ip route +``` \ No newline at end of file -- Gitee From f6dfc1ee9a82937f6a028c95aebaa56eb800498c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=80=8A?= <11809975+wangxundezuoye@user.noreply.gitee.com> Date: Mon, 13 May 2024 14:02:02 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=2011=E7=8E=8B?= =?UTF-8?q?=E9=80=8A/2024-06.07=20=E8=AE=A1=E7=AE=97=E6=9C=BA=E7=BD=91?= =?UTF-8?q?=E7=BB=9C=E5=9F=BA=E7=A1=80=EF=BC=8816=EF=BC=89.md=20=E4=B8=BA?= =?UTF-8?q?=2011=E7=8E=8B=E9=80=8A/2024-05.07=20=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=9C=BA=E7=BD=91=E7=BB=9C=E5=9F=BA=E7=A1=80=EF=BC=8817?= =?UTF-8?q?=EF=BC=89.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\273\234\345\237\272\347\241\200\357\274\21017\357\274\211.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "11\347\216\213\351\200\212/2024-06.07 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21016\357\274\211.md" => "11\347\216\213\351\200\212/2024-05.07 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21017\357\274\211.md" (100%) diff --git "a/11\347\216\213\351\200\212/2024-06.07 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21016\357\274\211.md" "b/11\347\216\213\351\200\212/2024-05.07 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21017\357\274\211.md" similarity index 100% rename from "11\347\216\213\351\200\212/2024-06.07 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21016\357\274\211.md" rename to "11\347\216\213\351\200\212/2024-05.07 \350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21017\357\274\211.md" -- Gitee From d0c1cde489271e81e8d21e19fbc3def4c5fcbe17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=80=8A?= <11809975+wangxundezuoye@user.noreply.gitee.com> Date: Mon, 13 May 2024 14:02:15 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=2011=E7=8E=8B?= =?UTF-8?q?=E9=80=8A/2024-05.011=E8=AE=A1=E7=AE=97=E6=9C=BA=E7=BD=91?= =?UTF-8?q?=E7=BB=9C=E5=9F=BA=E7=A1=80=EF=BC=8820=EF=BC=89.md=20=E4=B8=BA?= =?UTF-8?q?=2011=E7=8E=8B=E9=80=8A/2024-05.11=E8=AE=A1=E7=AE=97=E6=9C=BA?= =?UTF-8?q?=E7=BD=91=E7=BB=9C=E5=9F=BA=E7=A1=80=EF=BC=8820=EF=BC=89.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\273\234\345\237\272\347\241\200\357\274\21020\357\274\211.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "11\347\216\213\351\200\212/2024-05.011\350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21020\357\274\211.md" => "11\347\216\213\351\200\212/2024-05.11\350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21020\357\274\211.md" (100%) diff --git "a/11\347\216\213\351\200\212/2024-05.011\350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21020\357\274\211.md" "b/11\347\216\213\351\200\212/2024-05.11\350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21020\357\274\211.md" similarity index 100% rename from "11\347\216\213\351\200\212/2024-05.011\350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21020\357\274\211.md" rename to "11\347\216\213\351\200\212/2024-05.11\350\256\241\347\256\227\346\234\272\347\275\221\347\273\234\345\237\272\347\241\200\357\274\21020\357\274\211.md" -- Gitee