Linux系统配置DHCP中继

  • A+
所属分类:运维教程

DHCP中继的作用以及拓扑,可在本博搜索《dhcp中继路由器配置》一文。下面简单说下如何在Linux系统中配置DHCP中继。

首先需要参考《Linux系统配置DHCP服务》一文配置好服务端的DHCP服务,然后我们开始配置所需要的环境。

我们需要三台设备,分别为两台linux系统,一windows系统。

第一台linux,一个网卡(如果在虚拟机实验,请设置为vmnet2内)ip地址192.168.1.1;

第二台linux,两个网卡(如果在虚拟机实验,请设置为vmnet2和vmnet3内)ip地址分别设置192.168.1.2/192.168.0.1;

第三台windows,一个网卡(如果在虚拟机实验,请设置为vmnet3内)自动获取。

修改服务端ip,添加网关为第二台路由的ip192.168.1.2。

Linux系统配置DHCP中继

开启中继端的转发功能,命令是vim /etc/sysctl.conf,将net.ipv4.ip_forward = 0一句中的0改为1。

Linux系统配置DHCP中继

执行sysctl -p使上面设置生效。

Linux系统配置DHCP中继

配置dhcp中继端。修改下配置文件vim /etc/sysconfig/dhcrelay,设置DHCPSERVERS值为dhcp服务端ip。

Linux系统配置DHCP中继

在windows上面测试。

Linux系统配置DHCP中继

  • 问答中心
  • 微信小程序扫一扫
  • weinxin
  • 微信公众
  • 微信公众号扫一扫
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:16   其中:访客  16   博主  0

    • avatar Thermorollen

      The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention.

      • avatar like this

        Magnificent goods from you, man. I’ve understand your stuff previous to and you’re just too magnificent. I actually like what you have acquired here, certainly like what you are saying and the way in which you say it. You make it entertaining and you still take care of to keep it smart. I cant wait to read much more from you. This is really a wonderful website.

        • avatar visit our website

          F*ckin’ awesome things here. I am very satisfied to peer your post. Thank you a lot and i am taking a look forward to touch you. Will you please drop me a e-mail?

          • avatar usmle guide

            Fantastic site you have here but I was wondering if you knew of any message boards that cover the same topics discussed here? I’d really love to be a part of community where I can get comments from other experienced individuals that share the same interest. If you have any recommendations, please let me know. Thanks!

            • avatar erjilo pterin

              I have recently started a site, the info you provide on this web site has helped me greatly. Thanks for all of your time & work.

              • avatar more helpful hints

                Valuable information. Lucky me I found your website by accident, and I am shocked why this accident didn’t happened earlier! I bookmarked it.