Skip to content

Instantly share code, notes, and snippets.

@clyang
Created August 11, 2017 05:52
Show Gist options
  • Save clyang/9e2e04299d51cc11e29a010e2c430480 to your computer and use it in GitHub Desktop.
Save clyang/9e2e04299d51cc11e29a010e2c430480 to your computer and use it in GitHub Desktop.
Edgerouter解決PPPoE重新連線後, IPv6無法使用的問題
(本操作需要有基本使用vi的能力)
1. ssh登入Edgerouter後, sudo vi /etc/ppp/ip-down.d/remove_invalidv6.sh 貼上下列內容
#!/bin/sh
/sbin/ifconfig switch0 | grep -ivE 'fe80' | grep 'inet6' | awk '{print $3}' | while read -r ipv6addr ; do
echo "Removing $ipv6addr from switch0" >> /tmp/ipv6_remove.log
/sbin/ip -6 addr del $ipv6addr dev switch0
done
/etc/init.d/radvd restart
2. 存擋離開後, 輸入: sudo chmod +x /etc/ppp/ip-down.d/remove_invalidv6.sh
3. 修改此檔, sudo vi /opt/vyatta/sbin/vyatta_gen_radvd.pl , 在243行會看到下列程式碼:
# Write parameters out to config file
print $FD_WR " prefix $prefix {\n";
foreach my $key (keys %prefix_param_hash) {
print $FD_WR " $key $prefix_param_hash{$key};\n";
}
print $FD_WR " };\n";
在倒數第二行, 新增一行code如下:
# Write parameters out to config file
print $FD_WR " prefix $prefix {\n";
foreach my $key (keys %prefix_param_hash) {
print $FD_WR " $key $prefix_param_hash{$key};\n";
}
print $FD_WR " DeprecatePrefix on;\n"; # 新增這一行!!
print $FD_WR " };\n";
4. 存擋離開後, 輸入reboot重開機即可.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment