IP加速器是稳定运营二十年的老牌游戏加速器,可以加速您的IP,降低网络延迟

教育网如何在Linux下用IPv6看IPTV
教育网如何在Linux下用IPv6看IPTV
2008-12-15 星期一 晴朗

昨天晚上黄航在Q群上告知我们中央三有个节目叫歌声漂过三十年的大型音乐节目。推荐我们去看,结果发现是需要使用IPv6才能够观看。而现在很多IPTV流媒体播放器想PPLive或华工自产的banacast都不支持IPv6。所以我们即使想看都看不了。听着黄航述说节目,我们只有暗自YY的份。

还好这个节目是连续播放几天的,昨天播放到80年代,今天应该是到90年代。赶紧拉住黄航,叫他帮我配个IPv6。刚刚终于搞定。看着清晰瞪鯬TV,那种感觉怎一个爽字了得。

现在总结一个下教育网用户在Linux下如何使用IPv6看IPTV,特别适合华工的同学,因为我们晚上12点就“断网”了。实际上是IPv4的被学校路由给拦截了,这使得IPv6势在必行。

在宿舍使用路由的同学要将路由器拔掉,直接将本机网口连接到学校开放给你的RJ45端口。这是因为我们宿舍使用的路由器一般都是不支持IPv6的。当然这意味着只能有一个人用,没办法。
然后将本机IP和网关等有192私有网段按学校分配给你瞪鯬地址修改回来:
forrest@Forrest:/etc$ sudo vim network/interfaces
# This file describes the network interfaces available on yoursystem
# and how to activate them. For more information, seeinterfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address222.201.190.240
netmask255.255.255.0
network222.201.190.0
broadcast222.201.190.255
gateway222.201.190.254
# dns-*options are implemented by the resolvconf package, ifinstalled
dns-nameservers 222.201.130.30

然后要重启网卡使配置生效:
forrest@Forrest:/etc$ sudo /etc/init.d/networking restart
* Reconfiguring networkinterfaces...[ OK ]

接下来用ifconfig查看是否内核已经安装了IPv6协议栈,并且是否已经配置好IPv6地址:
forrest@Forrest:/etc$ ifconfig
eth0Link encap:Ethernet HWaddr00:15:f2:5d:23:fc
inet addr:222.201.190.240Bcast:222.201.190.255 Mask:255.255.255.0
inet6 addr:2001:250:3000:3ca0:215:f2ff:fe5d:23fc/64Scope:Global
inet6 addr: fe80::215:f2ff:fe5d:23fc/64 Scopeink
UP BROADCAST RUNNING MULTICASTMTU:1500 Metric:1
RX packets:93922 errors:0 dropped:0 overruns:0 frame:0
TX packets:277 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5998150 (5.9 MB) TX bytes:50544 (50.5KB)
Interrupt:21 Base address:0x2000

loLink encapocal Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436Metric:1
RX packets:106 errors:0 dropped:0 overruns:0 frame:0
TX packets:106 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5300 (5.3 KB) TX bytes:5300 (5.3KB)

可以看到我的系统已经安装了IPv6协议栈并且已经自动获取了一个IPv6地址,所以接下来就可以直接测试以下该IPv6协议栈和地址是否可用:

这样之后就可以用ping6测试是否已经配置成功:
forrest@Forrest:/etc$ ping6ipv6.google
PING ipv6.google(2001:4860:c003::68) 56 data bytes
64 bytes from 2001:4860:c003::68: icmp_seq=2 ttl=52 time=98.4ms
64 bytes from 2001:4860:c003::68: icmp_seq=3 ttl=52 time=97.5ms
64 bytes from 2001:4860:c003::68: icmp_seq=4 ttl=52 time=97.3ms
64 bytes from 2001:4860:c003::68: icmp_seq=5 ttl=52 time=97.9ms
64 bytes from 2001:4860:c003::68: icmp_seq=6 ttl=52 time=97.8ms
64 bytes from 2001:4860:c003::68: icmp_seq=7 ttl=52 time=97.7ms
64 bytes from 2001:4860:c003::68: icmp_seq=8 ttl=52 time=97.4ms
64 bytes from 2001:4860:c003::68: icmp_seq=9 ttl=52 time=97.7ms
^V64 bytes from 2001:4860:c003::68: icmp_seq=10 ttl=52 time=98.1ms
^C
--- ipv6.google ping statistics ---
10 packets transmitted, 9 received, 10% packet loss, time9046ms
rtt min/avg/max/mdev = 97.373/97.801/98.415/0.347 ms
看到如下输出,那么恭喜你,你现在已经可以成功地以IPv6协议栈发送IPv6包给支持IPv6的网站了。

因为我的系统是Ubuntu8.10版本,所以我怀疑是系统帮我自动安装了IPv6协议栈和配置了IPv6地址,如果你用ifconfig看不到IPv6信息,那么按下面的做法走一遍:
以下内容摘自这篇文章:abm..www.ipv6.scut.edu.cn/config/linux.html
首先为Linux添加ipv6模块:

#insmod ipv6
添加成功后,可以用lsmod查看到有ipv6模块。

    给网卡添加地址,例如eth0:

# ifconfig eth0 add 2001:250:1800:1::88/64
具体地址请向网管咨询获得。

这样之后就可以用ping6测试是否已经配置成功:
forrest@Forrest:/etc$ ping6ipv6.google
PING ipv6.google(2001:4860:c003::68) 56 data bytes
64 bytes from 2001:4860:c003::68: icmp_seq=2 ttl=52 time=98.4ms
64 bytes from 2001:4860:c003::68: icmp_seq=3 ttl=52 time=97.5ms
64 bytes from 2001:4860:c003::68: icmp_seq=4 ttl=52 time=97.3ms
64 bytes from 2001:4860:c003::68: icmp_seq=5 ttl=52 time=97.9ms
64 bytes from 2001:4860:c003::68: icmp_seq=6 ttl=52 time=97.8ms
64 bytes from 2001:4860:c003::68: icmp_seq=7 ttl=52 time=97.7ms
64 bytes from 2001:4860:c003::68: icmp_seq=8 ttl=52 time=97.4ms
64 bytes from 2001:4860:c003::68: icmp_seq=9 ttl=52 time=97.7ms
^V64 bytes from 2001:4860:c003::68: icmp_seq=10 ttl=52 time=98.1ms
^C
--- ipv6.google ping statistics ---
10 packets transmitted, 9 received, 10% packet loss, time9046ms
rtt min/avg/max/mdev = 97.373/97.801/98.415/0.347 ms
看到如下输出,那么恭喜你,你现在已经可以成功地以IPv6协议栈发送IPv6包给支持IPv6的网站了。

用ifconfig查看网卡的配置:
forrest@Forrest:/etc$ ifconfig
eth0Link encap:Ethernet HWaddr00:15:f2:5d:23:fc
inet addr:222.201.190.240Bcast:222.201.190.255 Mask:255.255.255.0
inet6 addr: 2001:250:3000:3ca0:215:f2ff:fe5d:23fc/64Scope:Global
inet6 addr: fe80::215:f2ff:fe5d:23fc/64 Scopeink
UP BROADCAST RUNNING MULTICASTMTU:1500 Metric:1
RX packets:93922 errors:0 dropped:0 overruns:0 frame:0
TX packets:277 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5998150 (5.9 MB) TX bytes:50544 (50.5KB)
Interrupt:21 Base address:0x2000

loLink encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436Metric:1
RX packets:106 errors:0 dropped:0 overruns:0 frame:0
TX packets:106 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5300 (5.3 KB) TX bytes:5300 (5.3KB)

现在让我们回到主题,安装一个IPTV播放器在Linux观看IPTV。
在Linux下推荐使用vlc,因为它是零配置,简单易用。
forrest@Forrest:/etc$ sudo apt-get install vlc
vlcvlc-plugin-alsavlc-plugin-jack
vlc-datavlc-plugin-artsvlc-plugin-pulse
vlc-dbgvlc-plugin-esdvlc-plugin-sdl
vlc-noxvlc-plugin-ggivlc-plugin-svgalib
forrest@Forrest:/etc$ sudo apt-get install vlc
Reading package lists... Done
Building dependencytree
Reading state information... Done
The following extra packages will be installed:
libass1 libdca0 libdvbpsi4 libebml0 libiso9660-5liblua5.1-0 libmatroska0
libmodplug0c2 libschroedinger-1.0-0libsdl-image1.2 libtar libtwolame0
libvcdinfo0 libvlc2 libvlccore0 vlc-datavlc-nox
Suggested packages:
mozilla-plugin-vlc videolan-doc
The following NEW packages will be installed:
libass1 libdca0 libdvbpsi4 libebml0 libiso9660-5liblua5.1-0 libmatroska0
libmodplug0c2 libschroedinger-1.0-0libsdl-image1.2 libtar libtwolame0
libvcdinfo0 libvlc2 libvlccore0 vlc vlc-datavlc-nox
0 upgraded, 18 newly installed, 0 to remove and 0 notupgraded.
Need to get 11.0MB of archives.
After this operation, 29.6MB of additional disk space will beused.
Do you want to continue [Y/n]? y
Get:1 abm..debian.ustc.edu.cn intrepid/universe libdvbpsi40.1.5-3.1 [32.6kB]
Get:2 abm..debian.ustc.edu.cn intrepid/universe libebml00.7.7-3.1 [63.7kB]
。。。

安装成功后,点击Applications=》Sound&Vidio=》VLC MediaPlayer,弹出VLC播放器。
接下来让我们告诉它要播放的地址:在教育网推荐使用北邮瞪鯬TV网址:abm..iptv.bupt.edu.cn/,不过上面明确告诉你“非本校网络,需要使用ipv6访问”。

点槐頴dia=》Open Network...,点击Networktag按钮,在Protocol中选择MMS(微软的一种流媒体协议),杂甦dress中输人鋗s://iptv6.bupt.edu.cn/CCTV-3,点下面的Play按钮,我们就可以观看清晰流畅瞪鯬TV电视节目了

不过由于我们现在是使用学校IPv4地址的DNS(222.201.130.30),当断网之后,系统根据IP地址,发送IPv4包给DNS,却将被学校路由拦截掉,所以需要找个IPv6的DNS。
上华工的华南木媒蜳v6网站:abm..www.ipv6.scut.edu.cn/。在右下方的CERNET2资源中点击DNStag按钮:看到下面有如下信息:


选择其中华工瞪鯬v6DNS,在/etc/resolv.conf中添加两个IPv6DNS:
forrest@Forrest:/etc$ sudo vim resolv.conf
nameserver 2001:da8:2000:2017::33
nameserver 2001:da8:2000:2193::33
nameserver 222.201.130.30
保存退出,等断网之后测试一下,理论上应该是没有问题才对。

现在我们已经成功在Linux下发送和接受IPv6包了,我们继续努力,尽善尽美。

    修改文件,使其重起机器后自动启动ipv6:

(1)#vi /etc/rc.local
添加如下两行:
ifconfig eth1 add2001:250:1800:1::88/64#ipv6 地址
route -A inet6 add default gw2001:250:1800:1::1 #ipv6 网关
(2)#vi /etc/sysconfig/network
添加如下一行
NETWORKING_IPV6=yes
添加完毕,测试:
#ping62001:250:1800:1::1---------------网关地址
如果看到类似下面的结果,即已经成功:
PING 2001:250:1800:1::1(2001:250:1800:1::1) 56 data bytes
64 bytes from 2001:250:1800:1::1: icmp_seq=1 ttl=64 time=0.082ms
64 bytes from 2001:250:1800:1::1: icmp_seq=2 ttl=64 time=0.058ms