cento6.0 dhcp dhcrelay

 

DHCP
[root@localhost ~]# yum –y install dhcp (dhcp4.1.1 centos 6.3)
 
       
Dhcp服务器的配置:
[root@localhost ~]# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample  /etc/dhcp/dhcpd.conf
[root@localhost ~]# vi /etc/dhcp/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 10.10.10.0 netmask 255.255.255.0 {
 range 10.10.10.21 10.10.10.30;
 option domain-name-servers 10.10.10.10;
option domain-name "internal.example.org";
 option routers 10.10.10.1;
# option broadcast-address 10.5.5.31;
 default-lease-time 600;
 max-lease-time 7200;
}
 
subnet 172.16.1.0 netmask 255.255.255.0 {
 range 172.16.1.50 172.16.1.100;
 option domain-name-servers 10.10.10.10;
option domain-name "internal.example.org";
 option routers 172.16.1.1;
# option broadcast-address 10.5.5.31;
 default-lease-time 600;
 max-lease-time 7200;
}
 
host iptables {
 hardware ethernet 00:0c:29:5E:8c:83;
 fixed-address 10.10.10.1;
}
#host client {
#hardware ethernet 00:0c:29:56:70:15;
#fixed-address 10.10.10.8;
#}
host client {
hardware ethernet 00:0c:29:56:70:15;
fixed-address 172.16.1.25;
}
 
[root@localhost ~]#service dhcpd start
[root@localhost ~]#iptables –F
 
Dhcrelay 的配置 ;
[root@localhost ~]#yum –y install dhcp
[root@localhost home]# vim /etc/sysconfig/dhcrelay
 
INTERFACES="eth0 eth1"
# DHCPv4 only
DHCPSERVERS="10.10.10.10"
 
[root@localhost ~]# echo 1 >/proc/sys/net/ipv4/ip_forward
[root@localhost ~]#service dhcrelay start
[root@localhost ~]#iptables –F
 

你可能感兴趣的:(DHCP,cento6.0,dhcrelay)