DHCP服务器和DHCP中继

6-韩孝磊

DHCP服务器上配置IP地址子网和网关

eth0的IP:172.17.6.2

netmask:255.255.255.0

gateway:172.17.6.254

安装DHCP包

yum install dhcp-*

配置DHCP文件

vim /etc/dhcpd.conf

ddns-update-style none;

option subnet-mask 255.255.255.0;

subnet 172.17.6.0 netmask 255.255.255.0 {

option routers 172.17.6.254;

range 172.17.6.30 172.17.6.200;

}

subnet 192.168.6.0 netmask 255.255.255.0 {

option routers 192.168.6.1;

range 192.168.6.30 192.168.6.200;

}

subnet 192.168.1.0 netmask 255.255.255.0 {

option routers 192.168.1.1;

range 192.168.1.30 192.168.1.200;

}

host hxl{

hardware ethernet 00:0C:29:82:37:72;

fixed-address 172.17.6.5;

}

启动DHCP文件

service dhcpd start

配置DHCP中继代理

eth0     IP:172.17.6.6    netmask:255.255.255.0
eth1     IP:192.168.6.1   netmask:255.255.255.0
eth2     IP:192.168.1.1   netmask:255.255.255.0

安装DHCP包

yum install dhcp-*

配置简单的DHCP中继代理文件

vim /etc/sysconfig/dhcrelay

INTERFACES="eth0 eth1 eth2"

DHCPSERVER="172.17.6.2"

启动DHCP中继代理服务

service dhcrelay start
 

你可能感兴趣的:(DHCP)