您的位置:首页 > 其它

DHCP服务器配置

2011-09-02 12:18 197 查看
DHCP安装1

1:首先安装dhcp-3.0.5-18.el5包

2:安装过后然后通过rpm -qc dhcp 查看他可以配置的文档

3:找到/etc/dhcpd.conf这个文档并且编辑

4:用vim编辑器编辑 vim /etc/dhcpd.conf

进去之后看到此文本是空的,不过可以看到注释的一句话 (# see /usr/share/doc/dhcp*/dhcpd.conf.sample )大概意思是:参考/usr/share/doc/dhcp*/dhcpd.conf.sample

5:参考上步的/usr/share/doc/dhcp*/dhcpd.conf.sample文档,在vim etc/dhcpd.conf中执行:r /usr/share/doc/dhcp*/dhcpd.conf.sample 读取这个文档中的内容

6:修改现在的/etc/dhcpd.conf文档

1 #

2 # DHCP Server Configuration file.

3 # see /usr/share/doc/dhcp*/dhcpd.conf.sample

4 #

5 ddns-update-style interim;

6 ignore client-updates;

7 option domain-name-servers 222.88.88.88,222.85.85.85; (超级作用域的DNS服务器)

8 subnet 192.168.60.0 netmask 255.255.255.0 { (一个普通作用域的网段,子网掩码)

9

10 # --- default gateway

11 option routers 192.168.60.254; (网关)

12 option subnet-mask 255.255.255.0; (子网掩码)

13

14 option nis-domain "domain.org";

15 option domain-name "test"; (作用域的名字)

16 filename "pxelinux.0";

17 option time-offset -18000; # Eastern Standard Time

18 # option ntp-servers 192.168.1.1;

19 # option netbios-name-servers 192.168.1.1;

20 # --- Selects point-to-point node (default is hybrid). Don't change this unless

21 # -- you understand Netbios very well

22 # option netbios-node-type 2;

23

24 range dynamic-bootp 192.168.60.1 192.168.60.10;

25 default-lease-time 21600;

26 max-lease-time 43200;

27

28 # we want the nameserver to appear at a fixed address

29 #host AAA{

30 # next-server marvin.redhat.com;

31 # hardware ethernet 00:0C:29:68:2F:9D;

32 # fixed-address 192.168.60.2;

33 #}

34 }

35 subnet 192.168.70.0 netmask 255.255.255.0 {

36

37 # --- default gateway

38 option routers 192.168.70.254;

39 option subnet-mask 255.255.255.0;

40

41 option nis-domain "domain.org";

42 option domain-name "test1";

43 filename "pxelinux.0";

44 option time-offset -18000; # Eastern Standard Time

45 # option ntp-servers 192.168.1.1;

46 # option netbios-name-servers 192.168.1.1;

47 # --- Selects point-to-point node (default is hybrid). Don't change this unless

48 # -- you understand Netbios very well

49 # option netbios-node-type 2;

50

51 range dynamic-bootp 192.168.70.1 192.168.70.10;

52 default-lease-time 21600;

53 max-lease-time 43200;

54

55 # we want the nameserver to appear at a fixed address

56 # host AAA{

57 # next-server marvin.redhat.com;

58 # hardware ethernet 00:0C:29:68:2F:9D;

59 # fixed-address 192.168.60.2;

60 # }

61 }

62 subnet 192.168.10.0 netmask 255.255.255.0 { (62-63这是一个空作用域,主要是为了匹配主机的IP地址)

63 }

其中#表示注释部分

这是本人机器上的dhcp配置,里面需要做部分修改,我在这里做了两个作用域一个都是192.168.60.0网段的,另一个是192.168.70.0网段的,也可以把他们做成一个超级作用域不过要添加一条命令

在第7行后面添加一行“shared-network AAA(超级作用域的名字){ ”,然后在最后一行再写一行“}”,最后wq保存退出。

本文出自 “愚人小记” 博客,请务必保留此出处http://yujinbang.blog.51cto.com/3501236/656302
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: