dnsmasq-ipv6测试

##物理口
###client端设置:

######1、sysctl 修改内核参数,使能接口ipv6,是能全局ipv6转发,使能接口 accept_ra。

# 是能接口ipv6,默认 disable
net.ipv6.conf.eth2.disable_ipv6 = 0
# 允许接口接受ra报文,Obtain IPv6 address on wan interface by Stateless autoconfiguration (SLAAC)
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.eth2.accept_ra = 2
net.ipv6.conf.eth2.autoconf = 1
# 测试需要,不使用临时地址
net.ipv6.conf.all.use_tempaddr = 0
net.ipv6.conf.default.use_tempaddr = 0

######2、修改/etc/sysconfig/network

NETWORKING_IPV6=yes

######3、修改 /etc/sysconfig/network-scripts/ifcfg-eth2(可以不做持久化)

DEVICE=eth2
ONBOOT=yes
NETBOOT=yes
NM_CONTROLLED=no
PEERDNS=yes
#BOOTPROTO=dhcp # 打开这个可以同时获取ipv4和ipv6地址
BOOTPROTO=dhcp6  # 打开这个只会获取ipv6的地址
DHCPV6C=yes
IPV6INIT=yes
IPV6_AUTOCONFIG=yes

######4、dhclient 的使用.
需要使用dhcp分配地址或域名等配置是需要使用dhclient,否者不需要,如slaac方式获取地址又静态配置dns等other infomation的情况,不需要任何dhcp的协商,只需要打开RA接受开关即可。
PPPoE的情况下,dhclient 作用在ppp口上即可,其他类似。

编码 测试
接受地址和other infomation dhclient -6 eth2 --no-pid -nw dhclient -6 eth2 --no-pid -v
不接受地址,只接受other infomation。如静态配置ipv6地址,只需要dns地址等时候 dhclient -6 -S eth2 --no-pid -nw dhclient -6 -S eth2 --no-pid -v

server端 dnsmasq配置

######1、配置/etc/sysconfig/network

NETWORKING_IPV6=yes

######2、内核参数,使能接口ipv6

net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.eth2.disable_ipv6 = 0

######3、dnsmasq配置
无论是Autoconf、dhcp stateless、dhcpstateful都需要用到RA消息,告诉client能过提供的能力,RA报文由dnsmasq根据配置文件构造。RA消息报文可以包含的一些flag,这些flag会反应在dnsmasq的配置上,决定client端地址分配的方式:

IPv6 Router Advertisement (RA) messages can contain the following flags:

* M (“Managed address configuration”) – indicates that IPv6 addresses are available via DHCPv6. This is also referred to as Stateful DHCP.
* O (“Other configuration”) – no IPv6 address, but other configuration information like DNS etc. are available via DHCPv6. This is also referred to as Stateless DHCP.
* A (“Autonomous Address Configuration”) – indicates that the prefix present with th
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值