无线中继dhcp服务器,Dhcp中继服务器实现dhcp服务(三)

本文档详细介绍了如何配置华为交换机S2000、华为路由器R2621以实现DHCP中继服务,以及在Linux系统上设置DHCP服务器并进行测试的过程。配置包括交换机的VLAN划分、路由器的子接口与中继设置,最后通过Windows Server 2003客户端验证了DHCP服务的正常工作。
摘要由CSDN通过智能技术生成

Dhcp中继服务器实现dhcp服务

试验目的:中继实现dhcp服务器的ip地址分配

试验环境:linux5.4操作系统、华为路由器R2621、华为交换机S2000、windows客户机

网线数条和usb Serial线 一根

实验拓扑图:

b8362d8e12b2eabf85b9cbb97b13713b.png

试验步骤:

首先配置华为S2000交换机:

[Quidway]vlan 10

[Quidway-vlan10]port e1/0/10

[Quidway-vlan10]vlan 20

[Quidway-vlan20]port e1/0/20

[Quidway-vlan20]vlan 30

[Quidway-vlan30]port e1/0/22

[Quidway-vlan30]int e1/0/24

[Quidway-Ethernet1/0/24]port link-

[Quidway-Ethernet1/0/24]port link-type trunk#给24端口打trunk#

[Quidway-Ethernet1/0/24]port trunk permit vlan all#允许所有vlan通过#

查看一下交换机配置:

dis vlan 10

VLAN ID: 10

VLAN Type: static

Route Interface: not configured

Description: VLAN 0010

Name: VLAN 0010

Tagged   Ports:

Ethernet1/0/24

Untagged Ports:

Ethernet1/0/10

dis vlan 20

VLAN ID: 20

VLAN Type: static

Route Interface: not configured

Description: VLAN 0020

Name: VLAN 0020

Tagged   Ports:

Ethernet1/0/24

Untagged Ports:

Ethernet1/0/20

dis vlan 30

VLAN ID: 30

VLAN Type: static

Route Interface: not configured

Description: VLAN 0030

Name: VLAN 0030

Tagged   Ports:

Ethernet1/0/24

Untagged Ports:

Ethernet1/0/22

dis ine e1/0/24

PVID: 1

Mdi type: normal

Port link-type: trunk

VLAN passing  : 1(default vlan), 10, 20, 30#现在有的vlan 10、20、30都可以通过。#

Trunk port encapsulation: IEEE 802.1q

再来华为路由器,型号:R3621

[Router]int e0.1#配置子接口#

[Router-Ethernet0.1]vlan-type dot1q vid 10#把这个子接口划分到vlan10内#

[Router-Ethernet0.1]ip add 192.168.10.1 24#子接口配置vlan 10的ip#

[Router]int eth0.2

[Router-Ethernet0.2]vlan-type dot1q vid 20

[Router-Ethernet0.2]ip add 192.168.20.1 24

[Router-Ethernet0.2]int e0.3

[Router-Ethernet0.3]vlan-type dot1q vid 30

[Router-Ethernet0.3]ip add 192.168.30.124

#配置中继ip地址#

[Router]int eth0.1

[Router-Ethernet0.1]ip relay-address 192.168.30.100

[Router-Ethernet0.1]int eth0.2

[Router-Ethernet0.2]ip relay-address 192.168.30.100

路由器完整配置:

[Router]dis cu

Now create configuration...

Current configuration

!

version 1.74

undo pos-server addr-switch

firewall enable

aaa-enable

aaa accounting-scheme optional

!

controller e1 0

!

interface Aux0

async mode flow

link-protocol ppp

!

interface Ethernet0

!

interface Ethernet0.1

vlan-type dot1q vid 10

ip address 192.168.10.1 255.255.255.0

ip relay-address 192.168.30.100

!

interface Ethernet0.2

vlan-type dot1q vid 20

ip address 192.168.20.1 255.255.255.0

ip relay-address 192.168.30.100

!

interface Ethernet0.3

vlan-type dot1q vid 30

ip address 192.168.30.1 255.255.255.0

!

interface Ethernet1

!

interface Serial0

link-protocol ppp

!

interface Serial1

link-protocol ppp

!

Return

交换机路由器配置好后,我们来到linux上配置dhcp服务器。

现在我们来修该配置文件:

Vim  /etc/dhcpd.conf

48bfb3758d38a0b848fa704f89a7458e.png

a5be20af872127e8448d677709a472fe.png

启动dhcp服务器:

Service dhcpd restart

39bb90a5f355eac629dc5d30ce971956.png

这时我们用windows server 2003客户机测试下dhcp服务器的服务是否正常。

测试:

[Router]ping 192.168.30.1#和vlan 30可以通信#

PING 192.168.30.1: 56  data bytes, press CTRL_C to break

Reply from 192.168.30.1: bytes=56 Sequence=0 ttl=255 time = 1 ms

Reply from 192.168.30.1: bytes=56 Sequence=1 ttl=255 time = 1 ms

Reply from 192.168.30.1: bytes=56 Sequence=2 ttl=255 time = 2 ms

Reply from 192.168.30.1: bytes=56 Sequence=3 ttl=255 time = 1 ms

Reply from 192.168.30.1: bytes=56 Sequence=4 ttl=255 time = 1 ms

--- 192.168.30.1 ping statistics ---

5 packets transmitted

5 packets received

0.00% packet loss

round-trip min/avg/max = 1/1/2 ms

[Router]ping 192.168.20.1#和vlan 20可以通信#

PING 192.168.20.1: 56  data bytes, press CTRL_C to break

Reply from 192.168.20.1: bytes=56 Sequence=0 ttl=255 time = 1 ms

Reply from 192.168.20.1: bytes=56 Sequence=1 ttl=255 time = 1 ms

Reply from 192.168.20.1: bytes=56 Sequence=2 ttl=255 time = 1 ms

Reply from 192.168.20.1: bytes=56 Sequence=3 ttl=255 time = 1 ms

Reply from 192.168.20.1: bytes=56 Sequence=4 ttl=255 time = 1 ms

--- 192.168.20.1 ping statistics ---

5 packets transmitted

5 packets received

0.00% packet loss

round-trip min/avg/max = 1/1/1 ms

[Router]ping 192.168.30.100#和中继服务器也可以实现通信#

PING 192.168.30.100: 56  data bytes, press CTRL_C to break

Request time out

Request time out

Request time out

Request time out

Request time out

--- 192.168.30.100 ping statistics ---

5 packets transmitted

0 packets received

100.00% packet loss

下面用客户机测试是否能够获取linux 5.4 上的dhcp服务器能否为客户机自动分配ip。

d8d18cc884700232883988b521164cf6.png

这样看来我们的dhcp服务器可以自动给客户机分配地址池中ip。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值