mzweilin / napt66

Automatically exported from code.google.com/p/napt66
38 stars 12 forks source link

一个问题 #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
下载了1.1版刷进路由,配置了一下可以通过isatap隧道方式连��
�IPv6网络并共享上网了。
因为用IPv6主要是到六维空间之类的PT站下载资源,多数下�
��速度都10M/s左右。
用了路由器共享IPv6自后再下载,所有客户机速度加起来始终�
��不过5M/s,同样资源不用路由器共享下载又回到10M/s左右速度
。
而且在高速下载的时候网页几乎一点打不开,但IPv6下载速度�
��旧。

于是我开始寻找问题,后来发现是CPU占用率太高,ssh连接路��
�器执行命令top 
-bn1几分钟后才有响应,一个名为irq的进程占了97%的CPU。
查了些资料找到了答案:
irq的作用就是执行硬件中断请求,于是找到问题的根源了,na
pt66模块是运行在内核模式下的,在Linux下内核模式的程序如��
�主动放弃占有CPU,别的程序是别想使用CPU的。
大量的IPv6数据处理,使得CPU几乎一直被napt66所占据,自然网�
��要想打开就很困难了。

验证了一下自己的猜测,把IPv6下载停了,网络立刻恢复正常�
��

由于路由器硬件的限制,这种方式共享的IPv6网络也只是浏览�
��页,少量的下载可以满足。
要么就专门用PC装Linux做软路由可以满足大量IPv6数据处理的需
求。

Original issue reported on code.google.com by tsl0...@gmail.com on 19 Mar 2011 at 3:09

GoogleCodeExporter commented 9 years ago
你也使用mentohust拨号的么?
怎么设置隧道的啊~~~》?

Original comment by zxy...@gmail.com on 19 Mar 2011 at 4:32

GoogleCodeExporter commented 9 years ago
tsl0...正解,性能瓶颈就在路由器CPU。RG100A平台是为xDSL宽带打
造的,自然无法适应校园宽带。你可以找一下支持802.11n的路�
��器平台,这种平台的CPU性能可能会高一些。方便的话请能把
设置隧道的教程贴出来,谢谢!

RG100A硬件规格:
芯片组:主芯片BCM6358 + 交换芯片BCM5325 + 无线芯片BCM4318
      CPU :MIPS 300Mhz

记忆体:闪存:S29GL128,容量16M,安装在PCB板背面。
           内存:32MB,现代内存颗粒。

Original comment by Mzwei...@gmail.com on 19 Mar 2011 at 8:16

GoogleCodeExporter commented 9 years ago
学校是isatap隧道,不需要认证的,配置比较简单,但IPv4地址�
��动态获取的,我是通过脚本先获取IP地址再设置的,看到了n
apt66模块的安装时写在/etc/rc.local中的所以我也把isatap配置都��
�在了它里面,省事...
下面是配置:

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

dev=sit1
export LC_ALL=C
myip=$(ifconfig|grep -A2 'eth1.1'|grep 'inet addr:'|cut -d: -f2 |awk '{ print 
$1}')
ip tunnel add $dev mode sit remote 210.45.176.28 local $myip
ifconfig $dev up
ifconfig $dev add 2001:250:5405:1:200:5efe:$myip
route -A inet6 add 2000::/3 gw fe80::5efe:210.45.176.28 $dev

sysctl -w net.ipv6.conf.br-lan.forwarding=1
ip6tables -A INPUT -p icmpv6 -m mac --mac-source "00:17:59:80:74:10" -j DROP
radvd
ifconfig eth1.1 down
ifconfig eth1.1 up
insmod /nat66/napt66_bcm63xx.ko wan_if=sit1
#udhcpc -i eth1.1

exit 0

解释一下:
dev:isatap隧道适配器名称
myip:本地IPv4地址

以下参数根据你的实际情况设置
210.45.176.28:隧道另一边的IPv4地址
2001:250:5405:1:200:5efe:$myip:这就是你的IPv6地址了,2001:250:5405:1:200:
5efe这串数字,你要是再自己的PC上配置过isatap的话,一定很熟悉
了.看一下PC的IPv6地址比较一下.
fe80::5efe:210.45.176.28:IPv6网关地址

最后把napt66安装命令中的wan_if参数设置成isatap隧道适配器名��
�

Original comment by tsl0...@gmail.com on 19 Mar 2011 at 11:10

GoogleCodeExporter commented 9 years ago
上面配置的好处是可以动态的获取网卡IPv4地址(我的IPv4是通��
�DHCP分配的IP地址)并添加到isatap接口上。
如果你的IPv6隧道需要认证可以参考Openwrt Wiki:
http://wiki.openwrt.org/doc/howto/ipv6#in4.tunneling

Original comment by tsl0...@gmail.com on 19 Mar 2011 at 11:18

GoogleCodeExporter commented 9 years ago
tsl的shell用得挺好嘛。谢谢了。

Original comment by Mzwei...@gmail.com on 19 Mar 2011 at 11:56

GoogleCodeExporter commented 9 years ago
我是华南农业大学的学生,我刚问了下,我这里现在是原生��
�栈网络,那设置是如何设置。而且我也在一些文件里找到isat
ap.scau.edu.cn这一个。

Original comment by k85245...@gmail.com on 19 Apr 2011 at 7:45

GoogleCodeExporter commented 9 years ago
哇···原生双栈这么好····五山没有。。。。。

Original comment by zxy...@gmail.com on 19 Apr 2011 at 10:11

GoogleCodeExporter commented 9 years ago
请问“隧道另一边的IPv4地址”怎么查得到?
华农五山

Original comment by qiqusim...@gmail.com on 19 Apr 2011 at 11:39

GoogleCodeExporter commented 9 years ago
华农的isatap隧道是isatap.scau.edu.cn
你ping一下就知道地址了
192.168.253.49
这个

Original comment by zxy...@gmail.com on 19 Apr 2011 at 12:17

GoogleCodeExporter commented 9 years ago
我的v6地址前缀为2001:da8:2004:210f
而不是华农ipv6教程中的2001:da8:2004:2001,也不含5efe,怎么处理

Original comment by qiqusim...@gmail.com on 19 Apr 2011 at 2:10

GoogleCodeExporter commented 9 years ago
`~~这是我的~

Original comment by zxy...@gmail.com on 19 Apr 2011 at 2:20

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
呃·~~我的都是自动的啊~~·
win7下我输入这个
netsh interface ipv6 isatap set state enabled
netsh interface ipv6 isatap set router isatap.scau.edu.cn
然后重启IPhelper服务就好了~~~

在路由里面~~我参考上面的
改了出来这个
vi /etc/rc.local

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
dev=sit1
export LC_ALL=C
myip=$(ifconfig|grep -A2 'eth1.1'|grep 'inet addr:'|cut -d: -f2 |awk '{ print 
$1}')
ip tunnel add $dev mode sit remote 192.168.253.49 local $myip
ifconfig $dev up
ifconfig $dev add 2001:da8:2004:2301:0:5efe:$myip
route -A inet6 add 2000::/3 gw fe80::5efe:192.168.253.49 $dev

sysctl -w net.ipv6.conf.br-lan.forwarding=1
ip6tables -A INPUT -p icmpv6 -m mac --mac-source "00:17:59:80:74:10" -j DROP
radvd
ifconfig eth1.1 down
ifconfig eth1.1 up
./mentohust -uXXXXXXXXX -pXXXXXXXX -neth1.1 -i172.16.XX.XXX -m255.255.255.0 
-g172.16.80.254 -s202.116.160.33 -o222.88.95.169 -t8 -e30 -r15 -a1 -d2 -b2 
-v3.95 -l2 -cudhcpc
insmod /nat66/napt66_bcm63xx.ko wan_if=sit1
#udhcpc -i eth1.1
exit 0

也曾经成功在路由里面mentohust拨号后能在路由ping通ipv6的地址
··但电脑还是不能~~·
后来路由重启了~就没ping通过~~~~
而且上面改了
insmod /nat66/napt66_bcm63xx.ko wan_if=sit1
#udhcpc -i eth1.1
这个以后~mentohust拨号成功也上不了网~~
得改回
insmod /nat66/napt66_bcm63xx.ko wan_if=eth1.1
udhcpc -i eth1.1
然后拨号才行。

Original comment by zxy...@gmail.com on 19 Apr 2011 at 2:56

GoogleCodeExporter commented 9 years ago
注释掉udhcpc -i 
eth1.1是因为我学校锐捷是动态获取IP的,mentohust里要配置dhcp��
�本(就是udhcpc -i 
eth1.1)每次认证都会执行它,所以rc.local中那句对我来说可有��
�无。
如果你的锐捷认证不使用DHCP的话,那就把udhcpc -i 
eth1.1的注释去掉

Original comment by tsl0...@gmail.com on 27 Apr 2011 at 8:31

GoogleCodeExporter commented 9 years ago
那种802.11n的路由器可以刷这个固件?

Original comment by qiqusim...@gmail.com on 26 May 2011 at 10:39

GoogleCodeExporter commented 9 years ago
我都tp-link841n平台,可以无线下载ipv6达到9.6MB/S,同时可以上�
��不卡。只是ping v4的地址增加了大约20ms

Original comment by woshiyuh...@gmail.com on 7 Jul 2011 at 12:15

GoogleCodeExporter commented 9 years ago
tp-link841n v多少版本 要刷哪个固件才能用上

Original comment by qiqusim...@gmail.com on 12 Jul 2011 at 12:12

GoogleCodeExporter commented 9 years ago
841n v7,需要自己编译固件,加入napt66模块,和radvd。

Original comment by woshiyuh...@gmail.com on 13 Jul 2011 at 11:17

GoogleCodeExporter commented 9 years ago
其实,其他的平台也都是一样的道理,都可实现ipv6-nat功能

Original comment by woshiyuh...@gmail.com on 13 Jul 2011 at 11:18

GoogleCodeExporter commented 9 years ago
我用的1.1版本 
路由器貌似v4&v6都不能实现nat,路由器倒是能访问外网。但是
用1.0却全部能实现,但是1.0我有个问题是pt只能下载不能上传

Original comment by shc...@gmail.com on 15 Jul 2011 at 11:00

GoogleCodeExporter commented 9 years ago
1.1也会有这个问题……上传速度太慢……只能在1m一下

Original comment by woshiyuh...@gmail.com on 17 Jul 2011 at 6:03