实验一 DHCP
1. 拓扑图
2. 实验要求
1.全网IP地址段为192.168.1.0/24
2.所有pc通过DHCP获取IP地址
3.全网可达
3.分析
1.子网划分 192.168.1.0/25 192.168.1.128/25
2.配置接口IP地址
3.启动DHCP服务
4.创建池塘、定义网段、配置网关、设置DNS、路由接口IP设置、激活接口DHCP功能
5.pc端配置改为DHCP
6.查看获取的IP地址信息
7.测试全网可通
4.规划IP地址
5.配置
1.路由器配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname R1 //修改设备名
[R1]int GigabitEthernet 0/0/0 //进入接口
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 25 //配置IP
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.129 25
[R1-GigabitEthernet0/0/1]quit
2.查看接口信息
3.启动DHCP服务
[R1]dhcp enable //启动DHCP服务
Info: The operation may take a few seconds. Please wait for a moment.done.
[R1]ip pool 1 //创建池塘
Info: It's successful to create an IP address pool.
[R1-ip-pool-1]network 192.168.1.0 mask 25 //加入网段
[R1-ip-pool-1]gateway-list 192.168.1.1 //配置网关
[R1-ip-pool-1]dns-list 8.8.8.8 //配置DNS服务器地址
[R1-ip-pool-1]lease day 1 hour 5 //更改租期时间
[R1-ip-pool-1]quit
[R1]ip pool 2
Info: It's successful to create an IP address pool.
[R1-ip-pool-2]network 192.168.1.128 mask 25
[R1-ip-pool-2]gateway-list 192.168.1.129
[R1-ip-pool-2]dns-list 8.8.8.8
[R1-ip-pool-2]quit
4.在接口激活DHCP功能
5.查看地址池
6.将所有PC端IP改为DHCP,自动获取DNS服务器地址
7.ipconfig 查看获取的IP地址信息
6.结果:用PC1 ping 测试是否全网可达
实验二 静态路由
1.拓扑图
2.实验要求:全网可达
3.分析
1.配置路由器,给对应接口配置IP
2.配置PC
3.ping测试
4.实验过程
- 路由器R1 R2 R3网关、静态路由的配置
R1:
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname R1 //改名
[R1]int GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 30
[R1-GigabitEthernet0/0/0]quit
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.1 24
[R1-GigabitEthernet0/0/1]quit
[R1]ip route-static 192.168.2.0 24 12.1.1.2 //配置静态路由
[R1]ip route-static 23.1.1.0 30 12.1.1.2
[R1]ip route-static 192.168.3.0 24 12.1.1.2
R2:
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname R2
[R2]int GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 12.1.1.2 30
[R2-GigabitEthernet0/0/0]quit
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 23.1.1.1 30
[R2-GigabitEthernet0/0/1]quit
[R2]int g0/0/2
[R2-GigabitEthernet0/0/2]ip address 192.168.2.1 24
[R2-GigabitEthernet0/0/2]quit
[R2]ip route-static 192.168.1.0 24 12.1.1.1
[R2]ip route-static 192.168.3.0 24 23.1.1.2
R3:
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname R3
[R3]int GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 23.1.1.2 30
[R3-GigabitEthernet0/0/0]quit
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.3.1 24
[R3-GigabitEthernet0/0/1]quit
[R3]ip route-static 192.168.1.0 24 23.1.1.1
[R3]ip route-static 12.1.1.0 30 23.1.1.1
[R3]ip route-static 192.168.2.0 24 23.1.1.1
- 检测R1、R2、R3是否配置成功
R1:
[R1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 12.1.1.1/30 up up
GigabitEthernet0/0/1 192.168.1.1/24 up up
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
R2:
[R2]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 0
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 12.1.1.2/30 up up
GigabitEthernet0/0/1 23.1.1.1/30 up up
GigabitEthernet0/0/2 192.168.2.1/24 up up
NULL0 unassigned up up(s)
R3:
[R3]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 23.1.1.2/30 up up
GigabitEthernet0/0/1 192.168.3.1/24 up up
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
- 配置PC1、PC2 、PC3
PC1:
PC2:
PC3:
5.实验结果 ping
1.PC1 ping PC2、PC3
2.PC2 ping PC3