From 28071c35c8311320e80db81762c8cd58418c5de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E5=B8=86?= <11827039+yao-fan666@user.noreply.gitee.com> Date: Thu, 9 May 2024 19:26:37 +0800 Subject: [PATCH] biji --- .../20240506.\347\254\224\350\256\260.md" | 43 +++++++++++++++++++ .../20240508.\347\254\224\350\256\260.md" | 11 +++++ .../20240509.\347\254\224\350\256\260.md" | 9 ++++ 3 files changed, 63 insertions(+) create mode 100644 "\345\247\232\345\270\206/20240506.\347\254\224\350\256\260.md" create mode 100644 "\345\247\232\345\270\206/20240508.\347\254\224\350\256\260.md" create mode 100644 "\345\247\232\345\270\206/20240509.\347\254\224\350\256\260.md" diff --git "a/\345\247\232\345\270\206/20240506.\347\254\224\350\256\260.md" "b/\345\247\232\345\270\206/20240506.\347\254\224\350\256\260.md" new file mode 100644 index 0000000..2a30610 --- /dev/null +++ "b/\345\247\232\345\270\206/20240506.\347\254\224\350\256\260.md" @@ -0,0 +1,43 @@ +1、新建拓扑图 + +2、配置IP PC0:192.168.1.1 + +PC1:192.168.1.2 + +PC2:192.168.1.100 + +PC3:192.168.1.101 + +3、去交换机 + +Switch>en + +Switch#conf t + +// 先分别配置vlan +Switch(config)#int f 0/1 +Switch(config-if)#sw ac vlan 10 +% Access VLAN does not exist. Creating vlan 10 + +Switch(config-if)#int f 0/2 +Switch(config-if)#sw ac vlan 20 +% Access VLAN does not exist. Creating vlan 20 + +// trunk一下通往下一个交换机的端口 +Switch(config-if)#int r f0/22-24 +Switch(config-if-range)#sw mo trunk + + +Switch(config-if-range)#exit + +// 修改收敛速度 +Switch(config)#spanning-tree mode rapid-pvst + +// 汇聚组 +Switch(config)#int r f0/22-24 +Switch(config-if-range)#channel-group 1 mode on + +Switch(config-if-range)#exit + +// 负载均衡 +Switch(config)#port-channel load-balance dst-ip \ No newline at end of file diff --git "a/\345\247\232\345\270\206/20240508.\347\254\224\350\256\260.md" "b/\345\247\232\345\270\206/20240508.\347\254\224\350\256\260.md" new file mode 100644 index 0000000..6215ee8 --- /dev/null +++ "b/\345\247\232\345\270\206/20240508.\347\254\224\350\256\260.md" @@ -0,0 +1,11 @@ +Switch(config)#int f 0/3 // 选择接口 +Switch(config-if)#switchport port-security // 启用交换机接口的接口安全配置 +Command rejected: FastEthernet0/3 is a dynamic port. // 以上命令被拒绝了,提示说 F0/3 端口处在动态模式,思考:就是提醒我们要将F0/3的模式改为Access(访问模式) +Switch(config-if)#switchport mode access // 将端口改为access的模式,默认是动态的 +Switch(config-if)#switchport port-security // 在前面已经改好access模式下,再执行一次启用交换机接口的接口安全配置 +Switch(config-if)#switchport port-security maximum 1 // 设置端口安全模式下,该接口允许的最大连接数 1 +Switch(config-if)#switchport port-security violation shutdown // 设置超过连接数的违规设备的处理方式 +Switch(config-if)#switchport port-security mac-address sticky // 设置哪一个MAC是跟这个端口正确绑定的(允许访问),sticky将前面MAX设置的数量对应的MAC从地址表中,粘贴到安全设置中。// 必须让正确的电脑访问一次交换机。让交换机学习到这个MAC地址 +// 为了让交换机学习到正确的MAC地正,要ping1次 +Switch#clear port-security sticky // 将安全设置中,正确的MAC清空了。可以重新学习。 +Switch(config-if)#shut // 被关闭的端口,要手动关闭一次,再重新开启。no shut \ No newline at end of file diff --git "a/\345\247\232\345\270\206/20240509.\347\254\224\350\256\260.md" "b/\345\247\232\345\270\206/20240509.\347\254\224\350\256\260.md" new file mode 100644 index 0000000..868bc5c --- /dev/null +++ "b/\345\247\232\345\270\206/20240509.\347\254\224\350\256\260.md" @@ -0,0 +1,9 @@ +# 笔记 + +三层交换机:ip routing 激活三层交换机的路由功能 + +no switchport 打开三层交换机端口的路由功能 + +三层交换机要改trunk的端口要先封装 + +sw trunk enc dot1Q -- Gitee