<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MikroTik | Chia-An Lee</title><link>https://calee0219.github.io/tag/mikrotik/</link><atom:link href="https://calee0219.github.io/tag/mikrotik/index.xml" rel="self" type="application/rss+xml"/><description>MikroTik</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-us</language><copyright>©</copyright><lastBuildDate>Mon, 09 Aug 2021 07:48:37 +0800</lastBuildDate><image><url>https://calee0219.github.io/media/icon_hu_da05098ef60dc2e7.png</url><title>MikroTik</title><link>https://calee0219.github.io/tag/mikrotik/</link></image><item><title>MikroTik RouterBoard 設定</title><link>https://calee0219.github.io/blog/note_mkt_routerboard/</link><pubDate>Mon, 09 Aug 2021 07:48:37 +0800</pubDate><guid>https://calee0219.github.io/blog/note_mkt_routerboard/</guid><description>&lt;h3 id="wiki"&gt;
&lt;/h3&gt;
&lt;h2 id="reset"&gt;Reset&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;斷電時 按(插)住 reset 鍵，接電，等到燈光閃爍後，放開&lt;/li&gt;
&lt;li&gt;/system reset-configuration&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="連接"&gt;連接&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;下載官網給的
&lt;/li&gt;
&lt;li&gt;點開後，在 &lt;code&gt;connect to&lt;/code&gt; 的地方打入 MAC address，按 &lt;code&gt;Connect To RoMON&lt;/code&gt;，等他自己找到 routerboard&lt;/li&gt;
&lt;li&gt;Login 打 admin，Password 留白&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Connect&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="wan-設定"&gt;WAN 設定&lt;/h2&gt;
&lt;h3 id="static-ip"&gt;Static IP&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;/ip route add gateway={getway} dst-address=0.0.0.0/0: 設定好對外連線的 gateway&lt;/li&gt;
&lt;li&gt;/ip address add interface={eth1} address={static ip} network={} netmask={}&lt;/li&gt;
&lt;li&gt;/ping 8.8.8.8&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="dhcp"&gt;DHCP&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;/ip dhcp-client add interface={port id}&lt;/li&gt;
&lt;li&gt;/ip dhcp-client enable: 將他開起來&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="lan"&gt;LAN&lt;/h2&gt;
&lt;h3 id="nat"&gt;NAT&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;/ip address add interface=ether3 address={192.168.3.1} network={192.168.3.0} netmask={255.255.255.0} &amp;lt;- 這裡的 address 會是下面機器的 gateway，netmask 會是下面機器可以用的網段&lt;/li&gt;
&lt;li&gt;/ip firewall nat add chain=srcnat src-address=192.168.2.0/24 action=masquerade: 讓網域下可以用 NAT 對外連線 (srnat: 將內網封包轉到外網)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="dhcp-1"&gt;DHCP&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;/ip pool add name={name} ranges={x.x.x.x}-{x.x.x.x}: 先開出這個 DHCP Server 要分下去的 range&lt;/li&gt;
&lt;li&gt;/ip dhcp-server add name={name} interface={ether1} address-pool={pool name}&lt;/li&gt;
&lt;li&gt;/ip dhcp-server network add address={192.168.5.0/24} gateway={192.168.5.1}: 設定 DHCP default gateway&lt;/li&gt;
&lt;li&gt;/ip dhcp-server enable&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="dhcp-bind-mac-address"&gt;DHCP bind MAC address&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;/ip dhcp-server lease make-static&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="port-forwarding"&gt;Port Forwarding&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;/ip firewall nat add chain=dstnat action=dst-nat protocol=tcp dst-address={WAN IP} dst-port={外網看得到的 port} to-address={內網 ip} to-ports={內部 port(22/80)}&lt;/li&gt;
&lt;li&gt;/ip firewall nat move {4} destination={0}: 將規則往前移動&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="security"&gt;Security&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;/password old-password={} new-password={} confirm-new-password={}&lt;/li&gt;
&lt;li&gt;/user set 0 address={}&lt;/li&gt;
&lt;li&gt;/ip service ssh port={}: 改 ssh port&lt;/li&gt;
&lt;li&gt;/system ssh port={}: 改 ssh port&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="config"&gt;Config&lt;/h2&gt;
&lt;h3 id="firewall-nat"&gt;firewall nat&lt;/h3&gt;
&lt;h3 id="dhcp-server-lease"&gt;dhcp-server lease&lt;/h3&gt;</description></item></channel></rss>