文档章节

DHCP中继服务原理及实验

o
 osc_38nccbkz
发布于 07/01 15:49
字数 1250
阅读 16
收藏 0

精选30+云产品,助力企业轻松上云!>>>

目录

1.DHCP的原理

2.DHCP作用

3.DHCP 的租约过程的四个步骤

4,实验步骤

  1.设置交换机 -创建vlan,配置acess口,配置trunk口

  2.配置路由器AR1-接口配置地址,静态路由,DHCP中继分配

  3.设置路由器AR3-接口配置地址,DHCP中继分配

  4.配置AR2-配置DHCP,接口配置地址,默认路由

  5.测试 - 五台PC依次测试

实验成功


1.DHCP的原理

         集中的管理、分配IP地址,使client动态的获得IP地址、Gateway地址、DNS服务器地址等信息,并能够提升地址的使用率。简单来说,DHCP就是一个不需要账号密码登录的、自动给内网机器分配IP地址等信息的协议。

2.DHCP作用

        使用 DHCP 可以减少管理员的工作量,避免 IP 地址冲突,当网络更改 IP 地址网段时不
需要再重新配置每个用户的 IP 地址,提高了 IP 地址的利用率,方便客户端的配置。

3.DHCP 的租约过程的四个步骤

(1)客户机请求IP(客户机发DHCP Discover广播包)

(2)服务器响应(服务器发DHCP Offer⼴播包)

(3)客户机选择IP(客户机发DHCP Request⼴播包)

(4)服务器确定租约(服务器发DHCP ACK广播包)

4,实验步骤

    1.设置交换机 -创建vlan,配置acess口,配置trunk口

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sys    
[Huawei]sysname SW1 
[SW1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]int e0/0/1
[SW1-Ethernet0/0/1]port link-type acess
[SW1-Ethernet0/0/1]port default vlan 10
[SW1-Ethernet0/0/1]undo shutdown
Info: Interface Ethernet0/0/1 is not shutdown.
[SW1-Ethernet0/0/1]int e0/0/2
[SW1-Ethernet0/0/2]port link-type acess
[SW1-Ethernet0/0/2]port default vlan 20
[SW1-Ethernet0/0/2]undo shutdown
Info: Interface Ethernet0/0/2 is not shutdown.
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]port link-type acess
[SW1-Ethernet0/0/3]port default vlan 10
[SW1-Ethernet0/0/3]undo shutdown
Info: Interface Ethernet0/0/3 is not shutdown.
[SW1-Ethernet0/0/3]int e0/0/4
[SW1-Ethernet0/0/4]port link-type acess
[SW1-Ethernet0/0/4]port default vlan 20
[SW1-Ethernet0/0/4]undo shutdown
Info: Interface Ethernet0/0/4 is not shutdown.
[SW1-Ethernet0/0/4]quit  
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk 
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all 
[SW1-GigabitEthernet0/0/1]undo shutdown
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[SW1-GigabitEthernet0/0/1] User interface con0 is available































  2.配置路由器AR1-接口配置地址,静态路由,DHCP中继分配

<Huawei>sys    
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip add 14.0.0.1 24
[R1-GigabitEthernet0/0/2]undo shutdown 
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[R1-GigabitEthernet0/0/2]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[R1-GigabitEthernet0/0/0]undo shutdown 
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R1-GigabitEthernet0/0/0]quit
[R1]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[R1]int g0/0/1.10
[R1-GigabitEthernet0/0/1.10]dot1q termination vid 10
[R1-GigabitEthernet0/0/1.10]ip add 192.168.10.1 24
[R1-GigabitEthernet0/0/1.10]arp broadcast enable 
[R1-GigabitEthernet0/0/1.10]un sh
Info: Interface GigabitEthernet0/0/1.10 is not shutdown.
[R1-GigabitEthernet0/0/1.10]dhcp select relay 
[R1-GigabitEthernet0/0/1.10]dhcp relay server-ip 14.0.0.2
[R1-GigabitEthernet0/0/1.10]un sh
Info: Interface GigabitEthernet0/0/1.10 is not shutdown.
[R1-GigabitEthernet0/0/1.10]int g0/0/1.20 
[R1-GigabitEthernet0/0/1.20]dot1q termination vid 20
[R1-GigabitEthernet0/0/1.20]ip add 192.168.20.1 24
[R1-GigabitEthernet0/0/1.20]arp broadcast enable 
[R1-GigabitEthernet0/0/1.20]un sh
Info: Interface GigabitEthernet0/0/1.20 is not shutdown.
[R1-GigabitEthernet0/0/1.20]dhcp select relay 
[R1-GigabitEthernet0/0/1.20]dhcp relay server-ip 14.0.0.2
[R1-GigabitEthernet0/0/1.20]un sh
Info: Interface GigabitEthernet0/0/1.20 is not shutdown.
[R1-GigabitEthernet0/0/1.20]q
[R1]ip route-static 15.0.0.0 24 12.0.0.2



































  3.设置路由器AR3-接口配置地址,DHCP中继分配

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR2
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[AR2-GigabitEthernet0/0/0]un sh 
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[AR2-GigabitEthernet0/0/0]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip add 15.0.0.1 24
[AR2-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[AR2-GigabitEthernet0/0/1]q
[AR2]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[AR2]int g0/0/1
[AR2-GigabitEthernet0/0/1]dhcp select relay 
[AR2-GigabitEthernet0/0/1]dhcp relay server-ip 14.0.0.2
[AR2-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[AR2-GigabitEthernet0/0/1


















[AR2]ip route-static 0.0.0.0 0.0.0.0 12.0.0.1 

  4.配置AR2-配置DHCP,接口配置地址,默认路由

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR3
[AR3]int g0/0/0 
[ AR3-GigabitEthernet0/0/0]ip add 14.0.0.2 24
[ AR3-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[ AR3-GigabitEthernet0/0/0]q  
[ AR3]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[ AR3]int g0/0/0
[ AR3-GigabitEthernet0/0/0]dhcp select  global 
[3-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[ AR3-GigabitEthernet0/0/0]q
[ AR3]ip pool DHCP15.0.0.0
Info: It's successful to create an IP address pool.
[ AR3-ip-pool-DHCP15.0.0.0]network 15.0.0.0 mask 24
[ AR3-ip-pool-DHCP15.0.0.0]gateway-list 15.00.0.1
[ AR3-ip-pool-DHCP15.0.0.0]dns-list 8.8.8.8 2.2.2.2 
[ AR3-ip-pool-DHCP15.0.0.0]ip pool DHCPvlan10
Info: It's successful to create an IP address pool.
[ AR3-ip-pool-DHCPvlan10]network 192.168.10.0 mask 24 
[ AR3-ip-pool-DHCPvlan10]gateway-list 192.168.10.1
[ AR3-ip-pool-DHCPvlan10]dns-list 8.8.8.8 2.2.2.2
[ AR3-ip-pool-DHCPvlan10]ip pool DHCPvlan20
Info: It's successful to create an IP address pool.
[ AR3-ip-pool-DHCPvlan20]network 192.168.20.0 mask 24  
[ AR3-ip-pool-DHCPvlan20]gateway-list 192.168.20.1
[ AR3-ip-pool-DHCPvlan20]dns-list 8.8.8.8 2.2.2.2
[ AR3-ip-pool-DHCPvlan20]q 
[ AR3]ip route-static 0.0.0.0 0.0.0.0 14.0.0.1






























   5.测试 - 五台PC依次测试

实验成功

 

 

 

 

 

 

 

 

 


 

 


 

 

 

 

o
粉丝 0
博文 56
码字总数 0
作品 0
私信 提问
加载中
请先登录后再评论。

暂无文章

DateTime2与SQL Server中的DateTime - DateTime2 vs DateTime in SQL Server

问题: Which one: 哪一个: datetime datetime2 is the recommended way to store date and time in SQL Server 2008+? 是在SQL Server 2008+中存储日期和时间的推荐方法吗? I'm aware of......

富含淀粉
今天
13
0
Linux 文件打开过多 (Too many open files)

如图是程序运行了一段时间后抛出来的一个bug, 刚开始看这个bug的时候各种网上找答案, 无外乎教你怎么改ulimit(就是linux最大打开文件数), 当然不是说改这个没有用, 作为程序开发者来说, 如果...

onedotdot
今天
25
0
ZStack实践汇|ZStack与行云管家对接实践ZStack与行云管家对接实践

一、ZStack与行云管家概述 大道至简·极速部署,ZStack致力于产品化私有云和混合云。 ZStack是一家坚持自主创新、专注产品化的云计算公司,以“降低企业上云门槛、让每一家企业都拥有自己的云...

ZStack社区版
今天
7
0
switch linux mint 20 apt repository to tsinghua' mirrors

edit file /etc/apt/sources.list.d/cat official-package-repositories.list lwk@qwfys:/etc/apt/sources.list.d$ lltotal 12drwxr-xr-x 2 root root 4096 Jul 5 20:01 ./drwxr-xr-x 7 ......

qwfys
今天
12
0
面试系列之C++的对象布局【建议收藏】

我们都知道C++多态是通过虚函数表来实现的,那具体是什么样的大家清楚吗?开篇依旧提出来几个问题: 普通类对象是什么布局? 带虚函数的类对象是什么布局? 单继承下不含有覆盖函数的类对象是...

伊牙牙嘿哈哈
今天
17
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部