From 17ca72be5e6557764551237de61e4d6c899a81a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=A2=96=E7=A5=AF?= <2759318694@qq.com> Date: Sun, 10 May 2026 16:31:17 +0800 Subject: [PATCH 1/2] 20260509 --- ...61\347\232\204\351\205\215\347\275\256.md" | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 "42 \351\273\204\351\242\226\347\245\257/20260509 \351\235\231\346\200\201\350\267\257\347\224\261\347\232\204\351\205\215\347\275\256.md" diff --git "a/42 \351\273\204\351\242\226\347\245\257/20260509 \351\235\231\346\200\201\350\267\257\347\224\261\347\232\204\351\205\215\347\275\256.md" "b/42 \351\273\204\351\242\226\347\245\257/20260509 \351\235\231\346\200\201\350\267\257\347\224\261\347\232\204\351\205\215\347\275\256.md" new file mode 100644 index 00000000..abea6e11 --- /dev/null +++ "b/42 \351\273\204\351\242\226\347\245\257/20260509 \351\235\231\346\200\201\350\267\257\347\224\261\347\232\204\351\205\215\347\275\256.md" @@ -0,0 +1,232 @@ +笔记 + +![image-20260507200434593](https://gitee.com/onesheet/picture-warehouse/raw/master/pic/upgit_20260507_1778155474.png) + +- 新建Cisco PT 拓扑图 +- 为各PC设置IP及网关地址,其中网关地址分别为路由器接口的IP地址 +- 接着为Router0和Router1上的以太网接口配置IP地址 +- 在路由器之间的串行接口上配置IP地址,且IP地址必须在同一子网内 +- 在Router0的串口上设置时钟频率(本次实验Router0为DCE类型,如图Router0一端有时钟图标) +- 査看路由器上的直连路由 +- 在Router0和Router1上配置静态路由 +- 查看路由器上的静态路由 +- 验证不同局域网PC之间的相互通信 + +```bash +PC设置 +192.168.1.1 //PC0 +192.168.1.2 //PC1 +//子网掩码和网关 +255.255.255.0 +192.168.1.254 + +``` + +```bash +PC设置 +192.168.2.1 //PC2 +//子网掩码和网关 +255.255.255.0 +192.168.2.254 + +``` + +```bash +Router0 基本配置 +Router>enable +Router#conf t +Router(config)#inter f0/0 //进入第0模块第0端口(快速以太网接口) +Router(config-if)#ip address 192.168.1.254 255.255.255.0 //配置f0/0接口IP +Router(config-if)#no shutdown //开启端口 +Router(config-if)#exit +Router(config)#interface serial 2/0 //进入第2模块第0端口(串行接口) +Router(config-if)#ip address 10.254.10.1 255.255.255.0 //配置s2/0接口IP +Router(config-if)#clock rate 64000 //必须配置时钟才可通信 +Router(config-if)#no shutdown //开启端口 +Router(config)#^Z +Router#show r + +``` + +```bash +Router1 基本配置 +Router>enable +Router#conf t +Router(config)#inter f0/0 //进入第0模块第0端口(快速以太网接口) +Router(config-if)#ip address 192.168.2.254 255.255.255.0 //配置f0/0接口IP +Router(config-if)#no shutdown //开启端口 +Router(config-if)#exit +Router(config)#interface serial 2/0 //进入第2模块第0端口(串行接口) +Router(config-if)#ip address 10.254.10.2 255.255.255.0 //配置s2/0接口IP +Router(config-if)#no shutdown //开启端口 +Router(config)#^Z +Router#show r + +``` + +```bash +Router0 静态路由配置 +Router>enable +Router#conf t +Router(config)#ip route 192.168.2.0 255.255.255.0 10.254.10.2 +# ip route 目标网络号 目标子网掩码 下一跳地址 +# 命令解读:当目的网络地址为192.168.2.0时,转发到端口地址为10.254.10.2处路由 +Router(config)#^Z +Router#show ip route + +``` + +```bash +Router1 静态路由配置 +Router>enable +Router#conf t +Router(config)#ip route 192.168.1.0 255.255.255.0 10.254.10.1 +(命令解读:参考以上) +Router(config)#^Z +Router#show ip route + +``` + +```bash +# 链路测试 +PC0和PC1(命令提示符CMD下) +ping 192.168.1.254 //链路通 +ping 10.254.10.2 //链路通 +ping 192.168.2.1 //链路通 +PC2(命令提示符CMD下) +ping 10.254.10.254 //链路通 +ping 192.168.1.2 //链路通 + +``` + +作业 + +```bash +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter +Router(config)#interface f +Router(config)#interface fastEthernet 0/0 +Router(config-if)#ip address 192.168.1.254 255.255.255.0 +Router(config-if)#no sh +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up + +Router(config-if)#exit +Router(config)# +Router(config)#inter +Router(config)#interface seri +Router(config)#interface serial 2/0 +Router(config-if)#ip add +Router(config-if)#ip address 10.254.10.1 255.255.255.0 +Router(config-if)#clo +Router(config-if)#clock ra +Router(config-if)#clock rate 64000 +Router(config-if)#no sh +Router(config-if)#no shutdown +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter +Router(config)#interface f +Router(config)#interface fastEthernet 0/0 +Router(config-if)#ip add +Router(config-if)#ip address 192.168.1.254 255.255.255.0 +Router(config-if)#no sh +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up + +Router(config-if)#exit +Router(config)# +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router#inter +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter +Router(config)#interface ser +Router(config)#interface serial 2/0 +Router(config-if)#ip add +Router(config-if)#ip address 10.254.10.2 255.255.255.0 +Router(config-if)#no sh +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface Serial2/0, changed state to up + +Router(config-if)#exit + +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter +Router(config)#interface f +Router(config)#interface fastEthernet 0/0 +Router(config-if)#ip add +Router(config-if)#ip address 192.168.3.254 255.255.255.0 +Router(config-if)#clo +Router(config-if)#no sh +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up + +Router(config-if)#exit +Router(config)#inter +Router(config)#interface ser +Router(config)#interface serial 3/0 +Router(config-if)#ip add +Router(config-if)#ip address 20.20.10.2 255.255.255.0 +Router(config-if)#clo +Router(config-if)#clock ra +Router(config-if)#clock rate 64000 +This command applies only to DCE interfaces +Router(config-if)#no sh +Router(config-if)#no shutdown +Router(config-if)#ip route 0.0.0.0.0.0.0.0 20.20.10.1 +%LINK-5-CHANGED: Interface Serial2/0, changed state to down +Router(config-if)#end +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router#show r + +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#ip route 192.168.1.0 255.255.255.0 10.254.10.1 +Router(config)#end +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router#ip r +Router#show ip r +Router#show ip route + +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. + +Router(config)#ip +Router(config)#ip add +Router(config)#ip route 192.168.3.0 255.255.255.0 20.20.10.2 +Router(config)#end +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router#show ip route + +``` + -- Gitee From 3e0b4d9a60302f3429ba34e3a6de8ef0f393b70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E9=A2=96=E7=A5=AF?= <2759318694@qq.com> Date: Tue, 12 May 2026 23:20:25 +0800 Subject: [PATCH 2/2] 20260512 --- ...50\346\200\201\350\267\257\347\224\261.md" | 368 ++++++++++++++++++ README.md | 1 + 2 files changed, 369 insertions(+) create mode 100644 "42 \351\273\204\351\242\226\347\245\257/202660512 RIP\345\212\250\346\200\201\350\267\257\347\224\261.md" create mode 100644 README.md diff --git "a/42 \351\273\204\351\242\226\347\245\257/202660512 RIP\345\212\250\346\200\201\350\267\257\347\224\261.md" "b/42 \351\273\204\351\242\226\347\245\257/202660512 RIP\345\212\250\346\200\201\350\267\257\347\224\261.md" new file mode 100644 index 00000000..9eae0196 --- /dev/null +++ "b/42 \351\273\204\351\242\226\347\245\257/202660512 RIP\345\212\250\346\200\201\350\267\257\347\224\261.md" @@ -0,0 +1,368 @@ +笔记 + +```bash +Router(config)#router rip //进入路由配置模式 — 启用RIP协议 +Router(config-router)#version 2 //使用版本2,即RIPv2协议 +Router(config-router)#network 192.168.2.0 //指定需要通告的网络(位于路由接口) +Router(config-router)#network 10.254.10.0 +Router(config-router)#^Z +Router#show r +Router#show ip route +``` + +练习 + +![20240428211107](https://oss.9ihub.com/test/20240428211107.png) + +```bash +Switch>en +Switch#config t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#vlan 2 +Switch(config-vlan)#vlan 3 +Switch(config-vlan)#exit +Switch(config)#inter f0/1 +Switch(config-if)#switchport access vlan 2 +Switch(config-if)#exit +Switch(config)#inter f0/2 +Switch(config-if)#switchport access vlan 3 +Switch(config-if)#exit +Switch(config)#ip routing +Switch(config)#interface vlan 2 +Switch(config-if)# +%LINK-5-CHANGED: Interface Vlan2, changed state to up + +Switch(config-if)#ip address 192.168.3.1 255.255.255.0 +Switch(config-if)#e +%CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/2 (3), with Switch FastEthernet0/1 (1). + +Switch(config)#interface vlan 3 +Switch(config-if)# +%LINK-5-CHANGED: Interface Vlan3, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state to up + +Switch(config-if)#ip address 192.168.1.1 255.255.255.0 +Switch(config-if)#exit +Switch(config)#router rip +Switch(config-router)# +%CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/2 (3), with Switch FastEthernet0/1 (1). + +Switch(config-router)#version 2 +Switch(config-router)#network 192.168.1.0 +Switch(config-router)#network 192.168.3.0 + +Switch(config-router)# +%CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/2 (3), with Switch FastEthernet0/1 (1). + +Switch(config-router)#exit +Switch(config)#exit +Switch# +%SYS-5-CONFIG_I: Configured from console by console + +Switch#show r +Building configuration... + +Current configuration : 1435 bytes +! +version 12.2(37)SE1 +no service timestamps log datetime msec +no service timestamps debug datetime msec +no service password-encryption +! +hostname Switch +! +! +! +! +! +! +ip routing +! +! +! +! +! +! +! +! +! +! + +Switch#show ip route +Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP + D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area + N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 + E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP + i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area + * - candidate default, U - per-user static route, o - ODR + P - periodic downloaded static route + +Gateway of last resort is not set + +C 192.168.1.0/24 is directly connected, Vlan3 + +Switch# +``` + +```bash +Router>enable +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter f0/0 +Router(config-if)#ip address 192.168.3.2 255.255.255.0 +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up + +Router(config-if)#exit +Router(config)#interface serial 2/0 +Router(config-if)#ip address 10.254.10.1 255.255.255.0 +Router(config-if)#clock rate 64000 +This command applies only to DCE interfaces +Router(config-if)#no shutdown + +%LINK-5-CHANGED: Interface Serial2/0, changed state to down +Router(config-if)#exit +Router(config)#router rip +Router(config-router)#version 2 +Router(config-router)#network 192.168.3.0 +Router(config-router)#network 10.254.10.0 +Router(config-router)#^z + ^ +% Invalid input detected at '^' marker. + +Router(config-router)#exit +Router(config)#exit +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router#show r +Building configuration... + +Current configuration : 775 bytes +! +version 12.2 +no service timestamps log datetime msec +no service timestamps debug datetime msec +no service password-encryption +! +hostname Router +! +! +! +! +! +! +! +! +ip cef +no ipv6 cef +! +! + +Router#show ip route +Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP + D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area + N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 + E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP + i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area + * - candidate default, U - per-user static route, o - ODR + P - periodic downloaded static route + +Gateway of last resort is not set + +R 192.168.1.0/24 [120/1] via 192.168.3.1, 00:00:26, FastEthernet0/0 +C 192.168.3.0/24 is directly connected, FastEthernet0/0 + +Router# +``` + +```bash +Router>enable +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter f0/0 +Router(config-if)#ip address 192.168.2.1 255.255.255.0 +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up + +Router(config-if)#exit +Router(config)#interface serial 2/0 +Router(config-if)#ip address 10.254.10.2 255.255.255.0 +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface Serial2/0, changed state to up + +Router(config-if)#exit +Router(config)#rout +%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up + +% Incomplete command. +Router(config)#router rip +Router(config-router)#version 2 +Router(config-router)#network 192.168.2.0 +Router(config-router)#network 10.254.10.0 +Router(config-router)#^Z + ^ +% Invalid input detected at '^' marker. + +Router(config-router)#exit +Router(config)#exit +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router#show r +Building configuration... + +Current configuration : 795 bytes +! +version 12.2 +no service timestamps log datetime msec +no service timestamps debug datetime msec +no service password-encryption +! +hostname Router +! +! +! +! +! +! +! +! +ip cef +no ipv6 cef +! +! +! + +Router# +Router#show ip route +Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP + D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area + N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 + E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP + i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area + * - candidate default, U - per-user static route, o - ODR + P - periodic downloaded static route + +Gateway of last resort is not set + + 10.0.0.0/24 is subnetted, 1 subnets +C 10.254.10.0 is directly connected, Serial2/0 +R 192.168.1.0/24 [120/2] via 10.254.10.1, 00:00:08, Serial2/0 +C 192.168.2.0/24 is directly connected, FastEthernet0/0 +R 192.168.3.0/24 [120/1] via 10.254.10.1, 00:00:08, Serial2/0 + +Router# + + + + +Packet Tracer PC Command Line 1.0 +C:\>ping 192.168.1.1 + +Pinging 192.168.1.1 with 32 bytes of data: + +Reply from 192.168.1.1: bytes=32 time<1ms TTL=255 +Reply from 192.168.1.1: bytes=32 time<1ms TTL=255 +Reply from 192.168.1.1: bytes=32 time<1ms TTL=255 +Reply from 192.168.1.1: bytes=32 time<1ms TTL=255 + +Ping statistics for 192.168.1.1: + Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), +Approximate round trip times in milli-seconds: + Minimum = 0ms, Maximum = 0ms, Average = 0ms + +C:\>ping 10.254.10.1 + +Pinging 10.254.10.1 with 32 bytes of data: + +Reply from 10.254.10.1: bytes=32 time=1ms TTL=254 +Reply from 10.254.10.1: bytes=32 time<1ms TTL=254 +Reply from 10.254.10.1: bytes=32 time<1ms TTL=254 +Reply from 10.254.10.1: bytes=32 time<1ms TTL=254 + +Ping statistics for 10.254.10.1: + Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), +Approximate round trip times in milli-seconds: + Minimum = 0ms, Maximum = 1ms, Average = 0ms + +C:\>ping 192.168.2.2 + +Pinging 192.168.2.2 with 32 bytes of data: + +Request timed out. +Reply from 192.168.2.2: bytes=32 time +=1ms TTL=125 +Reply from 192.168.2.2: bytes=32 time=1ms TTL=125 +Reply from 192.168.2.2: bytes=32 time=2ms TTL=125 + +Ping statistics for 192.168.2.2: + Packets: Sent = 4, Received = 3, Lost = 1 (25% loss), +Approximate round trip times in milli-seconds: + Minimum = 1ms, Maximum = 2ms, Average = 1ms + +C:\> + + + + +Packet Tracer PC Command Line 1.0 +C:\>ping 10.254.10.1 + +Pinging 10.254.10.1 with 32 bytes of data: + +Reply from 10.254.10.1: bytes=32 time=1ms TTL=254 +Reply from 10.254.10.1: bytes=32 time=1ms TTL=254 +Reply from 10.254.10.1: bytes=32 time=1ms TTL=254 +Reply from 10.254.10.1: bytes=32 time=1ms TTL=254 + +Ping statistics for 10.254.10.1: + Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), +Approximate round trip times in milli-seconds: + Minimum = 1ms, Maximum = 1ms, Average = 1ms + +C:\>ping 192.168.3.1 + +Pinging 192.168.3.1 with 32 bytes of data: + +Reply from 192.168.3.1: bytes=32 time=5ms TTL=253 +Reply from 192.168.3.1: bytes=32 time=1ms TTL=253 +Reply from 192.168.3.1: bytes=32 time=3ms TTL=253 +Reply from 192.168.3.1: bytes=32 time=3ms TTL=253 + +Ping statistics for 192.168.3.1: + Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), +Approximate round trip times in milli-seconds: + Minimum = 1ms, Maximum = 5ms, Average = 3ms + +C:\>ping 192.168.1.3 + +Pinging 192.168.1.3 with 32 bytes of data: + +Request timed out. +Reply from 192.168.1.3: bytes=32 time=4ms TTL=125 +Reply from 192.168.1.3: bytes=32 time=11ms TTL=125 +Reply from 192.168.1.3: bytes=32 time=1ms TTL=125 + +Ping statistics for 192.168.1.3: + Packets: Sent = 4, Received = 3, Lost = 1 (25% loss), +Approximate round trip times in milli-seconds: + Minimum = 1ms, Maximum = 11ms, Average = 5ms + +C:\> + + + +``` + diff --git a/README.md b/README.md new file mode 100644 index 00000000..81acea05 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# 无网络,不青春 \ No newline at end of file -- Gitee