|
可能大牛們早就用上ipv6了,但是我就一直沒搞定,今天折騰了一晚上。。終于弄好了
網上很多地方寫的都是固定ip的情況下的配置方法(改/etc/network/interface)北航是dhcp的,每次上網之后都要重新配ipv6很麻煩的,于是和撥號的腳本寫在一起
#! /bin/sh
echo Connecting...
sudo ./h3cclient -d -r -u username/password eth0
while [ -z $localip ]
do {
sleep 1
localip=`ifconfig eth0|awk '/inet /{print $2}'|awk -F: '{print $2}'`
}
done
echo Local IP Address: $localip
sleep 3
echo Setting up IPv6...
sudo ip tunnel del sit1
sudo ip tunnel add sit1 mode sit remote 10.100.1.85 local $localip
sudo ifconfig sit1 up
sudo ifconfig sit1 add 2001:da8:203:888:0:5efe:$localip/64
sudo ip route add ::/0 via 2001:da8:203:888::1 metric 1 |
|