From 18842bbd701c094922dcf73a3b9ff4cac3b3f055 Mon Sep 17 00:00:00 2001 From: lxx <3099029007@qq.com> Date: Mon, 6 May 2024 16:25:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...53\346\254\241\347\254\224\350\256\260.md" | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 "\346\236\227\346\231\223\351\233\252/20240506-\347\254\254\345\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" diff --git "a/\346\236\227\346\231\223\351\233\252/20240506-\347\254\254\345\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" "b/\346\236\227\346\231\223\351\233\252/20240506-\347\254\254\345\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" new file mode 100644 index 0000000..9c50c3c --- /dev/null +++ "b/\346\236\227\346\231\223\351\233\252/20240506-\347\254\254\345\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" @@ -0,0 +1,73 @@ +# RIP配置 + +![alt text](https://img2.imgtp.com/2024/05/06/fb1PdHCz.png) + +### 配置路由器(Router0)端口 +``````````bash +Would you like to enter the initial configuration dialog? [yes/no]: no +Press RETURN to get started! + +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#int g0/0/0 +Router(config-if)#ip addr 192.168.10.1 255.255.255.0 +Router(config-if)#no shut +Router(config-if)#int g0/0/1 +Router(config-if)#ip addr 10.10.10.2 255.255.255.0 +Router(config-if)#no shut +Router(config-if)#exit + +--配置路由器(Router0)RIP协议 + +Router(config)#route rip -- 开启RIP协议 +Router(config-router)#version 2 -- 启用RIP协议第二版 +Router(config-router)#network 192.168.10.0 -- 宣告网段 +Router(config-router)#network 10.10.10.0 +Router(config-router)#no auto-summary -- 关闭自动汇总 +Router(config-router)#do wr m +Building configuration... +[OK] +`````````` + +### 为什么要关闭自动汇总 +是因为RIP协议更新时不带子网掩码,路由器会根据IP自动判断汇总给其加上自己汇总后的子网掩码。假如有个网段是30.1.1.0/24,更新时不会带上24,路由器会认为是A类IP,通过自动汇总会把24汇总成8,这个不是我们想要的,所以要关闭自动汇总 + +### 配置路由器(Router1)端口 +``````````bash +Would you like to enter the initial configuration dialog? [yes/no]: no +Press RETURN to get started! + +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#int g0/0/0 +Router(config-if)#ip addr 192.168.20.1 255.255.255.0 +Router(config-if)#no shut +Router(config)#int g0/0/1 +Router(config-if)#ip addr 10.10.10.3 255.255.255.0 +Router(config-if)#no shut +Router(config-if)#exit + +--配置路由器(Router1)RIP协议 + +Router(config)#route rip +Router(config-router)#version 2 +Router(config-router)#network 192.168.20.0 +Router(config-router)#network 10.10.10.0 +Router(config-router)#no auto-summary +Router(config-router)#do wr m +Building configuration... +[OK] +`````````` + +### 查看路由表 +``````````bash +Router(config)#do show ip route +L-本地,C-直连,S-静态,R-RIP,以R开头的就是RIP协议的 +`````````` +![alt text](https://img2.imgtp.com/2024/05/06/8xyGLw5S.png) + +配置完成后进入主机中测试链路(此时网关以及主机都能ping通(且线路是绿灯`注意绿灯不代表一定是能通`)) + +![alt text](https://img2.imgtp.com/2024/05/06/qJoKQPiO.png) \ No newline at end of file -- Gitee From 0d42f7abd7f6adbd77929a4326e588f7e7dc9293 Mon Sep 17 00:00:00 2001 From: lxx <3099029007@qq.com> Date: Mon, 6 May 2024 20:07:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...5\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" | 1 + 1 file changed, 1 insertion(+) diff --git "a/\346\236\227\346\231\223\351\233\252/20240506-\347\254\254\345\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" "b/\346\236\227\346\231\223\351\233\252/20240506-\347\254\254\345\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" index 9c50c3c..668273e 100644 --- "a/\346\236\227\346\231\223\351\233\252/20240506-\347\254\254\345\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" +++ "b/\346\236\227\346\231\223\351\233\252/20240506-\347\254\254\345\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" @@ -1,4 +1,5 @@ # RIP配置 +`RIP(Routing Information Protocol)-路由信息协议`:是一种基于距离矢量算法的协议 以跳数(被传送数据所经过路由器的个数)为度数来衡量到达目标网络的距离 属于IGP(内部网关协议)协议 有RIP1和RIP2两个版本 基于UDP协议 端口号为520 主要用于小型网络 ![alt text](https://img2.imgtp.com/2024/05/06/fb1PdHCz.png) -- Gitee