From c2e1b691052f0db7bae38e87f07bb5bde5b2095a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E6=80=9D?= Date: Sat, 9 May 2026 17:20:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?20260509=20=E9=9D=99=E6=80=81=E8=B7=AF?= =?UTF-8?q?=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...31\346\200\201\350\267\257\347\224\261.md" | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 "31 \344\275\225\346\200\235/20260509 \351\235\231\346\200\201\350\267\257\347\224\261.md" diff --git "a/31 \344\275\225\346\200\235/20260509 \351\235\231\346\200\201\350\267\257\347\224\261.md" "b/31 \344\275\225\346\200\235/20260509 \351\235\231\346\200\201\350\267\257\347\224\261.md" new file mode 100644 index 0000000..1efef4b --- /dev/null +++ "b/31 \344\275\225\346\200\235/20260509 \351\235\231\346\200\201\350\267\257\347\224\261.md" @@ -0,0 +1,71 @@ +## 静态路由 + +###### 首先解释这个是个什么东西:不同网络之间相互联系需要靠路由器,想要完成路由器与路由器之间的链接就要用到静态路由 是一个非常重要的东西,没有这个不同网络就不能相互联系 + +完成步骤: + +###### 一:先给每台电脑配ip 掩码以及网关 + +![image-20260509170537072](C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20260509170537072.png) + +基本框架建立成功之后,就把路由器之间的端口开启 like this: + +``` +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)# +Router(config)#interf f0/0 +Router(config-if)#no shutdown + +Router(config)#interf s2/0 +Router(config-if)#no shutdown + +``` + +等每个端口都开启了,就给各自配ip address + +``` +Router(config)#interf f0/0 +Router(config-if)#ip address 192.168.1.254 255.255.255.0 + +Router(config)#interf s2/0 +Router(config-if)#ip address 10.254.10.1 255.255.255.0 + +其他电脑的我就不写了 +``` + +然后到关键一步:配置静态路由 + +``` +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#ip route 192.168.2.0 255.255.255.0 10.254.10.2 +Router(config)#exit +``` + +这里有一个重点,ip route 的网络必须是目标网络,简单来说就是你要往哪里通讯就写哪台电脑的网络,网关也是 + +展示 + +``` +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 +C 192.168.1.0/24 is directly connected, FastEthernet0/0 +S 192.168.2.0/24 [1/0] via 10.254.10.2 +``` + +结果 + +![image-20260509171455921](C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20260509171455921.png) \ No newline at end of file -- Gitee From 74770502a29621eb90c42b13d5f18d9861ace789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E6=80=9D?= Date: Tue, 12 May 2026 20:00:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?20260512=20=E5=8A=A8=E6=80=81=E8=B7=AF?= =?UTF-8?q?=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...200\201\350\267\257\347\224\261\347\254\224\350\256\260.md" | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 "31 \344\275\225\346\200\235/20260512 \345\212\250\346\200\201\350\267\257\347\224\261\347\254\224\350\256\260.md" diff --git "a/31 \344\275\225\346\200\235/20260512 \345\212\250\346\200\201\350\267\257\347\224\261\347\254\224\350\256\260.md" "b/31 \344\275\225\346\200\235/20260512 \345\212\250\346\200\201\350\267\257\347\224\261\347\254\224\350\256\260.md" new file mode 100644 index 0000000..78b232f --- /dev/null +++ "b/31 \344\275\225\346\200\235/20260512 \345\212\250\346\200\201\350\267\257\347\224\261\347\254\224\350\256\260.md" @@ -0,0 +1,3 @@ +![image-20260512172750904](C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20260512172750904.png) + +![image-20260512172805284](C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20260512172805284.png) \ No newline at end of file -- Gitee