diff --git "a/03 \350\264\276\346\263\275\346\226\207/20260414 \345\256\211\350\243\205\344\273\273\345\212\241.md" "b/03 \350\264\276\346\263\275\346\226\207/20260414 \345\256\211\350\243\205\344\273\273\345\212\241.md" new file mode 100644 index 0000000000000000000000000000000000000000..a285208974771570c516d069ff2cb7e07ead06a3 --- /dev/null +++ "b/03 \350\264\276\346\263\275\346\226\207/20260414 \345\256\211\350\243\205\344\273\273\345\212\241.md" @@ -0,0 +1,3 @@ +# 安装任务 + +![屏幕截图 2026-04-15 182754](C:\Users\29333\Pictures\Screenshots\屏幕截图 2026-04-15 182754.png) \ No newline at end of file diff --git "a/03 \350\264\276\346\263\275\346\226\207/20260422 \346\200\235\347\247\221\346\223\215\344\275\234\347\263\273\347\273\237\345\221\275\344\273\244\345\237\272\347\241\200.md" "b/03 \350\264\276\346\263\275\346\226\207/20260422 \346\200\235\347\247\221\346\223\215\344\275\234\347\263\273\347\273\237\345\221\275\344\273\244\345\237\272\347\241\200.md" new file mode 100644 index 0000000000000000000000000000000000000000..e2a68d1c8caf194533ae511ca64df41a8ba88b94 --- /dev/null +++ "b/03 \350\264\276\346\263\275\346\226\207/20260422 \346\200\235\347\247\221\346\223\215\344\275\234\347\263\273\347\273\237\345\221\275\344\273\244\345\237\272\347\241\200.md" @@ -0,0 +1,104 @@ +## 一,交换机的基本配置 + + + +#### 1.交换机的管理方式基本分为两种:带内管理和带外管理。 + +通过交换机的 Console 端口管理交换机属于带外管理; 这种管理方式不占用交换机的网络端口, 第一次配置交换机必须利用 Console 端口进行配置。 + +通过 Telnet、 拨号等方式(TCP/IP协议)属于带内管理。 + +#### 2.交换机可以分为两种:二层交换机和三层交换机 + +二层交换机:也叫传统交换机,工作在OSI模型的数据链路层,二层交换机又分可分为傻瓜交换机和网管型交换机 + +三层交换机:在二层交换机的基础上增加了路由功能,能够实现IP数据包的转发 + +#### 3.交换机的命令行操作模式主要包括: + +用户模式            Switch> + +特权模式            Switch# + +全局配置模式     Switch(config)# + +端口模式            Switch(config-if)# + +实验设备:Switch_2960 1台;PC 1台;配置线。 + +#### 4.熟悉一些常用的命令: + +1. 进入特权模式(en) + +2. 进入全局配置模式(conft) + +3. 进入交换机端口视图模式(int f0/1) + +4. 返回到上级模式(exit) + +5. 从全局以下模式返回到特权模式(end) + +6. 设置密码(提高设备安全) + +7. 进入特权模式的[明/密文]密码(同时设置则只有后者生效) + +8. 用于[console/vty] 线路下的登录密码 + +9. 帮助信息(如?、 co?、 copy?) + +10. 命令简写(如 conft) + +11. 命令自动补全(Tab) + +12. 中断测试(Ctrl+c) + +13. 退回 到特权模式(Ctrl+z ) + +14. 在特权模式下重启交换机(Reload)  + +15. 修改交换机名称(hostname X) + + ```bash + #PC0(超级终端下) + Switch>enable //进入特权模式 + Switch#config terminal //进入全局配置模式 + Switch(config)#enable password cisco1 //设置密码为cisco1(明文显示) + Switch(config)#enable secret cisco2 //覆盖并设置密码为cisco2(密文显示) + Switch(config)#no enable password //取消明文密码 + Switch(config)#hostname S2960 //设置主机名为S2960 + S2960(config)#interface fastEthernet 0/1 //进入单端口模式 + S2960(config-if)#exit //返回到上一级模式 + S2960(config)#interface range fastEthernet 0/1-24 //进入多端口模式 + S2960(config-if)#exit + S2960(config)#ip default-gateway 192.168.1.254 //设置默认网关 + S2960(config)#ip domain-name cisco.com //设置域名 + S2960(config)#ip name-server 200.0.0.1 //设置域名服务器 + S2960(config)#no ip domain-lookup //禁止域名解析,避免特权模式下的错误解析 + S2960(config)#end //返回到特权模式 + S2960#terminal no monitor //关闭调试信息输出到终端 + S2960# ? //帮助命令提示 + S2960#show running-config //显示当前配置信息 + S2960#copy running-config startup-config # 保存当前配置 + S2960#show startup-config #查看已保存的配置 + S2960#show mac-address-table //显示MAC地址表 + ``` + + ![upgit_20260422_1776826950](https://gitee.com/meng-zheyu1224/tuchuang/raw/master/pic/upgit_20260508_1778222404.png) + +![upgit_20260422_1776826976](https://gitee.com/meng-zheyu1224/tuchuang/raw/master/pic/upgit_20260508_1778222421.png) + +![upgit_20260422_1776827038](https://gitee.com/meng-zheyu1224/tuchuang/raw/master/pic/upgit_20260508_1778222434.png) + +### 快捷键: + +- Tab 填写命令或关键字的剩下部分。 +- Ctrl-U 删除一整行 +- Ctrl-Z 退出配置模式并返回到执行模式 +- 向下箭头 用于在前面用过的命令的列表中向前滚动 +- 向上箭头 用于在前面用过的命令的列表中向后滚动 +- Ctrl-Shift-6 用于中断诸如 ping 或 traceroute 之类的 IOS 进程 +- Ctrl-C 放弃当前命令并退出配置模式 +- Ctrl+SHIFT+6 : 中断Translating "asdagf"...domain server (255.255.255.255) % Name lookup aborte + + + diff --git "a/03 \350\264\276\346\263\275\346\226\207/20260428 \347\224\237\346\210\220\346\240\221\343\200\201\350\201\232\345\220\210\343\200\201\345\256\211\345\205\250\343\200\201\344\270\211\345\261\202\344\272\244\346\215\242\346\234\272.md" "b/03 \350\264\276\346\263\275\346\226\207/20260428 \347\224\237\346\210\220\346\240\221\343\200\201\350\201\232\345\220\210\343\200\201\345\256\211\345\205\250\343\200\201\344\270\211\345\261\202\344\272\244\346\215\242\346\234\272.md" new file mode 100644 index 0000000000000000000000000000000000000000..5fb807b829262a3666777c4843e74fdfdbef3836 --- /dev/null +++ "b/03 \350\264\276\346\263\275\346\226\207/20260428 \347\224\237\346\210\220\346\240\221\343\200\201\350\201\232\345\220\210\343\200\201\345\256\211\345\205\250\343\200\201\344\270\211\345\261\202\344\272\244\346\215\242\346\234\272.md" @@ -0,0 +1,49 @@ +``` +Switch(config)#interface range g0/1-2 +Switch(config-if-range)#switchport mode trunk + + +Switch(config-if-range)# +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up + +Switch(config-if-range)#channel-group 1 mode on +Switch(config-if-range)# +Creating a port-channel interface Port-channel 1 + +%LINK-5-CHANGED: Interface Port-channel1, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up + +Switch(config-if-range)#exit + +Switch(config)# +Switch(config)#port-channel load-balance dst-ip +``` + +![upgit_20260428_1777384582](https://gitee.com/meng-zheyu1224/tuchuang/raw/master/pic/upgit_20260508_1778222657.png) + +``` +Switch(config)#spanning-tree mode rapid-pvst +``` + +``` +Switch(config)#ip routing +Switch(config)# +Switch(config)#int f0/1 +Switch(config-if)#no switchport +Switch(config-if)# +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up + +Switch(config-if)#ip address 192.168.66.1 255.255.255.0 +Switch(config-if)# +``` + +![upgit_20260428_1777386245](https://gitee.com/meng-zheyu1224/tuchuang/raw/master/pic/upgit_20260508_1778222668.png) \ No newline at end of file diff --git "a/03 \350\264\276\346\263\275\346\226\207/20260513 \345\212\250\346\200\201\350\267\257\347\224\261ospf.md" "b/03 \350\264\276\346\263\275\346\226\207/20260513 \345\212\250\346\200\201\350\267\257\347\224\261ospf.md" new file mode 100644 index 0000000000000000000000000000000000000000..0775bb1bf9187ac9871fb2b8dcf422762959b1c5 --- /dev/null +++ "b/03 \350\264\276\346\263\275\346\226\207/20260513 \345\212\250\346\200\201\350\267\257\347\224\261ospf.md" @@ -0,0 +1,138 @@ +## 作业: + +##### 交换机1: + +``` +Switch>en +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#vlan 40 +Switch(config-vlan)#vlan 50 +Switch(config-vlan)#ex +Switch(config)#int f0/2 +Switch(config-if)#sw mode access +Switch(config-if)#sw access vlan 40 +Switch(config-if)#ex +Switch(config)#int f0/1 +Switch(config-if)#sw mode access +Switch(config-if)#sw access vlan 50 +Switch(config-if)#end +Switch# +%SYS-5-CONFIG_I: Configured from console by console + +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#int f0/3 +Switch(config-if)#sw mode trunk +Switch(config-if)#end +``` + +##### 交换机2: + +``` +Switch> +Switch>en +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#vlan 60 +Switch(config-vlan)#vlan 70 +Switch(config-vlan)#ex +Switch(config)#int f0/1 +Switch(config-if)#sw mode access +Switch(config-if)#sw access vlan 60 +Switch(config-if)#ex +Switch(config)#int f0/2 +Switch(config-if)#sw mode access +Switch(config-if)#sw access vlan 70 +Switch(config-if)#ex +Switch(config)#int f0/3 +Switch(config-if)#sw mode trunk + +Switch(config-if)# +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up +``` + +RT1: + +``` +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#int g0/2 +Router(config-if)#ip add +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up + +Router(config-if)#ex +Router(config)#int g0/2.1 +Router(config-subif)# +%LINK-5-CHANGED: Interface GigabitEthernet0/2.1, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2.1, changed state to up + +Router(config-subif)#en +Router(config-subif)#encapsulation dot1Q 40 +Router(config-subif)#ip address 192.168.40.254 255.255.255.0 +Router(config-subif)#ex +Router(config)#int g0/2.2 +Router(config-subif)# +%LINK-5-CHANGED: Interface GigabitEthernet0/2.2, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2.2, changed state to up +en +Router(config-subif)#encapsulation dot1Q 50 +Router(config-subif)#ip address 192.168.50.254 255.255.255.0 +Router(config-subif)#end + +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#int g0/1 +Router(config-if)#ip address 192.168.10.1 255.255.255.0 +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up +``` + +SW1: + +``` + +``` + + + +##### RT2: + +``` +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#int g0/0 +Router(config-if)#ip address 192.168.30.254 255.255.255.0 +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up + +Router(config-if)#ex +Router(config)#int g0/1 +Router(config-if)#ip address 192.168.20.2 255.255.255.0 +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up +``` +