教育网如何在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 Scope
ink
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
ocal 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