创建dhcpv6服务器
1.安装dhcpd服务器
方法可以 yum 可以下载rpm再安装。(略)
2.dhcpd6配置
检查 /proc/net目录是否存在 if_inet6 文件 .
a. 有 : 证明系统已经具备为dhcpd6服务器设置ipv6地址的环境
b. 无 :
先检查 /etc/modprobe/ipv6.conf 文件应该如下:
-
cat /etc/modprobe.d/ipv6.conf
-
-
# Anaconda disabling ipv6
-
options ipv6 disable=0
b1. 试加载 modprobe ipv6模块 加载不成功的话就看看是否要重新编译kernel加入ipv6的支持或独立编译ipv6.ko模块,不懂可以支centos.org
b1如果没问题:
-
编辑 /etc/dhcp/dhcpd6.conf 如下
-
[root@Test nbi_img]# cat /etc/dhcp/dhcpd6.conf
-
-
#
-
# DHCP for IPv6 Server Configuration file.
-
# see /usr/share/doc/dhcp*/dhcpd6.conf.sample
-
# see 'man 5 dhcpd.conf'
-
# run 'service dhcpd6 start' or 'dhcpd -6 -cf /etc/dhcp/dhcpd6.conf'
-
#
-
default-lease-time 2592000;
-
preferred-lifetime 604800;
-
option dhcp-renewal-time 3600;
-
option dhcp-rebinding-time 7200;
-
option dhcp6.domain-search "ztsystems.com";
-
option dhcp6.name-servers fddd:a:b:c::d:1;
-
#option dhcpd6.bootfile-url code 59 = string;
-
allow leasequery;
-
option dhcp6.info-refresh-time 21600;
-
option dhcp6.bootfile-url code 59 = string;
-
option dhcp6.client-arch-type code 61 = array of unsigned integer 16;
-
dhcpv6-lease-file-name "/var/lib/dhcpd/dhcpd6.leases";
-
-
subnet6 fddd:a:b:c::/64 {
-
option dhcp6.bootfile-url "tftp://[fddd:a:b:c::d:1]/bootx64.efi";
-
range6 fddd:a:b:c::d:3 fddd:a:b:c::d:ffff;
-
range6 fddd:a:b:c:: temporary;
-
}
-
-
编辑对dhcpd6应网络界面 ipv6的地址自己定义,这里为fddd:a:b:c::d:1/64
-
[root@Test nbi_img]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
-
-
DEVICE="eth0"
-
BOOTPROTO=none
-
NM_CONTROLLED="yes"
-
ONBOOT="yes"
-
TYPE="Ethernet"
-
IPADDR=192.168.5.1
-
PREFIX=24
-
DEFROUTE=yes
-
IPV4_FAILURE_FATAL=yes
-
DNS=127.0.0.1
-
IPV6INIT=yes
-
IPV6ADDR=fddd:a:b:c::d:1/64
-
-
service network restart 重启网络服务
service dhcpd6 start 启动dhcpd6服务
-
[root@Test nbi_img]# ip addr show
-
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
-
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
-
inet 127.0.0.1/8 scope host lo
-
inet6 ::1/128 scope host
-
valid_lft forever preferred_lft forever
-
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
-
link/ether d0:27:88:f9:48:78 brd ff:ff:ff:ff:ff:ff
-
inet 192.168.5.1/24 brd 192.168.5.255 scope global eth0
-
inet6 fddd:a:b:c::d:1/64 scope global
-
valid_lft forever preferred_lft forever
-
inet6 fe80::d227:88ff:fef9:4878/64 scope link
-
valid_lft forever preferred_lft forever
-
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
-
link/ether d0:27:88:f9:48:79 brd ff:ff:ff:ff:ff:ff
-
inet 10.1.3.222/24 brd 10.1.3.255 scope global eth1
-
inet6 fe80::d227:88ff:fef9:4879/64 scope link
-
valid_lft forever preferred_lft forever
cat /var/log/message 无错误ip应该有了 (红色的)
TFTP服务器
安装
yum install xinetd 或支centos下载 xinetd的rpm包
1.配置tftp
-
tftp配置文件如下
-
[root@Test nbi_img]# cat /etc/xinetd.d/tftp
-
-
# default: off
-
# description: The tftp server serves files using the trivial file transfer \
-
# protocol. The tftp protocol is often used to boot diskless \
-
# workstations, download configuration files to network-aware printers, \
-
# and to start the installation process for some operating systems.
-
service tftp
-
{
-
socket_type = dgram
-
protocol = udp
-
wait = yes
-
user = root
-
server = /usr/sbin/in.tftpd
-
server_args = -6 -s /tftpboot/
-
disable = no
-
per_source = 11
-
cps = 100 2
-
flags = IPv6
-
}
-
-
# flags = IPv6
-
# flags = IPv4
-
想知各项意思可以 man in.tftpd
/tftpboot 是tftpboot服务器的根目录。可自己定义
service xinetd start
cat /var/log/message 检查是否有错误
到centos.org下载 i
ndex of /centos-6/6.4/os/x86_64/EFI/BOOT 下所有文件到 /tftpboot
待续
客户端
阅读(5954) | 评论(0) | 转发(0) |