From 72b8653bc13057c2d1bc17859af8cf024cc2445d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A9=89=E5=A9=B7?= <2465898445@qq.com> Date: Sun, 20 Apr 2025 12:03:55 +0800 Subject: [PATCH] 20250420 --- ...7\202\350\267\257\347\224\261\357\274\211" | 277 ++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 "35 \347\216\213\345\251\211\345\251\267/20250418 RIP\345\212\250\346\200\201\350\267\257\347\224\261\357\274\210\344\270\211\345\261\202\344\272\244\346\215\242\346\234\272SVI+\345\215\225\350\207\202\350\267\257\347\224\261\357\274\211" diff --git "a/35 \347\216\213\345\251\211\345\251\267/20250418 RIP\345\212\250\346\200\201\350\267\257\347\224\261\357\274\210\344\270\211\345\261\202\344\272\244\346\215\242\346\234\272SVI+\345\215\225\350\207\202\350\267\257\347\224\261\357\274\211" "b/35 \347\216\213\345\251\211\345\251\267/20250418 RIP\345\212\250\346\200\201\350\267\257\347\224\261\357\274\210\344\270\211\345\261\202\344\272\244\346\215\242\346\234\272SVI+\345\215\225\350\207\202\350\267\257\347\224\261\357\274\211" new file mode 100644 index 0000000..28a1f6f --- /dev/null +++ "b/35 \347\216\213\345\251\211\345\251\267/20250418 RIP\345\212\250\346\200\201\350\267\257\347\224\261\357\274\210\344\270\211\345\261\202\344\272\244\346\215\242\346\234\272SVI+\345\215\225\350\207\202\350\267\257\347\224\261\357\274\211" @@ -0,0 +1,277 @@ +# RIP动态路由(三层交换机+单臂路由) + +![31](https://gitee.com/wangwting/image-ownership-location/raw/master/img/upgit_20250420_1745121738.png) + +- **J1** (配置VLAN,修改端口) + +```cmd +Switch>en +Switch>en +Switch# +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#int f0/1 +Switch(config-if)#sw +Switch(config-if)#switchport acc vlan 10 +% Access VLAN does not exist. Creating vlan 10 +Switch(config-if)#ex +Switch(config)#int f0/2 +Switch(config-if)#sw acc vlan 20 +% Access VLAN does not exist. Creating vlan 20 +Switch(config-if)#ex +Switch(config)#int f0/3 +Switch(config-if)#sw +Switch(config-if)#switchport mo +Switch(config-if)#switchport mo +Switch(config-if)#switchport mo tr +Switch(config-if)#switchport mo trunk +``` + +- 三层交换机(运用SVI) +- **一定要记得设VLAN** + +```cmd +Switch>en +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#vlan 10 +Switch(config-vlan)# +Switch(config-vlan)#vlan 20 +Switch(config)#int f0/1 +Switch(config-if)#sw +Switch(config-if)#switchport t +Switch(config-if)#switchport trunk +Switch(config-if)#switchport trunk en +Switch(config-if)#switchport trunk encapsulation d +Switch(config-if)#switchport trunk encapsulation dot1q +Switch(config-if)#sw +Switch(config-if)#switchport m +Switch(config-if)#switchport mode t +Switch(config-if)#switchport mode trunk +Switch(config-if)# +Switch(config-if)#ex +Switch(config)#int vlan 10 +Switch(config-if)# +Switch(config-if)#ip add 192.168.10.254 255.255.255.0 +Switch(config-if)#no shutdown +Switch(config-if)#ex +Switch(config)#int vlan 20 +Switch(config-if)# +Switch(config-if)#ip add 192.168.20.254 255.255.255.0 +Switch(config-if)#no shut +Switch(config-if)#no shutdown +Switch(config-if)#ex +Switch(config)#ip routing +Switch(config)# +//配IP +Switch(config)#int f0/2 +Switch(config-if)#no switchport +Switch(config-if)#ip add 10.10.10.1 255.255.255.0 +Switch(config-if)#no shutdown +``` + +- **J2** + +```cmd +Switch>en +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#int f0/1 +Switch(config-if)#sw +Switch(config-if)#switchport acc vlan 10 +% Access VLAN does not exist. Creating vlan 10 +Switch(config-if)#ex +Switch(config)#int f0/2 +Switch(config-if)#sw +Switch(config-if)#switchport acc vlan 20 +% Access VLAN does not exist. Creating vlan 20 +Switch(config-if)#ex +Switch(config)#int f0/3 +Switch(config-if)#sw +Switch(config-if)#switchport m +Switch(config-if)#switchport mode t +Switch(config-if)#switchport mode trunk +Switch(config-if)# +``` + +- R1 + +```cmd +Router>en +Router# +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#int g0/0 +Router(config-if)#no shut +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/0.1 +Router(config-subif)# +%LINK-5-CHANGED: Interface GigabitEthernet0/0.1, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.1, changed state to up + +Router(config-subif)#en +Router(config-subif)#encapsulation d +Router(config-subif)#encapsulation dot1Q 10 +Router(config-subif)#ip add 192.168.30.254 255.255.255.0 +Router(config-subif)#ex +Router(config)#int g0/0.2 +Router(config-subif)# +%LINK-5-CHANGED: Interface GigabitEthernet0/0.2, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.2, changed state to up + +Router(config-subif)#en +Router(config-subif)#encapsulation d +Router(config-subif)#encapsulation dot1Q 20 +Router(config-subif)# +Router(config-subif)#ip add 192.168.40.254 255.255.255.0 +Router(config-subif)#ex +Router(config)#int g0/1 +Router(config-if)#no shut +Router(config-if)#no shutdown +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 + +Router(config-if)#ip add 10.10.10.2 255.255.255.0 +Router(config-if)#ex +Router(config)#int g0/2 +Router(config-if)#no shut +Router(config-if)#no shutdown +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to up + +Router(config-if)#ip add 20.20.20.1 255.255.255.0 +Router(config-if)# +``` + +- **J3** + +```cmd +Switch>en +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#int f0/1 +Switch(config-if)#sw +Switch(config-if)#switchport acc vlan 10 +% Access VLAN does not exist. Creating vlan 10 +Switch(config-if)#ex +Switch(config)#int f0/2 +Switch(config-if)#sw acc vlan 20 +% Access VLAN does not exist. Creating vlan 20 +Switch(config-if)#ex +Switch(config)#int f0/3 +Switch(config-if)#sw mo tr +Switch(config-if)#sw mo trunk +Switch(config-if)# +``` + +- R2 + +```cmd +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#int g0/0 +Router(config-if)#no shut +Router(config-if)#no shutdown +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/0.1 +Router(config-subif)# +%LINK-5-CHANGED: Interface GigabitEthernet0/0.1, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.1, changed state to up + +Router(config-subif)#en +Router(config-subif)#encapsulation d +Router(config-subif)#encapsulation dot1Q 10 +Router(config-subif)# +Router(config-subif)#ip add 192.168.50.254 255.255.255.0 +Router(config-subif)#ex +Router(config)#int g0/0.3 +Router(config-subif)# +%LINK-5-CHANGED: Interface GigabitEthernet0/0.3, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.3, changed state to up + +Router(config-subif)#en +Router(config-subif)#encapsulation do +Router(config-subif)#encapsulation dot1Q 20 +Router(config-subif)#ip add 192.168.50.254 255.255.255.0 +% 192.168.50.0 overlaps with GigabitEthernet0/0.1 +Router(config-subif)#ex +//配ip并开启端口 +Router(config)#int g0/1 +Router(config-if)#no shutdown +Router(config-if)#ip add 20.20.20.2 255.255.255.0 +``` + +### 运用RIP动态路由 + +- 三层交换机 + +```cmd +Switch(config-if)#ex +Switch(config)#route rip +Switch(config-router)#version 2 +Switch(config-router)#net +Switch(config-router)#network 192.168.10.0 +Switch(config-router)#net +Switch(config-router)#network 192.168.20.0 +Switch(config-router)#net +Switch(config-router)#network 10.10.10.0 +``` + +- R1 + +```cmd + +Router(config)#route rip +Router(config-router)#version 2 +Router(config-router)#net +Router(config-router)#network 192.168.30.0 +Router(config-router)#network 192.168.40.0 +Router(config-router)#net +Router(config-router)#network 10.10.10.0 +Router(config-router)#net +Router(config-router)#network 20.20.20.0 +``` + +- R2 + +```cmd +Router(config)#route rip +Router(config-router)#version +% Incomplete command. +Router(config-router)#version 22 + ^ +% Invalid input detected at '^' marker. + +Router(config-router)#version 2 +Router(config-router)#net +Router(config-router)#network 192.168.50.0 +Router(config-router)#network 192.168.60.0 +Router(config-router)#net +Router(config-router)#network 20.20.20.0 +``` + -- Gitee