Chinaunix首页 | 论坛 | 博客
  • 博客访问: 762303
  • 博文数量: 230
  • 博客积分: 6330
  • 博客等级: 准将
  • 技术积分: 2188
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-10 15:55
个人简介

脚踏实地

文章分类

全部博文(230)

文章存档

2017年(1)

2016年(7)

2015年(10)

2014年(32)

2013年(24)

2012年(33)

2011年(50)

2010年(30)

2009年(43)

分类: 系统运维

2010-07-08 19:58:38

1. 查看状态 用netstat -antl

2. 默认情况下,IPV6是开启的,不用的话要:
vi /etc/modprobe.d/aliases
默认是有开启.那我们现在就要把它关闭了.还需要重启机器才会生效.
# alias net-pf-9  x25
# alias net-pf-10 ipv6
alias net-pf-10 off
alias ipv6 off

# alias net-pf-11 rose
# alias net-pf-12 decnet

3 支持 自动配置

给内网自动分配ipv6,需要安装radvd

aptitude安装radvd

cp /usr/share/doc/radvd/examples/simple-radvd.conf /etc/radvd.conf

编辑

emacs -nw /etc/radvd.conf

修改为如下内容

interface eth1 { AdvSendAdvert on; MinRtrAdvInterval 30; MaxRtrAdvInterval 100; prefix 2001:da8:d800:6800::/64 { AdvOnLink on; AdvAutonomous on; AdvRouterAddr on; }; };

重启radvd

还需要设置一些参数在文件/etc/sysctl.conf中:

net.ipv6.conf.default.autoconf = 1
net.ipv6.conf.default.accept_ra = 1
net.ipv6.conf.default.accept_ra_defrtr = 1
net.ipv6.conf.default.accept_ra_rtr_pref = 1
net.ipv6.conf.default.accept_ra_pinfo = 1
net.ipv6.conf.default.accept_source_route = 1
net.ipv6.conf.default.accept_redirects = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.autoconf = 1
net.ipv6.conf.all.accept_ra = 1
net.ipv6.conf.all.accept_ra_defrtr = 1
net.ipv6.conf.all.accept_ra_rtr_pref = 1
net.ipv6.conf.all.accept_ra_pinfo = 1
net.ipv6.conf.all.accept_source_route = 1
net.ipv6.conf.all.accept_redirects = 1
net.ipv6.conf.all.forwarding = 1

然后sysctl -p 命令把这些设置加载进来

这时候在waireshark中发现了ICMP6的报文,如果需要DHCPv6,在Synaptic中搜索dhcpv6,的到了2种工具:

wide-dhcpv6-client  dibbler-client


/etc/init.d/radvd restart

添加路由:
ip -6 route add 2002:0102:0304:f101::/64 dev eth0 metric 1

参考文献:



-------------

22.5. Dynamic Host Configuration v6 Server (dhcp6s)

DHCPv6 can be used for stateful configurations. The daemon itself need not necessary run on the Linux default IPv6 gateway router.

You can specify more information than by using radvd. The are most similar to IPv4 DHCP server.

After a proper configuration, the daemon reacts on received ICMPv6 multicast packets sent by a client to address ff02::1:2

22.5.1. Configuration of the DHCPv6 server (dhcp6s)

22.5.1.1. Simple configuration

dhcp6s's config file is normally /etc/dhcp6s.conf. An simple example looks like following:

interface eth0 {
server-preference 255;
renew-time 60;
rebind-time 90;
prefer-life-time 130;
valid-life-time 200;
allow rapid-commit;
option dns_servers 2001:db8:0:f101::1 sub.domain.example;
link AAA {
range 2001:db8:0:f101::1000 to 2001:db8:0:f101::ffff/64;
prefix 2001:db8:0:f101::/64;
};
};

22.5.2. Configuration of the DHCPv6 client (dhcp6c)

22.5.2.1. Simple configuration

dhcp6c's config file is normally /etc/dhcp6c.conf. An simple example looks like following:

interface eth0 {
send rapid-commit;
request domain-name-servers;
};

22.5.3. Usage

22.5.3.1. dhcpv6_server

Start server, e.g.

# service dhcp6s start

22.5.3.2. dhcpv6_client

Start client in foreground, e.g.

# dhcp6c -f eth0

22.5.4. Debugging

22.5.4.1. dhcpv6_server

The server has one foreground and two debug toggles (both should be used for debugging), here is an example:

# dhcp6s -d -D -f eth0

22.5.4.2. dhcpv6_client

As general debugging for test whether the IPv6 DHCP server is reable on the link use an IPv6 ping to the DHCP multicast address:

# ping6 -I eth0 ff02::1:2

The client has one foreground and two debug toggles, here is an example:

# dhcp6c -d -f eth0
Oct/03/2005 17:18:16 dhcpv6 doesn't support hardware type 776
Oct/03/2005 17:18:16 doesn't support sit0 address family 0
Oct/03/2005 17:18:16 netlink_recv_rtgenmsg error
Oct/03/2005 17:18:16 netlink_recv_rtgenmsg error
Oct/03/2005 17:18:17 status code for this address is: success
Oct/03/2005 17:18:17 status code: success
Oct/03/2005 17:18:17 netlink_recv_rtgenmsg error
Oct/03/2005 17:18:17 netlink_recv_rtgenmsg error
Oct/03/2005 17:18:17 assigned address 2001:db8:0:f101::1002 prefix len is not
¬ in any RAs prefix length using 64 bit instead
Oct/03/2005 17:18:17 renew time 60, rebind time 9

Note that the netlink error messages have no impact.


阅读(2040) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~