ubuntu下ipv6设置

Filed Under (计算机相关) by 郑海山 on 2010-01-20

ubuntu默认支持ipv6,只需配置地址即可。

vi /etc/network/interface
加入
iface lo inet6 loopback
iface eth0 inet6 static
        address 1:2:3::4
        netmask 64

重启
/etc/init.d/networking restart

测试
ping6 1:2:3::1

如果有跑apache,apache2指定了监听的ip要去修改,/etc/apache2/ports.conf  的Listen参数。
重启,必须
apache2 restart
而不是简单reload,否则监听端口无法生效

测试
netstat -tulpn | grep :80
必须有tcp6输出

telnet -6 1:2:3::4 80
如果无法访问,看看是否有ufw防火墙,有的话去修改使得ufw支持ipv6。
vi /etc/default/ufw enable
ipv6=yes

原先添加的规则只是针对ipv4,需要重新删除再添加一次,最后重启
/etc/init.d/ufw reload
使用telnet测试

Comments:

Post a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

使用http://dog.xmu.edu.cn访问郑海山的blog

记住这个域名,你能想象我会在76岁那年还在写这个blog么?

联系我: 郑海山,在厦大BBS现在叫Haishion,以前是Dog。
eMail: haishanzheng AT sina DOT com
QQ: 2194037

==< 全部文章 >==

tag cloud