2013-03-12

Something about dd-wrt v24sp2 build 19154 in WHR-HP-G300N

1. How to keep pppoe connection alive?

=> Reconnect function is already implemented in dd-wrt v24sp2. pppd is configured to automatically rebuild the connection should it fail.

from /tmp/ppp/options.pppoe:

persist
lcp-echo-interval 3
lcp-echo-failure 20


lcp-echo-interval <n> : 如果有給這個選項, pppd 每 <n> 秒將會送出一個 LCP 回應要求(echo-request)封包(frame)給彼端. 在 Linux 系統下, 回應要求在 n 秒內沒有從彼端接收到封包時會被送出. 一般彼端應該以傳送一個回應回覆(echo-reply)來反應該回應要求. 這個選項可以與 lcp-echo-failure 選項一起使用來偵測不再連線的彼端。

lcp-echo-failure <n> : 如果有給這個選項, 那麼如果傳送 n 個 LCP 回應要求沒有接收到有效的 LCP 回應回覆的話 pppd 將會推測彼端是死掉的. 如果發生這種情形, pppd 將會終結該連線. 這個選項的使用要求一個非零的 lcp-echo-interval 參數值. 這個選項可以用在硬體數據機控制線路無法使用的情況下當實際連線被中斷之後 ( e.g., 數據機已經掛斷)終結 pppd 的執行。

persist : 使用此指令代表如果 lcp-echo-interval 3 和 lcp-echo-failure 20 (也就是 60 秒) 判斷 ppp 斷線以後, 不是退出 ppp, 而是重新撥號.

若還不放心, 或網路不穩, 可以打開 WHR-HP-G300N connection watchdog 再作一層確保. ( Administration -> Keep Alive -> WDS/Connection Watchdog.)

2. WAN, LAN and Wireless interface same MAC address?

Recently I replaced WHR-HP-G300N’s firmware to DD-WRT v24sp2 build 19154. And I noticed that this particular router has same MAC addresses on all 3 network interfaces! That is, be it WAN, LAN or wireless, it has the exact same MAC address!

How is this possible, and why does it work? Isn't that at least WAN side & LAN side should have different MAC addresses for a router?


Ans from F430 : No. They may have the same MAC address. A MAC address must be unique on a single broadcast domain. A LAN is a broadcast domain. The WAN is a different broadcast domain (although in some types of WAN interfaces it really isn't a "broadcast domain"). In practical terms only hosts on the LAN side of the router see the router's LAN MAC address. They do not see the MAC address on the WAN side so it doesn't matter if it is different from the LAN MAC address or not. Same for devices on the WAN side. They do not see the LAN side.…….. Note however that some bridges are designed to use a single MAC address for all interfaces. Depends on the firmware running on the bridge.
Via the router. The router acts at layer 3 and forwards based on IP address, not MAC address. A device on the LAN uses layer 3 (IP address) to determine that the destination is not on the LAN. Then it sends the packet to the default IP address (default gateway) for that LAN. Layer 2 takes over and determines what MAC address on the WAN to send the packet to. Neither layer 3 nor layer 2 care what is on the other side of the router since they never see it. Same for a packet on the WAN - it never sees layer 2 MAC addresses or layer 3 IP addresses on the LAN.
It causes no trouble at all. It doesn't violate any specifications or network "rules". The vendor is doing nothing wrong.
Vendors have to buy MAC addresses from IEEE (something like $500 for 65536 addresses.) If they can use 1 instead of 3, they will save a few cents.
Will not cause problems on a router.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.