Centos 7下IPV6 有状态DHCPV6配置

yum源安装kea

yum install epel-release

yum install kea

DEMON

ps aux| grep kea

rpm -qa kea

查看dhcpv6默认配置

cat /etc/kea/kea.conf

启动kea-dhcpv6并查看kea启动过程

systemctl start kea-dhcp6

systemctl status kea-dhcp6

systemctl -l status kea-dhcp6

通过tcpdump查看服务器数据包交互过程

tcpdump -i eth0 -w dhcp6.pcap

关闭防火墙

systemctl stop firewalld.service

注意:必须要关闭防火墙否则造成dhcpv6分配地址无法下发。

用到的文件:

/var/lib/kea/kea-leases6.csv  默认情况下存放ipv6地址以及终端的设备信息,可查看到域账号mac地址等信息。

/var/log/kea-dhcp6.log  我开的debug模式。可查看dhcp6运行状态的日志。

Centos 7 修改dns

修改/etc/NetworkManager/NetworkManager.conf

[main]

plugins=ifcfg-rh

dns=none

手工修改 /etc/resolv.conf

nameserver 114.114.114.114

nameserver 8.8.8.8

服务器网卡静态ipv6配置:

[[email protected] kea]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736

TYPE=Ethernet

BOOTPROTO=static

DEFROUTE=yes

PEERDNS=yes

PEERROUTES=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=no

IPV6_DEFROUTE=yes

IPV6_PEERDNS=yes

IPV6_PEERROUTES=yes

IPV6_FAILURE_FATAL=no

NAME=eno16777736

UUID=03b35ca7-4678-48ca-ab46-5782367cd56a

DEVICE=eno16777736

ONBOOT=yes

IPADDR=X.X.X.X

GATEWAY=X.X.X.X

NETMASK=X.X.X.X

IPVADDR=2001:da8:XXXX:XXXX:24::125

IPV6_DEFAULTGW=2001:da8:XXXX:XXXX:24::1

IPV6ADDR=2001:da8:XXXX:XXXX:24::125/80

kea-dhcpv6 配置:

{

"Dhcp6":

{

# Add names of interfaces to listen on.

"interfaces-config": {

"interfaces": ["eno16777736/2001:da8:XXXX:XXXX:24:aefd:ddb0:7d02"]

},

"option-data": [{"name": "unicast","data": "2001:da8:XXXX:XXXX:24:aefd:ddb0:7d02"} ],

# Use Memfile lease database backend to store leases in a CSV file.

# Setup reclamation of the expired leases and leases affinity.

# Expired leases will be reclaimed every 10 seconds. Every 25

# seconds reclaimed leases, which have expired more than 3600

# seconds ago, will be removed. The limits for leases reclamation

# are 100 leases or 250 ms for a single cycle. A warning message

# will be logged if there are still expired leases in the

# database after 5 consecutive reclamation cycles.

#  "expired-leases-processing": {

#    "reclaim-timer-wait-time": 10,

#    "flush-reclaimed-timer-wait-time": 25,

#    "hold-reclaimed-time": 3600,

#    "max-reclaim-leases": 100,

#    "max-reclaim-time": 250,

#    "unwarned-reclaim-cycles": 5

#  },

# Addresses will be assigned with preferred and valid lifetimes

# being 3000 and 4000, respectively. Client is told to start

# renewing after 1000 seconds. If the server does not respond

# after 2000 seconds since the lease was granted, client is supposed

# to start REBIND procedure (emergency renewal that allows switching

# to a different server).

"preferred-lifetime": 3000,

"valid-lifetime": 4000,

"renew-timer": 1000,

"rebind-timer": 2000,

# The following list defines subnets. Uncomment to enable them.

"subnet6": [

{    "subnet": "2001:da8:XXXX:XXXX:25::/80",

"pools": [ { "pool": "2001:da8:XXXX:XXXX:25::/80" } ],

"interface-id":"vlan25"

},

{    "subnet": "2001:da8:XXXX:XXXX:26::/80",

"pools": [ { "pool": "2001:da8:XXXX:XXXX:26::/80" } ],

"interface-id":"vlan26"

},

#  {    "subnet": "2001:db8:3::/64",

#       "pools": [ { "pool": "2001:db8:3::/80" } ] },

#  {    "subnet": "2001:db8:4::/64",

#       "pools": [ { "pool": "2001:db8:4::/80" } ] }

]

},

# DHCP DDNS configuration starts here.

# Logging configuration starts here. It tells Kea servers to store

# all log messages (on severity INFO or more) in a file.

# debuglevel variable is used on DEBUG level only.

"Logging":

{

"loggers": [

{

"name": "kea-dhcp4",

"output_options": [

{

"output": "/var/log/kea-dhcp4.log"

}

],

"severity": "INFO",

"debuglevel": 0

},

{

"name": "kea-dhcp6",

"output_options": [

{

"output": "/var/log/kea-dhcp6.log"

}

],

"severity": "DEBUG",    /日志开启到debug级别,可以查看分配的地址信息。

"debuglevel": 99

},

{

"name": "kea-dhcp-ddns",

"output_options": [

{

"output": "/var/log/kea-ddns.log"

}

],

"severity": "INFO",

"debuglevel": 0

}

]

}

}

如果自己网段内需要dhcpv6服务 需开通以下:

[[email protected] kea]# cat /etc/kea/kea.conf

# This is a basic configuration for the Kea DHCPv4 and DHCPv6 servers.

# Subnet declarations are commented out and no interfaces are listed.

# Therefore, the servers will not listen or respond to any queries.

# The basic configuration must be extended to specify interfaces on

# which the servers should listen. Also, subnets and options must be

# declared.

{

# DHCPv4 configuration starts here.

#"Dhcp4":

#{

# Add names of interfaces to listen on.

#  "interfaces-config": {

#    "interfaces": [ ]

#  },

# Use Memfile lease database backend to store leases in a CSV file.

#  "lease-database": {

#   "type": "memfile"

# },

# Setup reclamation of the expired leases and leases affinity.

# Expired leases will be reclaimed every 10 seconds. Every 25

# seconds reclaimed leases, which have expired more than 3600

# seconds ago, will be removed. The limits for leases reclamation

# are 100 leases or 250 ms for a single cycle. A warning message

# will be logged if there are still expired leases in the

# database after 5 consecutive reclamation cycles.

#  "expired-leases-processing": {

#    "reclaim-timer-wait-time": 10,

#    "flush-reclaimed-timer-wait-time": 25,

#    "hold-reclaimed-time": 3600,

#    "max-reclaim-leases": 100,

#    "max-reclaim-time": 250,

#    "unwarned-reclaim-cycles": 5

#  },

# Global (inherited by all subnets) lease lifetime is mandatory parameter.

#  "valid-lifetime": 4000,

# Below an example of the simple subnet declaration. Uncomment to

# enable it. This is a list, denoted with [ ], of structure, denoted

# with { }. Each structure describes a single subnet and may have

# several parameters. One of those parameters is "pools" that is

# also a list of structures.

#  "subnet4": [

#  {    "subnet": "192.0.2.0/24",

#       "pools": [ { "pool": "192.0.2.1 - 192.0.2.200" } ] }

#  ]

#},

# DHCPv6 configuration starts here.

"Dhcp6":

{

# Add names of interfaces to listen on.

"interfaces-config": {

"interfaces": ["eno16777736/2001:da8:XXXX:XXXX:24::125"]

},

"option-data": [{"name": "unicast","data": "2001:da8:XXXX:XXXX:24::125"} ],

# Use Memfile lease database backend to store leases in a CSV file.

# Setup reclamation of the expired leases and leases affinity.

# Expired leases will be reclaimed every 10 seconds. Every 25

# seconds reclaimed leases, which have expired more than 3600

# seconds ago, will be removed. The limits for leases reclamation

# are 100 leases or 250 ms for a single cycle. A warning message

# will be logged if there are still expired leases in the

# database after 5 consecutive reclamation cycles.

#  "expired-leases-processing": {

#    "reclaim-timer-wait-time": 10,

#    "flush-reclaimed-timer-wait-time": 25,

#    "hold-reclaimed-time": 3600,

#    "max-reclaim-leases": 100,

#    "max-reclaim-time": 250,

#    "unwarned-reclaim-cycles": 5

#  },

# Addresses will be assigned with preferred and valid lifetimes

# being 3000 and 4000, respectively. Client is told to start

# renewing after 1000 seconds. If the server does not respond

# after 2000 seconds since the lease was granted, client is supposed

# to start REBIND procedure (emergency renewal that allows switching

# to a different server).

"preferred-lifetime": 3000,

"valid-lifetime": 4000,

"renew-timer": 1000,

"rebind-timer": 2000,

# The following list defines subnets. Uncomment to enable them.

"subnet6": [

{    "subnet": "2001:da8:XXXX:XXXX:25::/80",

"pools": [ { "pool": "2001:da8:XXXX:XXXX:25::/80" } ],

"interface-id":"vlan25"

},

{    "subnet": "2001:da8:XXXX:XXXX:24::/80",

"pools": [ { "pool": "2001:da8:XXXX:XXXX:24::/80" } ],

"interface":"eno16777736"

},

{    "subnet": "2001:da8:XXXX:XXXX:26::/80",

"pools": [ { "pool": "2001:da8:XXXX:XXXX:26::/80" } ],

"interface-id":"vlan26"

},

#  {    "subnet": "2001:db8:3::/64",

#       "pools": [ { "pool": "2001:db8:3::/80" } ] },

#  {    "subnet": "2001:db8:4::/64",

#       "pools": [ { "pool": "2001:db8:4::/80" } ] }

]

},

# DHCP DDNS configuration starts here.

# Logging configuration starts here. It tells Kea servers to store

# all log messages (on severity INFO or more) in a file.

# debuglevel variable is used on DEBUG level only.

"Logging":

{

"loggers": [

{

"name": "kea-dhcp4",

"output_options": [

{

"output": "/var/log/kea-dhcp4.log"

}

],

"severity": "INFO",

"debuglevel": 0

},

{

"name": "kea-dhcp6",

"output_options": [

{

"output": "/var/log/kea-dhcp6.log"

}

],

"severity": "DEBUG",

"debuglevel": 99

},

{

"name": "kea-dhcp-ddns",

"output_options": [

{

"output": "/var/log/kea-ddns.log"

}

],

"severity": "INFO",

"debuglevel": 0

}

]

}

}

时间: 2024-10-17 13:11:24

Centos 7下IPV6 有状态DHCPV6配置的相关文章

CentOS 7下Samba的安装与配置

CentOS 7下Samba的安装与配置 一.简介 简介以及配置介绍部分来自:https://www.cnblogs.com/muscleape/p/6385583.html Samba是一个能让Linux系统应用Microsoft网络通讯协议的软件,而SMB是Server Message Block的缩写,即为服务器消息块 ,SMB主要是作为Microsoft的网络通讯协议,后来Samba将SMB通信协议应用到了Linux系统上,就形成了现在的Samba软件.后来微软又把 SMB 改名为 CI

Centos环境下手动设置-网络参数配置-网络挨排错顺序-

Linux中网络参数大致包含以下内容: IP地址 子网掩码 网关 DNS服务器 主机名(默认 localhost) 历来Linux系统中修改这些参数的方式通常有:命令.文件两种.其中通过命令设置可以立即生效但重启后将失效,通过文件修改实现永久生效,但不会立即生效. 首先我们来看看命令的方式:ifconfig:查看与设置IP地址.子网掩码hostname:查看与设置主机名route:     查看与设置路由信息(默认网关等) 通过文件的方式修改:/etc/sysconfig/network-scr

CentOS Linux下VNC Server远程桌面配置详解

http://www.ha97.com/4634.html PS:偶以前基本不用Linux的远程图形桌面,前几天有开发的同事配置CentOS的vnc有问题,找我解决,就顺便记录总结一下,这个总结是比较完整的.下面的配置在CentOS5.x和6.x.SUSE企业版亲测验证,其他发行版按理也通用: 一.安装相应桌面环境与vnc服务端和客户端: # yum groupinstall "GNOME Desktop Environment"(CentOS 5.x安装GNOME桌面环境) # yu

(总结)CentOS Linux下VNC Server远程桌面配置详解

PS:偶以前基本不用Linux的远程图形桌面,前几天有开发的同事配置CentOS的vnc有问题,找我解决,就顺便记录总结一下,这个总结是比较完整的.下面的配置在CentOS5.x和6.x.SUSE企业版亲测验证,其他发行版按理也通用: 一.安装相应桌面环境与vnc服务端和客户端:# yum groupinstall "GNOME Desktop Environment"(CentOS 5.x安装GNOME桌面环境)# yum groupinstall "X Window Sy

CentOS 6下OpenCV的安装与配置

自己按照网上的教程一步一步来的 http://www.jb51.net/os/RedHat/280309.html 虚拟机环境 CentOS 6.5 内核版本:4.1.14 64位 gcc,gcc 4.4.7 cmake version 2.8.12.2 Python version 2.6.6 安装OpenCV库 安装Python支持库 NumPy (用于矩阵向量运算,我没装) 安装opencv的依赖库(重要!) yum install cmake gcc gcc-c++ gtk+-devel

阿里云CentOS服务器下安装Golang1.13并配置代理

下载到/usr/local位置并解压 cd /usr/local wget https://studygolang.com/dl/golang/go1.13.linux-amd64.tar.gz tar -xzvf go1.13.linux-amd64.tar.gz 在$HOME位置创建go工作目录 cd mkdir go 配置环境变量并设置代理 vim /etc/profile export PATH=$PATH:/usr/local/go/bin export GOPATH=$HOME/go

Centos 7下mysql的安装与配置

将mysql的安装文件放入虚拟机,ftp软件上传上去 配置yum,用yum进行安装mysql 进行mysql的重置:mysql_install_db --datadir=/var/lib/mysql 进入/var/lib/mysql修改权限 chown mysql:mysql * -R 进入root目录,查看.mysql_secret中所记录的密码:cat .mysql_secret 用上面的密码登陆进数据库    mysql -u root -p 更改密码   alter user 'root

CentOS 7下Samba服务安装与配置详解

centos7.5系统下进行 yum -y install samba samba-client systemctl start smb nmbps -ef | grep -E 'smb|nmb'netstat -tunlp | grep -E 'smbd|nmbd'mkdir /mnt/datauseradd -s /sbin/nologin mtcat /etc/passwd | grep mtsmbpasswd -a mt[输入两遍密码123456]chown mt.mt /mnt/dat

Centos 7下mysql的安装与配置 (未完成)

vim /var/log/mysqld.log A temporary password is generated for [email protected]: yqtAhsIw/9MI mysql -u root -p password:yqtAhsIw/9MI create user 'aa01'@'192.168.100.140' identified by '123456'; //给192.168.100.140创建用户,即创建的用户只能在192.168.100.140上登录create