前言
之前已經將 Hinet IPv6 Dual Stack 給配置完畢了,接下來要使用 SLAAC + Stateless DHCPv6 來配置 IPv6 Address 及 IPv6 DNS Server。
操作
開啟 IPv6/DHCPv6 Server ,新增 DHCPv6 Server 並啟用它
#Script:
# Auto Redial PPPoE-client
#Version:
# RouterOS v6.7
#Descript:
# 自動重播PPPoE-client以取得特定網段IP Address
#History:
# 2014/01/10 Downager(http://downager.blogspot.tw/)
#---------------------------------------------------------------
#在此設定PPPoE Interface及所需要的IP網段(藍色字為需要修改的部分)
:local PPPoEInt "Hinet-PPPoE-out2";
:local Network 1.160.0.0/12;
#取得Interface IP address
:local IntIPAddress [/ip address get [find interface=$PPPoEInt] address];
:set IntIPAddress [:pick $IntIPAddress 0 [:find $IntIPAddress "/"]];
:local CheckIP ([:toip $IntIPAddress] in $Network);
#確認目前IP是否在目標網段內
:if ($CheckIP = false) do={
:do {
/interface pppoe-client disable $PPPoEInt;
/interface pppoe-client enable $PPPoEInt;
:log info ($PPPoEInt . ": " . $IntIPAddress);
:log info ($PPPoEInt . ": " . "IP不符需求");
:delay 10;
#重新寫入新取得的IP
:set IntIPAddress [/ip address get [find interface=$PPPoEInt] address];
:set IntIPAddress [:pick $IntIPAddress 0 [:find $IntIPAddress "/"]];
:set CheckIP ([:toip $IntIPAddress] in $Network)} while=($CheckIP = false)}
:log info ($PPPoEInt . ": " . $IntIPAddress);
:log info ($PPPoEInt . ": " . "IP符合需求");