From 569a1c878d2dae4ffc17f0b53ce3e230f7235851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=88=90=E8=B1=AA?= <1400383615@qq.com> Date: Sat, 26 Apr 2025 20:09:20 +0800 Subject: [PATCH 1/2] 0426 --- .../20250426 DHCP.md" | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 "29 \346\235\250\346\210\220\350\261\252/20250426 DHCP.md" diff --git "a/29 \346\235\250\346\210\220\350\261\252/20250426 DHCP.md" "b/29 \346\235\250\346\210\220\350\261\252/20250426 DHCP.md" new file mode 100644 index 0000000..9b11454 --- /dev/null +++ "b/29 \346\235\250\346\210\220\350\261\252/20250426 DHCP.md" @@ -0,0 +1,142 @@ +#### 作业一 + +##### 实验一 + +![0425实验1](https://gitee.com/yuszz/picture-warehouse/raw/master/img/upgit_20250426_1745668223.png) + +```cmd +#基本步骤 +! 进入全局配置模式 +Router> enable +Router# configure terminal +! 创建DHCP地址池 +Router(config)# ip dhcp pool LAN_POOL(名称) +! 配置网络地址和子网掩码 +Router(dhcp-config)# network 192.168.1.0 255.255.255.0 +! 配置默认网关 +Router(dhcp-config)# default-router 192.168.1.1 +! 配置DNS服务器 +Router(dhcp-config)# dns-server 8.8.8.8 +! 配置租约时间(可选,默认为1天) +Router(dhcp-config)# lease 7 [非所有版本的模拟器支持] +! 退出DHCP配置模式 +Router(dhcp-config)# exit +! 排除不分配的IP地址范围 ,比如网关 +Router(config)# ip dhcp excluded-address 192.168.1.100 192.168.1.254 + + +#验证 +! 查看DHCP地址池配置 +Router# show ip dhcp pool +! 查看DHCP绑定信息 +Router# show ip dhcp binding +! 查看DHCP冲突记录 +Router# show ip dhcp conflict + +#排错 +! 清除DHCP绑定(谨慎使用) +Router# clear ip dhcp binding * +``` + +##### 实验二 + +![0426实验2](https://gitee.com/yuszz/picture-warehouse/raw/master/img/upgit_20250426_1745668457.png) + +```cmd +#关键命令 +! +interface GigabitEthernet0/0 + ip address 192.168.100.254 255.255.255.0 + duplex auto + speed auto +! +interface GigabitEthernet0/1 + ip address 192.168.10.254 255.255.255.0 + ip helper-address 192.168.100.100 + duplex auto + speed auto +! +interface GigabitEthernet0/2 + ip address 192.168.20.254 255.255.255.0 + ip helper-address 192.168.100.100 + duplex auto + speed auto +! +``` + +服务器dhcp配置 + +![0426试验202](https://gitee.com/yuszz/picture-warehouse/raw/master/img/upgit_20250426_1745668704.png) + +#### 作业二 + +![0426试验202](https://gitee.com/yuszz/picture-warehouse/raw/master/img/upgit_20250426_1745668955.png) + +```cmd +关键配置 +#路由器0 +! +interface GigabitEthernet0/1 + ip address 192.168.10.254 255.255.255.0 + ip helper-address 192.168.100.100 + duplex auto + speed auto +! +router rip + version 2 + network 20.0.0.0 + network 192.168.10.0 +! +#路由器1 +! +router ospf 1 + log-adjacency-changes + network 192.168.100.0 0.0.0.255 area 0 + network 10.0.0.0 0.0.0.255 area 0 +! +#路由器2 +interface GigabitEthernet0/1 + ip address 192.168.30.254 255.255.255.0 + ip helper-address 192.168.100.100 + duplex auto + speed auto + ! +ip classless +ip route 192.168.10.0 255.255.255.0 40.0.0.1 +ip route 192.168.20.0 255.255.255.0 40.0.0.1 +ip route 192.168.100.0 255.255.255.0 40.0.0.1 +! +#路由器3 +! +interface GigabitEthernet0/1 + ip address 192.168.20.254 255.255.255.0 + ip helper-address 192.168.100.100 + duplex auto + speed auto +! +! +router ospf 1 + log-adjacency-changes + network 30.0.0.0 0.0.0.255 area 0 + network 192.168.20.0 0.0.0.255 area 0 +! +#三层交换机 +! +router ospf 1 + log-adjacency-changes + redistribute rip subnets + redistribute static subnets + network 30.0.0.0 0.0.0.255 area 0 + network 10.0.0.0 0.0.0.255 area 0 +! +router rip + version 2 + redistribute ospf 1 metric 5 + redistribute static + network 20.0.0.0 +! +ip classless +ip route 192.168.30.0 255.255.255.0 40.0.0.2 +! +``` + -- Gitee From cbe315fad666322c771cf04a72c1d0f6b8d9a4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=88=90=E8=B1=AA?= <1400383615@qq.com> Date: Sat, 26 Apr 2025 20:10:51 +0800 Subject: [PATCH 2/2] 0426 --- .../20250425 DHCP.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "29 \346\235\250\346\210\220\350\261\252/20250426 DHCP.md" => "29 \346\235\250\346\210\220\350\261\252/20250425 DHCP.md" (100%) diff --git "a/29 \346\235\250\346\210\220\350\261\252/20250426 DHCP.md" "b/29 \346\235\250\346\210\220\350\261\252/20250425 DHCP.md" similarity index 100% rename from "29 \346\235\250\346\210\220\350\261\252/20250426 DHCP.md" rename to "29 \346\235\250\346\210\220\350\261\252/20250425 DHCP.md" -- Gitee