Chinaunix首页 | 论坛 | 博客
  • 博客访问: 27794
  • 博文数量: 11
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 95
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-18 05:10
文章分类

全部博文(11)

文章存档

2014年(8)

2013年(3)

我的朋友

分类: LINUX

2013-10-24 05:55:44

创建dhcpv6服务器

1.安装dhcpd服务器 
    方法可以 yum 可以下载rpm再安装。(略)
2.dhcpd6配置
    检查 /proc/net目录是否存在 if_inet6 文件 .
   a. 有 : 证明系统已经具备为dhcpd6服务器设置ipv6地址的环境
   b. 无 : 
        先检查 /etc/modprobe/ipv6.conf 文件应该如下:

点击(此处)折叠或打开

  1. cat /etc/modprobe.d/ipv6.conf
  2. # Anaconda disabling ipv6
  3. options ipv6 disable=0
        b1. 试加载 modprobe ipv6模块 加载不成功的话就看看是否要重新编译kernel加入ipv6的支持或独立编译ipv6.ko模块,不懂可以支centos.org
        b1如果没问题:

点击(此处)折叠或打开

  1. 编辑 /etc/dhcp/dhcpd6.conf 如下
  2. [root@Test nbi_img]# cat /etc/dhcp/dhcpd6.conf

  3. #
  4. # DHCP for IPv6 Server Configuration file.
  5. # see /usr/share/doc/dhcp*/dhcpd6.conf.sample
  6. # see 'man 5 dhcpd.conf'
  7. # run 'service dhcpd6 start' or 'dhcpd -6 -cf /etc/dhcp/dhcpd6.conf'
  8. #
  9. default-lease-time 2592000;
  10. preferred-lifetime 604800;
  11. option dhcp-renewal-time 3600;
  12. option dhcp-rebinding-time 7200;
  13. option dhcp6.domain-search "ztsystems.com";
  14. option dhcp6.name-servers fddd:a:b:c::d:1;
  15. #option dhcpd6.bootfile-url code 59 = string;
  16. allow leasequery;
  17. option dhcp6.info-refresh-time 21600;
  18. option dhcp6.bootfile-url code 59 = string;
  19. option dhcp6.client-arch-type code 61 = array of unsigned integer 16;
  20. dhcpv6-lease-file-name "/var/lib/dhcpd/dhcpd6.leases";

  21. subnet6 fddd:a:b:c::/64 {
  22.     option dhcp6.bootfile-url "tftp://[fddd:a:b:c::d:1]/bootx64.efi";
  23.     range6 fddd:a:b:c::d:3 fddd:a:b:c::d:ffff;
  24.     range6 fddd:a:b:c:: temporary;
  25. }

点击(此处)折叠或打开

  1. 编辑对dhcpd6应网络界面 ipv6的地址自己定义,这里为fddd:a:b:c::d:1/64
  2. [root@Test nbi_img]# cat /etc/sysconfig/network-scripts/ifcfg-eth0

  3. DEVICE="eth0"
  4. BOOTPROTO=none
  5. NM_CONTROLLED="yes"
  6. ONBOOT="yes"
  7. TYPE="Ethernet"
  8. IPADDR=192.168.5.1
  9. PREFIX=24
  10. DEFROUTE=yes
  11. IPV4_FAILURE_FATAL=yes
  12. DNS=127.0.0.1
  13. IPV6INIT=yes
  14. IPV6ADDR=fddd:a:b:c::d:1/64

service network restart 重启网络服务
service dhcpd6 start 启动dhcpd6服务

点击(此处)折叠或打开

  1. [root@Test nbi_img]# ip addr show
  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
  3.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4.     inet 127.0.0.1/8 scope host lo
  5.     inet6 ::1/128 scope host
  6.        valid_lft forever preferred_lft forever
  7. 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
  8.     link/ether d0:27:88:f9:48:78 brd ff:ff:ff:ff:ff:ff
  9.     inet 192.168.5.1/24 brd 192.168.5.255 scope global eth0
  10.     inet6 fddd:a:b:c::d:1/64 scope global
  11.        valid_lft forever preferred_lft forever
  12.     inet6 fe80::d227:88ff:fef9:4878/64 scope link
  13.        valid_lft forever preferred_lft forever
  14. 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
  15.     link/ether d0:27:88:f9:48:79 brd ff:ff:ff:ff:ff:ff
  16.     inet 10.1.3.222/24 brd 10.1.3.255 scope global eth1
  17.     inet6 fe80::d227:88ff:fef9:4879/64 scope link
  18.        valid_lft forever preferred_lft forever
cat /var/log/message 无错误ip应该有了 (红色的)


TFTP服务器
安装 
yum install xinetd 或支centos下载 xinetd的rpm包

1.配置tftp 

点击(此处)折叠或打开

  1. tftp配置文件如下
  2. [root@Test nbi_img]# cat /etc/xinetd.d/tftp

  3. # default: off
  4. # description: The tftp server serves files using the trivial file transfer \
  5. #    protocol. The tftp protocol is often used to boot diskless \
  6. #    workstations, download configuration files to network-aware printers, \
  7. #    and to start the installation process for some operating systems.
  8. service tftp
  9. {
  10.     socket_type        = dgram
  11.     protocol           = udp
  12.     wait               = yes
  13.     user               = root
  14.     server             = /usr/sbin/in.tftpd
  15.     server_args        = -6 -s /tftpboot/
  16.     disable            = no
  17.     per_source         = 11
  18.     cps                = 100 2
  19.     flags              = IPv6
  20. }

  21. #    flags            = IPv6
  22. #    flags            = IPv4

想知各项意思可以 man in.tftpd
/tftpboot 是tftpboot服务器的根目录。可自己定义
service xinetd start
cat /var/log/message 检查是否有错误
到centos.org下载  index of    /centos-6/6.4/os/x86_64/EFI/BOOT 下所有文件到 /tftpboot

待续
客户端


阅读(5947) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~