顯示具有 Router OS 標籤的文章。 顯示所有文章
顯示具有 Router OS 標籤的文章。 顯示所有文章

2012年4月13日 星期五

RouterOS NO-IP DDNS設定


# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # EDIT YOUR DETAILS / CONFIGURATION HERE # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Define DDNS Accounts for RB Interfaces, one per interface. # The RB interface :global ddnsinterface "ether1" # The DDNS Provider (Choice of NOIP, DYNDNS or EVERYDNS) :global ddnsprovider "NOIP" # The Hostname to update. :global ddnshost "NOIPHOST" # Your Account Username :global ddnsuser "NOIPUSER" # Your Account Password :global ddnspass "NOIPPASS" # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # END OF USER DEFINED CONFIGURATION # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Define Global Variables :global ddnssystem ("mt-" . [/system package get system version] ) :global ddnsip :global ddnslastip :if ([ :typeof $ddnslastip ] = nil ) do={ :global ddnslastip "0" } :if ($ddnsprovider = "NOIP") do={ :global $ddnsprovname "NoIP" :global str "/nic/update?hostname=$ddnshost&myip=$ddnsip" :global $ddnsprovaddress "dynupdate.no-ip.com" } elseif ($ddnsprovider = "DYNDNS") do={ :global $ddnsprovname "DynDNS" :global str "/nic/update?hostname=$ddnshost&myip=$ddnsip&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG" :global $ddnsprovaddress "members.dyndns.org" } elseif ($ddnsprovider = "EVERYDNS") do={ :global $ddnsprovname "EveryDNS" :global str "/index.php?ver=0.1&ip=$ddnsip&domain=$ddnshost" :global $ddnsprovaddress "dyn.everydns.net" } # Grab the current IP address on that interface. :global ddnsip [ /ip address get [/ip address find interface=$ddnsinterface ] address ] # Did we get an IP address to compare? :if ([ :typeof $ddnsip ] = nil ) do={ :log info ("NoIP: No ip address present on " . $ddnsinterface . ", please check.") } else={ :if ($ddnsip != $ddnslastip) do={ :log info $ddnsprovname.": Sending UPDATE!" /tool fetch address=$ddnsprovaddress src-path=$str mode=http user=$ddnsuser password=$ddnspass dst-path=("/DDNS-".$ddnsprovname.".".$ddnshost) } :delay 1 :local str [/file find name="$ddnsprovider.$ddnshost"]; /file remove $str :global ddnslastip $ddnsip } }
參考資料:
http://forum.mikrotik.com/viewtopic.php?f=9&t=36840

http://blog.u-fox.net/613/%E6%95%99%E5%AD%B8scriptsdynamic-dns-update-script-for-no-ip-uo

2011年9月26日 星期一

RouterOS 指定區網內DNS到路由器

 

/ip dns set primary-dns=208.67.222.222 secondary-dns=208.67.222.220 allow-remote-requests=yes


↑ 預設OpenDNS為區網所使用的DNS

/ip firewall nat add chain=dstnat action=dst-nat to-addresses=192.168.1.1 to-ports=53 in-interface=ether2 dst-port=53 protocol=tcp

/ip firewall nat add chain=dstnat action=dst-nat to-addresses=192.168.1.1 to-ports=53 in-interface=ether2 dst-port=53 protocol=udp


↑把所有給DNS的封包全部導入路由器,透過路由器預設的DNS查詢。

 

如此一來不管原本的電腦設定的DNS為何,或者是客人要借用網路,都會強迫透過OpenDNS查詢,如此一來可以有效的防止出現不該/不想出現的網站,這樣應該會比Hinet的色情守門員還要好用吧。

 

參考資料:
http://forum.mikrotik.com/viewtopic.php?f=2&t=32009#p156371

2011年9月25日 星期日

Router OS 基本ADSL上網設定 使用Winbox

 

怕自己忘記,所以紀錄以下筆記。

 

1.使用Winbox登入

 

2.設定系統時間

在system>clock底下先設定系統時間
 01

 

3.設定NTP

在system>ntp client設定NTP
02

 

4.設定介面IP

IP>Address
04

 

5.設定ADSL帳號密碼

PPP裡面新增一個PPPoE Client
05
06-1

 

6.設定NAT

IP>Firewall底下,NAT的標籤裡面設定

Chain的部分要選擇”srcnat”
07
Action的地方選擇”masquerade”
08

 

7.設定只有內部網路才可以登入路由器

在IP>Services裡面設定只有內部網路才可以登入
09

Router OS 禁止由外面進入管理介面

 

http://www.mobile01.com/topicdetail.php?f=110&t=2145823&p=1