Posts

Showing posts with the label Networking

Apache X-Forward-For settings for behinding reverse proxy

Add following settings into your httpd.conf or the configuration file in sites-available that linked to sites-enabled. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy  SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded  CustomLog "logs/access_log" combined env=!forwarded CustomLog "logs/access_log" proxy env=forwarded After saving the settings, restart your httpd and you should see the real client IP in access log.

Restart networking service on Debian

Most Debian user should run into this problem before they find out a good way to restart networking service. Debian deprecated the restart option of /etc/init.d/networking script for security issue. Users will get following warning when they do restart: Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning). And their network won't be restart finally. How to restart the networking service? There are several ways to achieve that. (Login as root or sudo it) /etc/init.d/networking stop && /etc/init.d/networking start (You'd better run the command on console than remote it) inovke-rc.d networking restart Hope those helpful for you and me. :-)

Difference of 3Com 3C905 series NIC

Image
這是之前遇到的狀況,因為當時還沒把網卡拍照存證,故現在補遺一下。 這是在前公司 (凱 x) 架設防火牆時發生的狀況。由於公司成立初期,百廢待舉,因此,也就以 PC + OpenBSD 來架設 firewall 以確保網路安全,也順便達到網段控管的目的。 一開始由於資源有限,因此,就以幾張 Realtek 8139 series 10/100 的網卡先頂著。但,有感於該網卡的耐受度和穩定度有限,因此,透過老闆的關係去找來幾張還不錯的 10/100 的網卡來用,以承受持續且較大的流量。 記得還在唸書時 (1996),3Com 的 3C905 series 是當時的一時之選,因此,當時的 server 上這張卡是很常見的。如下面兩張圖: 3C905-TX 3C905B-TX 或許是時代的變遷,網路大興的影響,這個時期的網卡所使用的網路晶片已經不敷現時的需求了,因為流量已經不可同日而語了! 也因為如此,那陣子常會發生網路斷線。經過測試的結果發現那張卡到一定程度的流量就會掛點,唯一的辦法就是重開機。而它的耐受度比時下的 Realtek 8139 series 網卡還糟糕。上班時間總會給你斷個 1-2 次,主管都不得不來關切了。 =_=" 在資源有限,問題無限的情況下,又苦於找不到 Intel 的 PRO/100 i8255x series 的時候,我無意間發現到下面這張卡 - 3Com 3C905C-TXM。 3C905C-TXM 經過仔細比較發現,這張卡所使用的網路晶片有別於較舊的兩款。3C905C-TXM 所使用的是 BROADCOM 5904 的網路晶片,而 3C905-TX 和 3C905B-TX 則是採用 LUCENT 40-03364 和 40-04834 的晶片。 BROADCOM 5904 經實際試用結果,不再有之前斷線的問題。連續使用一週後,系統也是相當的順暢。所以,就把所有的舊系列的網卡都用找來的 3C905C-TXM 替換掉了!

Hardware error for NIC with OpenBSD

這次在幫元智育成架設防火牆時,連 tanet 的那個介面一直造成我沒辦法將封包正確的導到 tanet 上,一開始都沒發現在是什麼問題,前幾天在 /var/log/messages 發現如下訊息: Apr 2 13:53:11 fw /bsd: arpresolve: 140.138.40.254: route without link local address Apr 2 13:53:47 fw last message repeated 28 times Apr 2 13:54:09 fw last message repeated 6 times Apr 2 14:21:22 fw /bsd: arpresolve: 140.138.40.254: can't allocate llinfo Apr 2 14:21:53 fw last message repeated 30 times Apr 2 14:23:57 fw last message repeated 157 times Apr 2 14:30:17 fw last message repeated 537 times Apr 2 14:48:05 fw /bsd: arpresolve: 140.138.40.254: can't allocate llinfo Apr 2 14:55:10 fw last message repeated 137 times Apr 2 15:30:01 fw /bsd: arpresolve: 140.138.40.254: can't allocate llinfo Apr 2 15:40:03 fw last message repeated 648 times Apr 2 15:50:05 fw last message repeated 875 times Apr 2 16:00:06 fw last message repeated 1050 times Apr 2 16:10:08 fw last message repeated 1028 times Apr 2 16:10:42 fw last message repeated 40 times Apr 2 16:55:29 fw /b...