频道栏目
首页 > 资讯 > 路由器 > 正文

怎么在路由器后(LAN)设置isatap隧道使用IPV6

17-09-11        来源:[db:作者]  
收藏   我要投稿

我是在mac下这样操作过,PC应该也有类似方法吧。

打开终端;sudo bash
回车后会让输入密码(必须提前设置了密码)
之后输入su -
再回车,之后复制如下内容到终端。

LAN_IP=`/sbin/ifconfig en0 | grep inet | grep -v inet6 | awk '{print $2}'`
myip() {
    echo >&2 "Getting your public IPv4 address"    
    if type wget >/dev/null 2>/dev/null; then        
        wget -qO- 'http://ipv4.icanhazip.com'    
    elif type curl >/dev/null 2>/dev/null; then        
        curl 'http://ipv4.icanhazip.com'    else        
        echo >&2 "Neither of wget and curl found. Install one of them. Abort."        
        exit 1    
    fi
}

WAN_IP=`myip`
/sbin/ifconfig gif0 destroy
/sbin/ifconfig gif0 create inet6 2001:da8:200:900e:0:5efe:$WAN_IP prefixlen 64
/sbin/ifconfig gif0 tunnel $LAN_IP 59.66.4.50
/sbin/route delete -inet6 default
/sbin/route add -inet6 default 2001:da8:200:900e::1

之后打开ipv6网站测试看看,其中59.66.4.50是清华的ipv6的isatap隧道ipv4地址,2001:da8:200:900e::1是清华isatap的ipv6隧道地址,2001:da8:200:900e:0:5efe: 是前缀。其它学校改成自己学校的就行。不过,貌似其它学校走这个也可以,甚至是自己家。

相关TAG标签
上一篇:操作系统之处理机调度
下一篇:LinuxShell脚本攻略2:命令之乐
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站