分页: 1 / 1

校园网DSL拨号无法使用IPV6

发表于 : 2012-04-10 15:03
wccubuntu
大家好。

我是使用校园网dsl拨号动态获取IP地址,但是DSL拨号页面没有IPV6选项。

如下图。

Re: 校园网DSL拨号无法使用IPV6

发表于 : 2012-04-10 15:06
xw_y_am
dsl 好像本来就木有 ipv6 吧

Re: 校园网DSL拨号无法使用IPV6

发表于 : 2013-05-19 22:18
mashike0906
这个,首先,一般情况下eth0会自动获得IPv6地址,如果需要v4地址的DNS等信息,则在DSL拨号后,就可以了。
不过我这边的情况是30分钟自动断线。

如果想要ppp0获得IPv6地址,需要修改/etc/ppp/options文件,在文件的最末尾,添加

代码: 全选

ipv6 ,
或者

代码: 全选

+ipv6 ipv6cp-use-ipaddr
至此大部分情况下,已经可以获得IPv6地址了。

但是,

有些ISP,假定只有路由器可以连接IPv6,所以,需要将本机配置成路由器
具体为:
修改sysctl.conf文件

代码: 全选

vim /etc/sysctl.conf
# Uncomment the next line to enable packet forwarding for IPv6
#  Enabling this option disables Stateless Address Autoconfiguration
#  based on Router Advertisements for this host
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.ppp0.accept_ra=2
重启电脑

安装wide-dhcpv6-client

代码: 全选

apt-get install wide-dhcpv6-client
配置dhcp6c.conf文件

代码: 全选

vim /etc/wide-dhcpv6/dhcp6c.conf
interface ppp0 {
    # Request Prefix Delegation on ppp0, and give the received prefix id 0
    send ia-pd 0;
};

# Use subnets from the prefix with id 0
id-assoc pd 0 {
    prefix-interface eth0 {
        # Assign subnet 1 to eth0
        sla-len 8; # <----- BELANGRIJK: 8 omdat ons klein net 64 en ons groot 56 is en dat het verschil is
        sla-id 1;
    };
};
重启服务

代码: 全选

/etc/init.d/wide-dhcpv6-client restart
安装radvd

代码: 全选

apt-get install radvd
配置radvd.conf文件

代码: 全选

vim /etc/radvd.conf
interface eth0
{
    AdvSendAdvert on;
    prefix ::/64
    {
        AdvOnLink on;
        AdvAutonomous on;
        AdvRouterAddr on;
    };
RDNSS 2001:4860:4860::8888  2001:4860:4860::8844
        {
                # AdvRDNSSLifetime 3600;
        };
};
重启服务

代码: 全选

/etc/init.d/radvd restart
可能我这边,系统依然使用eth0的IPv6网络,所以,还是30分钟就断,原因不明。

参考链接:http://gruffi.be/mediawiki/index.php/Ip ... buntu#Ipv6
http://askubuntu.com/questions/56890/ipv6-over-pppoe