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 0000000000000000000000000000000000000000..1efef4bbe16cb80356bcce17e0a6585c1275ee3c --- /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 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 0000000000000000000000000000000000000000..78b232fa156c6f4e54185db2da5843fe93fc7bec --- /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