实操 :华为DHCP中继服务配置

前言:

该实验是华为模拟器eNSP模拟器、dhcp中继实验
#DHCP中继的应用场景:
通常在DHCP分配网段过多的情况下,网关路由器上配置DHCP服务,压力过大,
一般我们用第二路由器,或则第二台DHCP服务器来分担业务

dhcp 中继

这里设置一台专用的DHCP服务器为pc机配置IP地址

LSW1

<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname LSW1
[LSW1]un in en
Info: Information center is disabled.
[LSW1]vlan bat 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW1]int e 0/0/1
[LSW1-Ethernet0/0/1]p l a
[LSW1-Ethernet0/0/1]p d v 10
[LSW1-Ethernet0/0/1]un sh
Info: Interface Ethernet0/0/1 is not shutdown.
[LSW1-Ethernet0/0/1]int e 0/0/2
[LSW1-Ethernet0/0/2]p l a
[LSW1-Ethernet0/0/2]p d v 20
[LSW1-Ethernet0/0/2]un sh
Info: Interface Ethernet0/0/2 is not shutdown.
[LSW1-Ethernet0/0/2]int e 0/0/3
[LSW1-Ethernet0/0/3]p l a
[LSW1-Ethernet0/0/3]p d v 10
[LSW1-Ethernet0/0/3]un sh
Info: Interface Ethernet0/0/3 is not shutdown.
[LSW1-Ethernet0/0/3]int e 0/0/4
[LSW1-Ethernet0/0/4]p l a
[LSW1-Ethernet0/0/4]p d v 20
[LSW1-Ethernet0/0/4]un sh
Info: Interface Ethernet0/0/4 is not shutdown.
[LSW1-Ethernet0/0/4]int g 0/0/1
[LSW1-GigabitEthernet0/0/1]p l t
[LSW1-GigabitEthernet0/0/1]p t a v a
[LSW1-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[LSW1-GigabitEthernet0/0/1]dis vlan
The total number of vlans is : 3
1    common  UT:Eth0/0/5(D)     Eth0/0/6(D)     Eth0/0/7(D)     Eth0/0/8(D)
                Eth0/0/9(D)     Eth0/0/10(D)    Eth0/0/11(D)    Eth0/0/12(D)
                Eth0/0/13(D)    Eth0/0/14(D)    Eth0/0/15(D)    Eth0/0/16(D)
                Eth0/0/17(D)    Eth0/0/18(D)    Eth0/0/19(D)    Eth0/0/20(D)
                Eth0/0/21(D)    Eth0/0/22(D)    GE0/0/1(U)      GE0/0/2(D)
10   common  UT:Eth0/0/1(U)     Eth0/0/3(U)
             TG:GE0/0/1(U)
20   common  UT:Eth0/0/2(U)     Eth0/0/4(U)
             TG:GE0/0/1(U)
[LSW1-GigabitEthernet0/0/1]
[LSW1-GigabitEthernet0/0/1]dis int b
InUti/OutUti: input utility/output utility
Interface                   PHY   Protocol InUti OutUti   inErrors  outErrors
Ethernet0/0/1               up    up          0%     0%          0          0
Ethernet0/0/2               up    up          0%     0%          0          0
Ethernet0/0/3               up    up          0%     0%          0          0
Ethernet0/0/4               up    up          0%     0%          0          0
GigabitEthernet0/0/1        up    up          0%     0%          0          0

R1

<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 14.0.0.1 24
[Huawei-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[Huawei-GigabitEthernet0/0/0]int g 0/0/3
[Huawei-GigabitEthernet0/0/3]ip add 12.0.0.1 24
[Huawei-GigabitEthernet0/0/3]un sh
Info: Interface GigabitEthernet0/0/3 is not shutdown.
[Huawei-GigabitEthernet0/0/3]q
[Huawei]vlan bat 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int g 0/0/1.10
[Huawei-GigabitEthernet0/0/1.10]dot1q termination vid 10
[Huawei-GigabitEthernet0/0/1.10]ip add 192.168.10.1 24
[Huawei-GigabitEthernet0/0/1.10]un sh
Info: Interface GigabitEthernet0/0/1.10 is not shutdown.
[Huawei-GigabitEthernet0/0/1.10]q
[Huawei]int g 0/0/1.10
[Huawei-GigabitEthernet0/0/1.10]dis this
#
interface GigabitEthernet0/0/1.10
 dot1q termination vid 10
 ip address 192.168.10.1 255.255.255.0
#
return
[Huawei-GigabitEthernet0/0/1.10]a b e
[Huawei-GigabitEthernet0/0/1.10]dhcp select relay
[Huawei-GigabitEthernet0/0/1.10]dhcp relay server-ip 14.0.0.2
[Huawei-GigabitEthernet0/0/1.10]q
[Huawei]int g 0/0/1.20
[Huawei-GigabitEthernet0/0/1.20]dot1q termination vid 20
[Huawei-GigabitEthernet0/0/1.20]ip add 192.168.20.1 24
[Huawei-GigabitEthernet0/0/1.20]a b e
[Huawei-GigabitEthernet0/0/1.20]dhcp select relay
[Huawei-GigabitEthernet0/0/1.20]dhcp relay server-ip 14.0.0.2
[Huawei-GigabitEthernet0/0/1.20]q
[Huawei]ip route-static 15.0.0.0 24 12.0.0.2
[Huawei]

R2

<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]un in en
Info: Information center is disabled.
[R2]int g 0/0/3
[R2-GigabitEthernet0/0/3]ip add 12.0.0.2 24
[R2-GigabitEthernet0/0/3]un sh
Info: Interface GigabitEthernet0/0/3 is not shutdown.
[R2-GigabitEthernet0/0/3]int e 0/0/0
[R2-Ethernet0/0/0]q
[R2]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R2]int e 0/0/0
[R2-Ethernet0/0/0]ip add 15.0.0.1 24
[R2-Ethernet0/0/0]un sh
Info: Interface Ethernet0/0/0 is not shutdown.
[R2-Ethernet0/0/0]dhcp select relay
[R2-Ethernet0/0/0]dhcp relay server-ip 14.0.0.2
[R2-Ethernet0/0/0]q
[R2]ip route-static 14.0.0.0 24 12.0.0.1
[R2]ip route-static 192.168.0.0 16 12.0.0.1
[R2]dis ip ?
  as-path-filter       Specify regular expression access list number
  community-filter     Add a community-filter entry
  error                Information of error packet
  extcommunity-filter  Match BGP/*** extended community filter
  ha                   Display information of socket HA
  host                 Host table(s)
  interface            Show information of interfaces
  ip-prefix            Specify an address prefix-list
  ipv6-prefix          Specify an IPv6 address prefix-list
  netstream            Netstream feature
  policy-based-route   Display policy based routing information
  pool                 Configure a local IP pool
  prefix-limit         Prefix limit
  rd-filter            Route-distinguisher filter
  routing-table        Routing table
  socket               Display information of created sockets
  statistics           Display statistics information of datagram
  topology             The name of topology
  userlog              Userlog feature
  ***-instance         *** instance information
[R2]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 8        Routes : 8        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       12.0.0.0/24  Direct  0    0           D   12.0.0.2        GigabitEthernet
0/0/3
       12.0.0.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/3
       14.0.0.0/24  Static  60   0          RD   12.0.0.1        GigabitEthernet
0/0/3
       15.0.0.0/24  Direct  0    0           D   15.0.0.1        Ethernet0/0/0
       15.0.0.1/32  Direct  0    0           D   127.0.0.1       Ethernet0/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.0/16  Static  60   0          RD   12.0.0.1        GigabitEthernet
0/0/3
[R2]

R3

<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]un in en
Info: Information center is disabled.
[R3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 14.0.0.2 24
[R3-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R3-GigabitEthernet0/0/0]dhcp select global
[R3-GigabitEthernet0/0/0]q
[R3]ip pool dhcp192.168.10.0
Info:It‘s successful to create an IP address pool.
[R3-ip-pool-dhcp192.168.10.0]network 192.168.10.0 mask 24
[R3-ip-pool-dhcp192.168.10.0]gateway 192.168.10.1
[R3-ip-pool-dhcp192.168.10.0]dns-list 1.1.1.1
[R3-ip-pool-dhcp192.168.10.0]?
ip-pool view commands:
  arp-ping             ARP-ping
  ce-ping              Ce-ping tool
  configuration        Configuration interlock
  display              Display current system information
  dns-list             Configure DNS servers
  domain-name          Configure domain name
  excluded-ip-address  Mark disable IP addresses
  gateway-list         Configure the gateway
  import               Imports the following network configuration parameters
                       from a central server into local ip pool database:
                       domain name, dns server and netbios server.
  lease                Configure the lease of the IP pool
  lock                 Lock the IP pool
  mac-populate         Populate an OAM MAC to FDB entry
  mac-purge            Purge an OAM MAC from FDB entry
  monitor              System monitor dynamic show
  mtrace               Trace route to multicast source
  nbns-list            Configure the windows‘s netbios name servers
  netbios-type         Netbios node type
  network              Add a network
  next-server          The address of the server to use in the next step of the
                       client‘s bootstrap process.
  option               Configure the DHCP options
  option121            DHCP option 121
  option184            DHCP option 184
  ping                 Send echo messages
  quit                 Exit from current command view
  reset                Reset operation
  return               Exit to user view
  screen-width         Set screen width
  static-bind          Static bind
  test-aaa             Accounts test
  trace                Trace route (switch) to host on Data Link Layer
  tracert              Trace route to host
  undo                 Cancel current setting
  ***-instance         Config *** instance
  vrbd                 Display version information

[R3-ip-pool-dhcp192.168.10.0]q
[R3]ip pool dhcp192.168.20.0
Info:It‘s successful to create an IP address pool.
[R3-ip-pool-dhcp192.168.20.0]network 192.168.20.0 mask 24
[R3-ip-pool-dhcp192.168.20.0]gateway-list 192.168.20.1
[R3-ip-pool-dhcp192.168.20.0]dns-list 1.1.1.1 2.2.2.2
[R3-ip-pool-dhcp192.168.20.0]q
[R3]ip pool dhcp15.0.0.0
Info:It‘s successful to create an IP address pool.
[R3-ip-pool-dhcp15.0.0.0]network 15.0.0.0 mask 24
[R3-ip-pool-dhcp15.0.0.0]static-bind ip-address 15.0.0.88 mac-address 5489-98A
B-2A25
Error:Please configure the gateway first.
[R3-ip-pool-dhcp15.0.0.0]gateway-list 15.0.0.1
[R3-ip-pool-dhcp15.0.0.0]static-bind ip-address 15.0.0.88 mac-address 5489-98AB-
2A25
[R3-ip-pool-dhcp15.0.0.0]q
[R3]ip route-static 0.0.0.0 0.0.0.0 14.0.0.1
[R3]

结果如下


原文地址:https://blog.51cto.com/14558445/2457829

时间: 2024-09-29 22:11:06

实操 :华为DHCP中继服务配置的相关文章

DHCP中继服务配置

DHCP中继配置 DHCP(Dynamic Host Configuration Protocol,动态主机配置协议)是一个局域网的网络协议,使用UDP协议工作, 主要有两个用途:给内部网络或网络服务供应商自动分配IP地址,给用户或者内部网络管理员作为对所有计算机作中央管理的手段.DHCP有3个端口,其中UDP67和UDP68为正常的DHCP服务端口,分别作为DHCP Server和DHCP Client的服务端口;546号端口用于DHCPv6 Client,而不用于DHCPv4,是为DHCP

华为DHCP中继作用及配置

今天给大家带来一篇DHCP中继的配置及作用,在这里DHCP就不多讲了,上一遍文章中给大家提到了路由器及三层交换机的DHCP详细配置.首先咱们要先了解一下DHCP中继的作用在大型的网络中,可能会存在多个网段.DHCP客户机通过网络广播消息获得DHCP服务器的响应后得到IP地址.但广播消息是不能跨越网段的.因此,如果DHCP客户机和服务器在不同的网段内,客户机还能不能向服务器申请IP地址呢?这就要用到DHCP中继代理.DHCP中继代理实际上是一种软件技术,安装了DHCP中继代理的设备(路由器,交换机

DHCP中继服务演练(教科书式的过程演示)

听闻很多小伙伴们早就想接触dhcp中继服务实操内容,下面我们大家一起来了解下:第一步进入GNS3界面,拖取两台路由到拓扑操作区,再选择HOST拖取三台PC机到拓扑操作区:同时对两台路由器进行配置设置(改图标为交换机.更改设备名为sw2/sw3.添加二层业务单板.设置磁盘空间为100Mb)第二步搭建拓扑图所需架构:三台Host主机:一台名为DHCP,改图标为sever服务器:另外两台默认配置不变,分别改名为:win10-1和win10-2.两台路由器:一台改名为sw2,改图标为交换机,修改配置添加

GNS3与虚拟机结合实现dhcp中继服务

实验目的:通过一台linux搭建的dhcp服务,使不同网段的window主机 获得ip地址,实现dhcp中继. 实验环境:一台linux6.5 ip地址 192.168.30.20 两台win7,地址自动获得 实验拓扑如下: 一.配置R2的vlan,access.trunk R2 vlan 10,20,30 ex int f1/1 sw mo acc sw acc vlan 10 int f1/2 sw mo acc sw acc vlan 20 int f1/3 sw mo acc sw ac

[大型真香现场]DHCP中继服务实验(全程操作,可跟做!)

本次我们进行的是DHCP中继服务的实验 实验环境:软件准备我之前文章里提到的GNS3.CRT和安装过CentOS 7及WIN10系统的VMware虚拟机首先我们进入GNS3界面,点击左侧的路由器图标,拖取两台路由器到拓扑操作区,再点击PC图标,选择HOST拖取三台PC机到拓扑操作区:同时对两台路由器进行配置设置(改图标为交换机.更改设备名为sw/2.添加二层业务单板.设置磁盘空间为128Mb) GNS3拓扑图需要: 1. 三台Host主机:一台改名为DHCP,改图标为sever服务器,另外两台默

CentOS 7之DHCP中继服务

一.模拟环境部署: 在之此我们学习过GNS3 以及CRT的使用,也在VMware中安装过CentOS7以及Windows 10,建议小伙伴们先去学习了解一下.1.GNS3-1.3.10-all-in-one.2.CRT 8.03.VMware14 之CentOS 74.VMware14 之Windows 10 二.中继服务拓扑图: 1.在GNS3中点击左侧的路由器图标,拖取两台路由器到工作区域,再点击电脑图标,选择HOST拖取三台PC机到工作区域.2.将第一台路由器的图标换成交换机并改名为"sw

小型实验:基于GNS3与VMware用Linux CentOS7搭建DHCP中继服务(原理+实验)

一.DHCP工作原理 1.DHCP服务简介 DHCP(Dynamic Host Configuration Protocol,动态主机配置协议)通常被应用在大型的局域网络环境中,主要作用是集中的管理.分配IP地址,使网络环境中的主机动态的获得IP地址.Gateway地址.DNS服务器地址等信息,并能够提升地址的使用率. 2.DHCP服务的好处 (1)减少管理员的工作量:(2)避免IP地址冲突:(3)当网络更改IP地址段时,不需要再重新配置每个用户的IP地址:(4)提高了IP地址的利用率:(5)方

DHCP中继服务(全程实验,可跟做)

DHCP中继服务实验 实验前我们先了解一下DHCP服务什么是DHCP:DHCP是专门用于为TCP/IP网络中的计算机自动分配TCP/IP参数的协议.DHCP服务避免了因手动设置IP地址所产生的错误,同时也避免了把同一个IP地址分配给多个用户所造成的地址冲突.DHCP提供了安全.可靠且简单的TCP/IP网络设置,降低了配置IP地址的负担.DHCP网络结构图DHCP的优点:减少管理员的工作量.避免输入错误的可能.避免IP地址冲突.当网络更改IP地址段时,不需要再重新配置每个用户的IP地址.提高了 I

在GNS3+CentOS 7中 DHCP中继服务的搭建

在GNS3+CentOS 7中 DHCP中继服务的搭建 在这里我们需要同时在电脑上运行3台虚拟机.一台CentOS 7作为服务器,两台windows 10作为客户机,并在GNS3上搭建3层路由器,二层交换机以实现DHCP功能,和实现IP地址的自动分配 中继服务实验拓扑图 安装dhcp软件包 在CentOS 7 虚拟机上打开终端,安装dhcp软件包在GNS 3 上搭建好拓扑图后开启连接. 进入sw1配置 创建3个vlan,分别为vlan10.vlan20和vlan100,进入端口f1/1,分配到v