<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Router | Chia-An Lee</title><link>https://calee0219.github.io/tag/router/</link><atom:link href="https://calee0219.github.io/tag/router/index.xml" rel="self" type="application/rss+xml"/><description>Router</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>Router</title><link>https://calee0219.github.io/tag/router/</link></image><item><title>Cisco Router 設定</title><link>https://calee0219.github.io/blog/note_cisco_router/</link><pubDate>Mon, 09 Aug 2021 07:48:37 +0800</pubDate><guid>https://calee0219.github.io/blog/note_cisco_router/</guid><description>&lt;h3 id="password-recorivy"&gt;Password Recorivy&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Power ON, CTRL-break&lt;/li&gt;
&lt;li&gt;confreg 0x2142&lt;/li&gt;
&lt;li&gt;reload&lt;/li&gt;
&lt;li&gt;enable&lt;/li&gt;
&lt;li&gt;copy startup-config running-config&lt;/li&gt;
&lt;li&gt;no shutdown: open port&lt;/li&gt;
&lt;li&gt;change password&lt;/li&gt;
&lt;li&gt;config-register 0x2102: get back to normal boot&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="7609"&gt;7609&lt;/h2&gt;
&lt;h3 id="洗掉-config"&gt;洗掉 config&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;enable&lt;/li&gt;
&lt;li&gt;write erase&lt;/li&gt;
&lt;li&gt;reload&lt;/li&gt;
&lt;li&gt;這時候可能 default reboot 會進入 Romman 狀態，繼續下 boot 會來到正常狀態&lt;/li&gt;
&lt;li&gt;下 &lt;code&gt;configreg 0x2102&lt;/code&gt; (或 &lt;code&gt;configreg 0x2101&lt;/code&gt;) 讓開機直接進到正常狀態&lt;/li&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="reset"&gt;Reset&lt;/h3&gt;
&lt;h2 id="routing"&gt;Routing&lt;/h2&gt;
&lt;h3 id="vrrp"&gt;vrrp&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;作 gateway 備援使用&lt;/li&gt;
&lt;li&gt;有三種狀態 &lt;code&gt;初始狀態(Initialize)&lt;/code&gt;、&lt;code&gt;主狀態(Master)&lt;/code&gt;、&lt;code&gt;備援狀態(Backup)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="nx-os"&gt;NX-OS&lt;/h2&gt;
&lt;h3 id="沒有權限時重設-admin-密碼"&gt;沒有權限時，重設 admin 密碼&lt;/h3&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;開機&lt;/li&gt;
&lt;li&gt;按 &lt;code&gt;ctrl-C&lt;/code&gt; 或 &lt;code&gt;ctrl-R&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;進入 &lt;code&gt;loader&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;loader&amp;gt; dir&lt;/code&gt; 看有哪些 boot file&lt;/li&gt;
&lt;li&gt;&lt;code&gt;boot n3000-xxx&lt;/code&gt; 選擇你要 boot 的檔案 (可能選有 kickstart 的)&lt;/li&gt;
&lt;li&gt;進入 &lt;code&gt;switch(boot)#&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;conf t&lt;/code&gt; -&amp;gt; &lt;code&gt;admin-password&lt;/code&gt; -&amp;gt; 輸入 admin 密碼 -&amp;gt; &lt;code&gt;exit&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dir bootflash:&lt;/code&gt; 列出有的開機檔案&lt;/li&gt;
&lt;li&gt;&lt;code&gt;load bootflash:n3000-xxx&lt;/code&gt; 選擇以 xx 檔案開機&lt;/li&gt;
&lt;li&gt;帳號: admin, 密碼: 剛剛設定的&lt;/li&gt;
&lt;li&gt;進入系統後，記得要把 kickstart 與 system 指向對的地方&lt;/li&gt;
&lt;li&gt;&lt;code&gt;conf t&lt;/code&gt; -&amp;gt; &lt;code&gt;boot kickstart n3000-xxx&lt;/code&gt; -&amp;gt; &lt;code&gt;boot system n3000-kickstart-xxx&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;如果沒做上面的動作，有可能 &lt;code&gt;reload&lt;/code&gt; 後會回到 &lt;code&gt;loader&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="恢復原廠設定"&gt;恢復原廠設定&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;enable&lt;/li&gt;
&lt;li&gt;write erase&lt;/li&gt;
&lt;li&gt;reload&lt;/li&gt;
&lt;li&gt;如果 reload 卡在 loader，做上面的動作，並記得指向正確的 system 與 kickstart&lt;/li&gt;
&lt;/ul&gt;</description></item><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>