From e837fbf4c94fd26a177ff99e4332535f17365bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=A9=89=E6=80=9D?= <2407414505@qq.com> Date: Wed, 20 May 2026 21:46:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...VI\347\232\204\344\275\277\347\224\250.md" | 94 ++++++++ ...31\346\200\201\350\267\257\347\224\261.md" | 134 +++++++++++ ...350\275\254\345\212\250\346\200\201RIP.md" | 139 +++++++++++ ...50\267\257\347\224\261\344\271\213OSPF.md" | 226 ++++++++++++++++++ .../20260514 DHCP\345\222\214DNS.md" | 135 +++++++++++ 5 files changed, 728 insertions(+) create mode 100644 "47 \350\265\265\345\251\211\346\200\235/20260429 SVI\347\232\204\344\275\277\347\224\250.md" create mode 100644 "47 \350\265\265\345\251\211\346\200\235/20260509 \351\235\231\346\200\201\350\267\257\347\224\261.md" create mode 100644 "47 \350\265\265\345\251\211\346\200\235/20260512 \351\235\231\346\200\201\350\267\257\347\224\261\350\275\254\345\212\250\346\200\201RIP.md" create mode 100644 "47 \350\265\265\345\251\211\346\200\235/20260513 \345\212\250\346\200\201\350\267\257\347\224\261\344\271\213OSPF.md" create mode 100644 "47 \350\265\265\345\251\211\346\200\235/20260514 DHCP\345\222\214DNS.md" diff --git "a/47 \350\265\265\345\251\211\346\200\235/20260429 SVI\347\232\204\344\275\277\347\224\250.md" "b/47 \350\265\265\345\251\211\346\200\235/20260429 SVI\347\232\204\344\275\277\347\224\250.md" new file mode 100644 index 00000000..eba0babc --- /dev/null +++ "b/47 \350\265\265\345\251\211\346\200\235/20260429 SVI\347\232\204\344\275\277\347\224\250.md" @@ -0,0 +1,94 @@ +# 20260429 SVI的使用 + +## 一、实验拓扑 + +![屏幕截图 2026-05-18 231422](https://gitee.com/zhao-wansi0324/gallery/raw/master/pic/upgit_20260518_1779117767.png) + +#### 交换机配置 + +```bash +Switch>ena +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#vlan 2 +Switch(config-vlan)#name vlan2 +Switch(config-vlan)#vlan 3 +Switch(config-vlan)#name vlan3 +Switch(config-vlan)#exit +Switch(config)#inter f0/2 +Switch(config-if)#sw mode access +Switch(config-if)#sw access vlan 2 +Switch(config-if)#no shutdown +Switch(config-if)#exit +Switch(config)#inter f0/3 +Switch(config-if)#sw mode access +Switch(config-if)#sw access vlan 3 +Switch(config-if)#no shutdown +Switch(config-if)#exit +Switch(config)#inter f0/1 +Switch(config-if)#sw mode trunk + +Switch(config-if)# +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up + +Switch(config-if)#sw trunk allowed vlan 2,3 +Switch(config-if)#no shutdown +Switch(config-if)#end +``` + + + +#### 三层交换机配置 + +```bash +Switch>ena +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#ip routing +Switch(config)#vlan 2 +Switch(config-vlan)#name vlan2 +Switch(config-vlan)#vlan 3 +Switch(config-vlan)#name vlan3 +Switch(config-vlan)#inter vlan 2 +Switch(config-if)# +%LINK-5-CHANGED: Interface Vlan2, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to up + +Switch(config-if)#ip address 192.168.1.1 255.255.255.0 +Switch(config-if)#no shutdown +Switch(config-if)#exit +Switch(config)#inter vlan 3 +Switch(config-if)# +%LINK-5-CHANGED: Interface Vlan3, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state to up + +Switch(config-if)#ip address 192.168.2.1 255.255.255.0 +Switch(config-if)#no shutdown +Switch(config-if)#exit +Switch(config)#inter f0/1 +Switch(config-if)#sw trunk enca +% Incomplete command. +Switch(config-if)#sw trunk encapsulation +% Incomplete command. +Switch(config-if)#switchport trunk encapsulation dot1q +Switch(config-if)#switchport mode trunk +Switch(config-if)#switchport trunk allowed vlan 2,3 +Switch(config-if)#no shutdown +Switch(config-if)#exit +Switch(config)#inter f0/2 +Switch(config-if)#switchport mode access +Switch(config-if)#switchport access vlan 2 +Switch(config-if)#no shutdown +Switch(config-if)#end +Switch# +%SYS-5-CONFIG_I: Configured from console by console + +``` + +#### 链路测试 + +![屏幕截图 2026-05-18 231752](https://gitee.com/zhao-wansi0324/gallery/raw/master/pic/upgit_20260518_1779117774.png)![屏幕截图 2026-05-18 231629](https://gitee.com/zhao-wansi0324/gallery/raw/master/pic/upgit_20260518_1779117779.png) diff --git "a/47 \350\265\265\345\251\211\346\200\235/20260509 \351\235\231\346\200\201\350\267\257\347\224\261.md" "b/47 \350\265\265\345\251\211\346\200\235/20260509 \351\235\231\346\200\201\350\267\257\347\224\261.md" new file mode 100644 index 00000000..810effd5 --- /dev/null +++ "b/47 \350\265\265\345\251\211\346\200\235/20260509 \351\235\231\346\200\201\350\267\257\347\224\261.md" @@ -0,0 +1,134 @@ +# 20260509 静态路由 + +### 实验拓扑 + +![屏幕截图 2026-05-19 221622](https://gitee.com/zhao-wansi0324/gallery/raw/master/pic/upgit_20260519_1779200465.png) + +```bash +##路由器0配置 +Router>enable +Router# +Router#configure terminal +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)# +Router(config)# +Router(config)#hostname R0 +R0(config)#inter f0/0 +R0(config-if)#ip address 192.168.1.254 255.255.255.0 +R0(config-if)#no shutdown + +R0(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up + +R0(config-if)#exit +R0(config)#inter serial2/0 +R0(config-if)#ip address 10.254.10.1 255.255.255.0 +R0(config-if)#clock rate 64000 +R0(config-if)#no shutdown + +%LINK-5-CHANGED: Interface Serial2/0, changed state to down +R0(config-if)#exit +R0(config)#end +R0# +%SYS-5-CONFIG_I: Configured from console by conso +R0>ena +R0#conf t +Enter configuration commands, one per line. End with CNTL/Z. +R0(config)#ip route 192.168.2.0 255.255.255.0 +% Incomplete command. +R0(config)#ip route 192.168.2.0 255.255.255.0 10.254.10.2 +R0(config)#ip route 192.168.3.0 255.255.255.0 10.254.10.2 +R0(config)#exit +``` + + + +```bash +##路由器1配置 +Router>ena +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#hostname R1 +R1(config)#inter f0/0 +R1(config-if)#ip address 192.168.2.254 255.255.255.0 +R1(config-if)#no shutdown + +R1(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up + +R1(config-if)#exit +R1(config)#inter serial2/0 +R1(config-if)#ip address 10.254.10.2 255.255.255.0 +R1(config-if)#no shutdown + +R1(config-if)# +%LINK-5-CHANGED: Interface Serial2/0, changed state to up + +R1(config-if)#exit +R1(config)#in +%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up + +% Incomplete command. +R1(config)#inter serial3/0 +R1(config-if)#ip address 20.20.10.1 255.255.255.0 +R1(config-if)#clock rate 64000 +This command applies only to DCE interfaces +R1(config-if)#no shutdown + +%LINK-5-CHANGED: Interface Serial3/0, changed state to down +R1(config-if)#exit +R1(config)#end +R1# +%SYS-5-CONFIG_I: Configured from console by console +R1>ena +R1#conf t +Enter configuration commands, one per line. End with CNTL/Z. +R1(config)#ip route 192.168.1.0 255.255.255.0 10.254.10.1 +R1(config)#ip route 192.168.3.0 255.255.255.0 20.20.10.2 +R1(config)#exit +``` + + + +```bash +##路由器2配置 +Router>ena +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#hostname R2 +R2(config)#inter f0/0 +R2(config-if)#ip address 192.168.3.254 255.255.255.0 +R2(config-if)#no shutdown + +R2(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up + +R2(config-if)#exit +R2(config)#inter serial3/0 +R2(config-if)#ip address 20.20.10.2 255.255.255.0 +R2(config-if)#no shutdown + +R2(config-if)# +%LINK-5-CHANGED: Interface Serial3/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/0, changed state to up + +R2(config-if)#exit +R2(config)#end +R2# +%SYS-5-CONFIG_I: Configured from console by console +R2>ena +R2#conf t +Enter configuration commands, one per line. End with CNTL/Z. +R2(config)#ip route 192.168.1.0 255.255.255.0 20.20.10.1 +R2(config)#ip route 192.168.2.0 255.255.255.0 20.20.10.1 +R2(config)#exit +``` + +![屏幕截图 2026-05-19 221834](https://gitee.com/zhao-wansi0324/gallery/raw/master/pic/upgit_20260519_1779200527.png)![屏幕截图 2026-05-19 221821](https://gitee.com/zhao-wansi0324/gallery/raw/master/pic/upgit_20260519_1779200532.png) \ No newline at end of file diff --git "a/47 \350\265\265\345\251\211\346\200\235/20260512 \351\235\231\346\200\201\350\267\257\347\224\261\350\275\254\345\212\250\346\200\201RIP.md" "b/47 \350\265\265\345\251\211\346\200\235/20260512 \351\235\231\346\200\201\350\267\257\347\224\261\350\275\254\345\212\250\346\200\201RIP.md" new file mode 100644 index 00000000..33e6addc --- /dev/null +++ "b/47 \350\265\265\345\251\211\346\200\235/20260512 \351\235\231\346\200\201\350\267\257\347\224\261\350\275\254\345\212\250\346\200\201RIP.md" @@ -0,0 +1,139 @@ +# 20260512 静态路由转动态RIP + + + +## 一、实验拓扑![image-20260512171433173](https://gitee.com/zhao-wansi0324/gallery/raw/master/pic/upgit_20260518_1779117820.png) + +## 二、实验步骤 + + + +```bash +##多层交换机 +Switch>ena +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#vlan 10 +Switch(config-vlan)#name van10 +Switch(config-vlan)#vlan 20 +Switch(config-vlan)#name van20 +Switch(config-vlan)#exit +Switch(config)#inter range f0/1,fa0/3 +Switch(config-if-range)#sw access vlan 10 +Switch(config-if-range)#exit +Switch(config)#inter f0/2 +Switch(config-if)#sw access vlan 20 +Switch(config-if)#exit +Switch(config)#ip routing +Switch(config)#interface vlan 10 +Switch(config-if)# +%LINK-5-CHANGED: Interface Vlan10, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up + +Switch(config-if)#ip address 192.168.1.1 255.255.255.0 +Switch(config-if)#exit +Switch(config)#interface vlan 20 +Switch(config-if)# +%LINK-5-CHANGED: Interface Vlan20, changed state to up + +Switch(config-if)#ip address 192.168.3.1 255.255.255.0 +Switch(config-if)#exit +Switch(config)#router rip +Switch(config-router)#version 2 +Switch(config-router)#network 192.168.1.0 +Switch(config-router)#network 192.168.3.0 +Switch(config-router)#end +Switch# +%SYS-5-CONFIG_I: Configured from console by console + +``` + + + + + +```bash +##路由器0 基本配置 +Router>ena +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter f0/0 +Router(config-if)#ip address 192.168.3.2 255.255.255.0 +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up + +Router(config-if)#exit +Router(config)#interface serial 2/0 +Router(config-if)#ip address 192.168.4.1 255.255.255.0 +Router(config-if)#clock rate 64000 +Router(config-if)#no shutdown + +%LINK-5-CHANGED: Interface Serial2/0, changed state to down +Router(config-if)#exit +Router(config)#router rip +Router(config-router)#version 2 +Router(config-router)#network 192.168.3.0 +Router(config-router)#network 192.168.4.0 +Router(config-router)#end +Router# +%SYS-5-CONFIG_I: Configured from console by console + +``` + + + + + + + +```bash +##路由器1 基本配置 +Router>ena +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#ip address 192.168.2.1 255.255.255.0 + ^ +% Invalid input detected at '^' marker. + +Router(config)#inter f0/0 +Router(config-if)#ip address 192.168.2.1 255.255.255.0 +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up + +Router(config-if)#exit +Router(config)#interface serial 2/0 +Router(config-if)#ip address 192.168.4.2 255.255.255.0 +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface Serial2/0, changed state to up + +Router(config-if)#exit +Router(config)# +%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up + +Router(config)#router rip +Router(config-router)#version 2 +Router(config-router)#network 192.168.2.0 +Router(config-router)#network 192.168.4.0 +Router(config-router)#end +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router# +``` + +##### 链路测试 + +![image-20260512171613749](https://gitee.com/zhao-wansi0324/gallery/raw/master/pic/upgit_20260518_1779117834.png) + +![image-20260512171309445](https://gitee.com/zhao-wansi0324/gallery/raw/master/pic/upgit_20260518_1779117836.png) diff --git "a/47 \350\265\265\345\251\211\346\200\235/20260513 \345\212\250\346\200\201\350\267\257\347\224\261\344\271\213OSPF.md" "b/47 \350\265\265\345\251\211\346\200\235/20260513 \345\212\250\346\200\201\350\267\257\347\224\261\344\271\213OSPF.md" new file mode 100644 index 00000000..b7884704 --- /dev/null +++ "b/47 \350\265\265\345\251\211\346\200\235/20260513 \345\212\250\346\200\201\350\267\257\347\224\261\344\271\213OSPF.md" @@ -0,0 +1,226 @@ +# 20260513 动态路由之OSPF + +### 实验拓扑 + +![屏幕截图 2026-05-20 213913](https://gitee.com/zhao-wansi0324/gallery/raw/master/pic/upgit_20260520_1779284390.png) + +```bash +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#int g0/1 +Router(config-if)#no shu +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)#ex +Router(config)#int g0/1.1 +Router(config-subif)# +%LINK-5-CHANGED: Interface GigabitEthernet0/1.1, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1.1, changed state to up + +Router(config-subif)#en +Router(config-subif)#encapsulation d +Router(config-subif)#encapsulation dot1Q 10 +Router(config-subif)#ip address 192.168.4.254 255.255.255.0 +Router(config-subif)#int g0/1.2 +Router(config-subif)# +%LINK-5-CHANGED: Interface GigabitEthernet0/1.2, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1.2, changed state to up + +Router(config-subif)#en +Router(config-subif)#encapsulation d +Router(config-subif)#encapsulation dot1Q 20 +Router(config-subif)#ip address 192.168.5.254 255.255.255.0 +Router(config-subif)#ex +Router(config)#int g0/0 +Router(config-if)#no shu +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)#ip address 192.168.2.1 255.255.255.0 +Router(config-if)#ex +Router(config)#int g0/2 +Router(config-if)#no shu +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up + +Router(config-if)#ip address 192.168.1.10 255.255.255.0 +Router(config-if)#ex +Router(config)# +``` + +```bash +Router> +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#int g0/1 +Router(config-if)#no shu +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 address 192.168.9.254 255.255.255.0 +Router(config-if)#ex +Router(config)#int g0/0 +Router(config-if)#no shu +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)#ip address 192.168.3.2 255.255.255.0 +Router(config-if)#ex +Router(config)# +``` + +```bash +Switch> +Switch>en +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#vlan 30 +Switch(config-vlan)#vlan 40 +Switch(config-vlan)#ex +Switch(config)#int vlan 30 +Switch(config-if)# +%LINK-5-CHANGED: Interface Vlan30, changed state to up + +Switch(config-if)#ip address 192.168.6.254 255.255.255.0 +Switch(config-if)#ex +Switch(config)#int vlan 40 +Switch(config-if)# +%LINK-5-CHANGED: Interface Vlan40, changed state to up + +Switch(config-if)#ip address 192.168.7.254 255.255.255.0 +Switch(config-if)#ex +Switch(config)#^Z +Switch# +%SYS-5-CONFIG_I: Configured from console by console + +Switch#show ip route +Default gateway is not set + +Host Gateway Last Use Total Uses Interface +ICMP redirect cache is empty + +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#ip routing +Switch(config)#end +Switch# +%SYS-5-CONFIG_I: Configured from console by console + +Switch#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 + + +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#int vlan 30 +Switch(config-if)#ip address 192.168.6.254 255.255.255.0 +Switch(config-if)#int vlan 40 +Switch(config-if)#ip address 192.168.7.254 255.255.255.0 +Switch(config-if)#^Z +Switch# +%SYS-5-CONFIG_I: Configured from console by console + +Switch#show ip route +Switch# +Switch#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Switch(config)#int f0/2 +Switch(config-if)#no sw +Switch(config-if)#no switchport +Switch(config-if)# +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up + +Switch(config-if)#ip address 192.168.3.1 255.255.255.0 +Switch(config-if)#ex +Switch(config)#int f0/1 +Switch(config-if)#no sw +Switch(config-if)#no switchport +Switch(config-if)# +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up + +Switch(config-if)#ip address 192.168.2.2 255.255.255.0 +Switch(config-if)#ex +Switch(config)# +``` + +### 测试 + +```bash +C:\>ping 192.168.5.1 + +Pinging 192.168.5.1 with 32 bytes of data: + +Request timed out. +Reply from 192.168.5.1: bytes=32 time<1ms TTL=127 +Reply from 192.168.5.1: bytes=32 time<1ms TTL=127 +Reply from 192.168.5.1: bytes=32 time<1ms TTL=127 + +Ping statistics for 192.168.5.1: + Packets: Sent = 4, Received = 3, Lost = 1 (25% loss), +Approximate round trip times in milli-seconds: + Minimum = 0ms, Maximum = 0ms, Average = 0ms + +C:\>ping 192.168.6.1 + +Pinging 192.168.6.1 with 32 bytes of data: + +Reply from 192.168.4.254: Destination host unreachable. +Reply from 192.168.4.254: Destination host unreachable. +Reply from 192.168.4.254: Destination host unreachable. +Reply from 192.168.4.254: Destination host unreachable. + +Ping statistics for 192.168.6.1: + Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), + +C:\>ping 192.168.9.1 + +Pinging 192.168.9.1 with 32 bytes of data: + +Reply from 192.168.4.254: Destination host unreachable. +Reply from 192.168.4.254: Destination host unreachable. +Reply from 192.168.4.254: Destination host unreachable. +Reply from 192.168.4.254: Destination host unreachable. + +Ping statistics for 192.168.9.1: + Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), + + +``` + diff --git "a/47 \350\265\265\345\251\211\346\200\235/20260514 DHCP\345\222\214DNS.md" "b/47 \350\265\265\345\251\211\346\200\235/20260514 DHCP\345\222\214DNS.md" new file mode 100644 index 00000000..613fd34c --- /dev/null +++ "b/47 \350\265\265\345\251\211\346\200\235/20260514 DHCP\345\222\214DNS.md" @@ -0,0 +1,135 @@ +# 20260514 DHCP和DNS + +### 实验拓扑 + +![屏幕截图 2026-05-20 214218](https://gitee.com/zhao-wansi0324/gallery/raw/master/pic/upgit_20260520_1779284604.png) + +```bash +##路由器一 +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#int Serial 0/0/0 +Router(config-if)#ip address 172.16.0.1 255.255.0.0 +Router(config-if)#ex +Router(config)# +Router(config)#int f0/0 +Router(config-if)#ip add +Router(config-if)#ip address 192.168.1.1 255.255.255.0 +Router(config-if)#no sh +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up + +Router(config-if)#ex +Router(config)#int f0/1 +Router(config-if)#ip add +Router(config-if)#ip address 192.168.2.1 255.255.255.0 +Router(config-if)#no sh +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up + +Router(config-if)#ex +Router(config)#int Se +Router(config)#int Serial 0/0/0 +Router(config-if)#ip add +Router(config-if)#ip address 10.0.0.1 255.255.255.0 +Router(config-if)#no sh +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up + +Router(config-if)#ex +%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up + +Router(config)#ip route 192.168.3.0 255.255.255.0 20.0.0.2 +Router(config)#serv +Router(config)#service dhcp +Router(config)#ip dhcp pool mm +Router(dhcp-config)#net +Router(dhcp-config)#network 192.168.1.0 255.255.255.0 +Router(dhcp-config)#defau +Router(dhcp-config)#default-router 192.168.1.1 +Router(dhcp-config)#ex +Router(config)#serv +Router(config)#service dhcp +Router(config)#ip dh +Router(config)#ip dhcp pool ff +Router(dhcp-config)#net +Router(dhcp-config)#network 192.168.2.0 255.255.255.0 +Router(dhcp-config)#def +Router(dhcp-config)#default-router 192.168.2.1 +Router(dhcp-config)#ex +Router(config)# +Router(config)#int f0/0 +Router(config-if)#ip help +Router(config-if)#ip helper-address 192.168.3.2 +Router(config-if)#ex +Router(config)#int f0/1 +Router(config-if)#ip help +Router(config-if)#ip helper-address 192.168.3.2 +Router(config-if)#ex +Router(config)# +%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to down + +%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up + + +``` + + + +```bash +##路由器二 +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#int Se +Router(config)#int Serial 0/0/0 +Router(config-if)#ip add +Router(config-if)#ip address 172.16.0.2 255.255.0.0 +Router(config-if)#ex +Router(config)# +Router(config)#int f0/0 +Router(config-if)#ip add +Router(config-if)#ip address 192.168.3.1 255.255.255.0 +Router(config-if)#no sh +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up + +Router(config-if)#ex +Router(config)#int Se +Router(config)#int Serial 0/0/0 +Router(config-if)#ip add +Router(config-if)#ip address 10.0.0.2 255.255.255.0 +Router(config-if)#no sh +Router(config-if)#no shutdown + +%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down +Router(config-if)#ex +Router(config)#ex +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router# +%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up + +%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to down + +%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up +``` + -- Gitee