

DHCP&OSPF组合实验演示(Huawei路由交换设备配置)
source link: https://blog.51cto.com/satantiantian/5543917
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

DHCP&OSPF组合实验演示(Huawei路由交换设备配置)
原创一、背景介绍
该实验通过DHCP与OSPF组合模拟中小型网络部署环境。
二、中小型网络实验目的
PC1和PC2实现IP地址动态管理;
可以和出口路由器Router连通。
三、实验拓扑

四、实验配置
(1)PC1,PC2选择为DHCP自动获取。


(2)DHCP配置——接入交换机acsw配置
<Huawei>sys
#进入系统视图
[Huawei]sysname acsw
#修改交换机名称为acsw
[acsw]vlan batch 10 20
#创建vlan10和20
[acsw]un in en
#关闭日志提示
[acsw]interface g0/0/1
#进入接口
[acsw-GigabitEthernet0/0/1]port link-type access
#接口配成access模式
[acsw-GigabitEthernet0/0/1]port default vlan 10
#配置接口VLAN 10
[acsw-GigabitEthernet0/0/1]int g0/0/2
[acsw-GigabitEthernet0/0/2]port link-type access
[acsw-GigabitEthernet0/0/2]port default vlan 20
[acsw-GigabitEthernet0/0/2]q
[acsw]int g0/0/3
[acsw-GigabitEthernet0/0/3]port link-type trunk
#接口配成trunk模式
[acsw-GigabitEthernet0/0/3]port trunk allow-pass vlan all
#允许所有vlan通过
[acsw-GigabitEthernet0/0/3]q
(3)DHCP——核心交换机coresw配置
<Huawei>system-view
[Huawei]sysname coresw
[coresw]un in en
[coresw]vlan batch 10 20 30
[coresw]interface g0/0/3
[coresw-GigabitEthernet0/0/3]port link-type trunk
[coresw-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[coresw-GigabitEthernet0/0/3]q
[coresw]int Vlanif 10
[coresw-Vlanif10]ip add 192.168.10.254 24
#配置vlan10的网关
[coresw-Vlanif10]int Vlanif 20
[coresw-Vlanif20]ip add 192.168.20.254 24
#配置vlan20的网关
[coresw-Vlanif20]q
[coresw]dhcp enable
#开启DHCP功能
[coresw]ip pool vlan10
#创建地址池名字是vlan10
[coresw-ip-pool-vlan10]network 192.168.10.0 mask 24
#地址池下发网段
[coresw-ip-pool-vlan10]gateway-list 192.168.10.254
#地址池下发网关
[coresw-ip-pool-vlan10]dns-list 8.8.8.8
#地址池下发dns地址
[coresw-ip-pool-vlan10]excluded-ip-address 192.168.10.2 192.168.10.253
#地址不下发范围
[coresw-ip-pool-vlan10]lease day 3
#租期为3天
[coresw-ip-pool-vlan10]q
[coresw]int Vlanif 10
[coresw-Vlanif10]dhcp select global
[coresw]ip pool vlan20
[coresw-ip-pool-vlan20]network 192.168.20.0 mask 24
[coresw-ip-pool-vlan20]gateway-list 192.168.20.254
[coresw-ip-pool-vlan20]dns-list 114.114.114.114
[coresw-ip-pool-vlan20]excluded-ip-address 192.168.20.2 192.168.20.253
[coresw-ip-pool-vlan20]lease day 5
[coresw-ip-pool-vlan20]q
[coresw]int Vlanif 20
[coresw-Vlanif20]dhcp select global
[coresw-Vlanif20]q
#DHCP功能配置完成,下面开始配置OSFP
[coresw]ospf 1
#配置OSPF
[coresw-ospf-1]area 0
#配置成区域0
[coresw-ospf-1-area-0.0.0.0]network 192.168.10.0 0.0.0.255
#宣告网段
[coresw-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255
#宣告网段
[coresw-ospf-1-area-0.0.0.0]network 192.168.30.0 0.0.0.255
#宣告网段
(4)出口路由器Router配置
<Huawei>sy
[Huawei]sy Router
[Router]un in en
[Router]int g0/0/1
[Router-GigabitEthernet0/0/1]ip add 192.168.30.3 24
[Router]ospf 1
[Router-ospf-1]area 0
[Router-ospf-1-area-0.0.0.0]network 192.168.30.0 0.0.0.255
[Router-ospf-1-area-0.0.0.0]q
[Router-ospf-1]q
(5)验证实验
[Router]dis ospf peer brief
#查看邻居,状态已经是Full

用PC1和PC2 ping 出口路由器Router,可以ping,实验成功。


Recommend
-
65
华为认证HCIE-RS路由交换最牛合集,1000多页,牛逼了呀
-
79
某公司拥有多个部门且位于同一网段,为了提升业务安全性,将不同部门的用户划分到不同VLAN中。现由于业务需要,不同部门间的用户需要互通。所示,VLAN2和VLAN3为不同部门,现需要实现不同VLAN间的用户可以互相访问。可以在Switch上部署VLAN聚合,实现VLAN2和VLAN3...
-
5
三层交换实验图1-1 注:如无特别说明,描述中的 R1 或 SW1 对应拓扑中设备名称末尾数字为 1 的设备,R2 或 SW2 对应拓扑中设备名称末尾数字...
-
8
部署企业级路由交换网络(上)路由协议分类:距离矢量-----RIP, BGP 没地图 传闻链路状态-----OSPF, ISIS 有地图距离矢量的缺陷,按照RIP比较:1,RIP缺陷:周期更新完整路由表 2、基...
-
5
1、RIP实验演示(Huawei路由器设备配置) 原创 书上有路 2022-07-20 1...
-
7
OSPF实验演示(Huawei路由器设备配置) 原创 书上有路 2022-07-21 14...
-
4
单臂路由实验演示(Huawei路由器设备配置) 原创 书上有路 2022-07-25...
-
6
ACL实验演示(Huawei路由器设备配置) 原创 书上有路 2022-07-26 15:1...
-
10
静态路由实验演示(Huawei路由器设备配置) 精选 原创 一、静态路由介...
-
16
V2EX › 宽带症候群 想要学习网络交换和路由,请问有什么推荐的学习资料吗
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK