diff --git "a/04\351\231\210\345\277\203\350\214\271/2024.5.11\347\254\224\350\256\260\344\270\211\345\261\202\344\272\244\346\215\242\346\234\2722\345\222\214\347\273\203\344\271\240\351\242\230.md" "b/04\351\231\210\345\277\203\350\214\271/2024.5.11\347\254\224\350\256\260\344\270\211\345\261\202\344\272\244\346\215\242\346\234\2722\345\222\214\347\273\203\344\271\240\351\242\230.md" new file mode 100644 index 0000000000000000000000000000000000000000..917b8995c988c653e03a4a41c1ff32f2b6bb49f3 --- /dev/null +++ "b/04\351\231\210\345\277\203\350\214\271/2024.5.11\347\254\224\350\256\260\344\270\211\345\261\202\344\272\244\346\215\242\346\234\2722\345\222\214\347\273\203\344\271\240\351\242\230.md" @@ -0,0 +1,150 @@ +## 2024.5.11笔记三层交换机2和练习题 + +![alt text](截图/截图5.11练习1.png) + +``` +先给pc配置IP,子网掩码和网关 + +二层交换机: + +划分vlan10,vlan20,将接口1划分到vlan0,将接口2划分到vlan20,将接口3设置为串口模式 + +Switch>en + +Switch#conf t + +Enter configuration commands, one per line. End with CNTL/Z. + +Switch(config)#vlan 10 + +Switch(config-vlan)#vlan 20 + +Switch(config-vlan)#int f0/1 + +Switch(config-if)#switchport access vlan 10 + +Switch(config-if)#int f0/2 + +Switch(config-if)#switchport access vlan 20 + +Switch(config-if)#int f0/3 + +Switch(config-if)#switchport mode trunk + + + +三层交换机: + +划分vlan10,vlan20,进入接口vlan10,vlan20配置网关 + +Switch>en + +Switch#conf t + +Switch(config)#vlan 10 + +Switch(config-vlan)#vlan 20 + +Switch(config-vlan)#int vlan 10 + +Switch(config-if)#ip address 192.168.1.254 255.255.255.0 + +Switch(config-if)#int vlan 20 + +Switch(config-if)#ip address 192.168.2.254 255.255.255.0 + +Switch(config-if)#ex + +Switch(config)#ip routing//开启路由功能 + + + +1.2电脑直连三层交换机,给电脑配置ip子网掩码网关后,划分到vlan10中 + +Switch(config)#int f0/2 + +Switch(config-if)#switchport access vlan 10 + +如图可以ping通 +``` + + +![alt text](截图/截图5.11练习2.png) + + +``` +(交换机sw1) +2.命名并划分:Switch>en +Switch#conf t +Switch(config)#vlan 11 +Switch(config-vlan)#vlan 21 +Switch(config-vlan)#ex +Switch(config)#vlan 11 +Switch(config-vlan)#name ks11 +Switch(config-vlan)#vlan 21 +Switch(config-vlan)#name ks21 +Switch(config-if)#int f0/1 +Switch(config-if)#switchport access vlan 11 + Switch(config-if)#int f0/2 +Switch(config-if)#switchport access vlan 21 + +3.配置串口模式 +Switch(config-if)#int f0/3 +Switch(config-if)#switchport mode trunk + +4.设置单臂路由 +r2(config)#int f0/1 +r2(config-if)#ip address 192.168.21.18 255.255.255.240 +r2(config)#int f0/0.11 +r2(config-subif)#encapsulation dot1Q 11 +r2(config-subif)#ip address 192.168.21.129 255.255.255.240 +r2(config-subif)#int f0/0.21 +r2(config-subif)#encapsulation dot1Q 21 +r2(config-subif)#ip address 192.168.21.200 255.255.255.240 + +5.连接路由器和pc +先给两边设置ip子网掩码,网关 +r1(config-if)#int f 0/0 +r1(config-if)#ip address 192.168.21.1 255.255.255.240 +r1(config-if)#int f 0/1 +r1(config-if)#ip address 192.168.21.17 255.255.255.240 + +6.设置ospf动态路由 +r1(config)#router ospf 1 +r1(config-router)#network 192.168.21.0 0.0.0.15 area 0 +r2(config)#router ospf 1 +r2(config-router)#network 192.168.21.0 0.0.0.15 area 0 +``` + +![alt text](截图/截图5.11改错.png) + +![alt text](截图/截图5.11改错1.png) +``` +改错题: +R1(config-subif)#int g0/1.10 +R1(config-subif)#no shut + +R1(config-subif)# +%LINK-5-CHANGED: Interface GigabitEthernet0/1.10, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1.10, changed state to up + +R1(config-subif)#int g0/1.10 +R1(config-subif)#encapsulation dot1Q 10 +R1(config-subif)#ip address 172.17.10.1 255.255.255.0 +R1(config-subif)#int g0/1.30 +R1(config-subif)#encapsulation dot1Q 30 +R1(config-subif)#ip address 172.17.30.1 255.255.255.0 +R1(config-subif)#do show r + +! +interface GigabitEthernet0/1.10 + encapsulation dot1Q 10 + ip address 172.17.10.1 255.255.255.0 +! +interface GigabitEthernet0/1.30 + encapsulation dot1Q 30 + ip address 172.17.30.1 255.255.255.0 +! +``` + diff --git "a/04\351\231\210\345\277\203\350\214\271/2024.5.13\347\254\224\350\256\260rip\344\275\234\344\270\232.md" "b/04\351\231\210\345\277\203\350\214\271/2024.5.13\347\254\224\350\256\260rip\344\275\234\344\270\232.md" new file mode 100644 index 0000000000000000000000000000000000000000..b6f04a0cc5d7e6a097a3e37ec4d47359dd1b83d8 --- /dev/null +++ "b/04\351\231\210\345\277\203\350\214\271/2024.5.13\347\254\224\350\256\260rip\344\275\234\344\270\232.md" @@ -0,0 +1,130 @@ +## 2024.5.13笔记rip作业 + +![alt text](截图/截图5.13rip作业.png) + +``` +先配置ip,子网掩码,网关(不同网络) +二层交换机: +Switch>en +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#vlan 100 +Switch(config-vlan)#vlan 200 +Switch(config-vlan)#int f 0/1 +Switch(config-if)#switchport access vlan 100 +Switch(config-if)#int f 0/11 +Switch(config-if)#switchport access vlan 200 +Switch(config-if)#int f 0/24 +Switch(config-if)#switchport mode trunk +Switch(config-if)#do show vlan +VLAN Name Status Ports +---- -------------------------------- --------- ------------------------------- +1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5 + Fa0/6, Fa0/7, Fa0/8, Fa0/9 + Fa0/10, Fa0/12, Fa0/13, Fa0/14 + Fa0/15, Fa0/16, Fa0/17, Fa0/18 + Fa0/19, Fa0/20, Fa0/21, Fa0/22 + Fa0/23, Gig0/1, Gig0/2 +100 VLAN0100 active Fa0/1 +200 VLAN0200 active Fa0/11 +1002 fddi-default active +1003 token-ring-default active +1004 fddinet-default active +1005 trnet-default active + +三层交换机: +Switch>en +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#vlan 100 +Switch(config-vlan)#vlan 200 +Switch(config-vlan)#int vlan 100 +Switch(config-if)# +%LINK-5-CHANGED: Interface Vlan100, changed state to up +Switch(config-if)#ip address 192.168.100.254 255.255.255.0 +Switch(config-if)#int vlan 200 +Switch(config-if)# +%LINK-5-CHANGED: Interface Vlan200, changed state to up +Switch(config-if)#ip address 192.168.200.254 255.255.255.0 +Switch(config-if)#ex +Switch(config)#ip routing + +Switch>en +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#router ospf 1 +Switch(config-router)#network 192.168.100.0 0.0.0.255 area 0 +Switch(config-router)#network 192.168.200.0 0.0.0.255 area 0 +Switch(config-router)#network 172.16.0.0 0.0.0.255 area 0 +Switch(config-router)# +03:55:42: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.3.254 on FastEthernet0/1 from LOADING to FULL, Loading Done + +Switch(config-router)#ex +Switch(config)#do 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 + + 172.16.0.0/24 is subnetted, 1 subnets +C 172.16.0.0 is directly connected, FastEthernet0/1 +O 192.168.3.0/24 [110/2] via 172.16.0.2, 00:03:25, FastEthernet0/1 +C 192.168.100.0/24 is directly connected, Vlan100 +C 192.168.200.0/24 is directly connected, Vlan200 + + +路由器: +Router(config)#interface FastEthernet0/1 +Router(config-if)#ip address 192.168.3.254 255.255.255.0 +Router(config-if)#interface FastEthernet0/0 +Router(config-if)#ip address 172.16.0.2 255.255.255.0 +Router(config-if)#ex +Router(config)#router ospf 1 +Router(config-router)#network 192.168.3.0 0.0.0.255 area 0 +Router(config-router)#network 172.16.0.0 0.0.0.255 area 0 +Router(config-router)# +00:06:41: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.200.254 on FastEthernet0/0 from LOADING to FULL, Loading Done + +Router(config-router)#ex +Router(config)#do show r +Building configuration... +! +interface FastEthernet0/0 + ip address 172.16.0.2 255.255.255.0 + duplex auto + speed auto +! +interface FastEthernet0/1 + ip address 192.168.3.254 255.255.255.0 + duplex auto + speed auto + ! +router ospf 1 + log-adjacency-changes + network 192.168.3.0 0.0.0.255 area 0 + network 172.16.0.0 0.0.0.255 area 0 +! +Router(config)#do 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 + + 172.16.0.0/24 is subnetted, 1 subnets +C 172.16.0.0 is directly connected, FastEthernet0/0 +C 192.168.3.0/24 is directly connected, FastEthernet0/1 +O 192.168.100.0/24 [110/2] via 172.16.0.1, 00:03:06, FastEthernet0/0 +O 192.168.200.0/24 [110/2] via 172.16.0.1, 00:03:06, FastEthernet0/0 + +``` + diff --git "a/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.11\346\224\271\351\224\231.png" "b/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.11\346\224\271\351\224\231.png" new file mode 100644 index 0000000000000000000000000000000000000000..f492dfb0fcd01adfd3487542f8c92216c1ea5590 Binary files /dev/null and "b/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.11\346\224\271\351\224\231.png" differ diff --git "a/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.11\346\224\271\351\224\2311.png" "b/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.11\346\224\271\351\224\2311.png" new file mode 100644 index 0000000000000000000000000000000000000000..e5c3495af350b3bab48614463c3af8e6b2913504 Binary files /dev/null and "b/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.11\346\224\271\351\224\2311.png" differ diff --git "a/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.11\347\273\203\344\271\2401.png" "b/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.11\347\273\203\344\271\2401.png" new file mode 100644 index 0000000000000000000000000000000000000000..9b34f96a5cb20ccc1fa2c70b140fb3b1bb73aab9 Binary files /dev/null and "b/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.11\347\273\203\344\271\2401.png" differ diff --git "a/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.11\347\273\203\344\271\2402.png" "b/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.11\347\273\203\344\271\2402.png" new file mode 100644 index 0000000000000000000000000000000000000000..b191fa6aca66e37a53895d14b78dc98da325cff8 Binary files /dev/null and "b/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.11\347\273\203\344\271\2402.png" differ diff --git "a/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.13rip\344\275\234\344\270\232.png" "b/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.13rip\344\275\234\344\270\232.png" new file mode 100644 index 0000000000000000000000000000000000000000..ed4b899472cbbba484f41910844f87c87e5065b2 Binary files /dev/null and "b/04\351\231\210\345\277\203\350\214\271/\346\210\252\345\233\276/\346\210\252\345\233\2765.13rip\344\275\234\344\270\232.png" differ