2011年1月14日 星期五
2011年1月12日 星期三
pppoe-relay
NAME
pppoe-relay - user-space PPPoE relay agent.SYNOPSIS
pppoe-relay [options]DESCRIPTION
pppoe-relay is a user-space relay agent for PPPoE (Point-to-Point Protocol over Ethernet) for Linux. pppoe-relay works in concert with the pppoe client and pppoe-server server. See the OPERATION section later in this manual for details on how pppoe-relay works.OPTIONS
- -S interface
- Adds the Ethernet interface interface to the list of interfaces managed by pppoe-relay. Only PPPoE servers may be connected to this interface.
- -C interface
- Adds the Ethernet interface interface to the list of interfaces managed by pppoe-relay. Only PPPoE clients may be connected to this interface.
- -B interface
- Adds the Ethernet interface interface to the list of interfaces managed by pppoe-relay. Both PPPoE clients and servers may be connected to this interface.
- -n num
- Allows at most num concurrent PPPoE sessions. If not specified, the default is 5000. num can range from 1 to 65534.
- -i timeout
- Specifies the session idle timeout. If both peers in a session are idle for more than timeout seconds, the session is terminated. If timeout is specified as zero, sessions will never be terminated because of idleness. Note that the idle-session expiry routine is never run more frequently than every 30 seconds, so the timeout is approximate. The default value for timeout is 600 seconds (10 minutes.)
- -F
- The -F option causes pppoe-relay not to fork into the background; instead, it remains in the foreground.
- -h
- The -h option prints a brief usage message and exits.
OPERATION
pppoe-relay listens for incoming PPPoE PADI frames on all interfaces specified with -B or -C options. When a PADI frame appears, pppoe-relay adds a Relay-Session-ID tag and broadcasts the PADI on all interfaces specified with -B or -S options (except the interface on which the frame arrived.)Any PADO frames received are relayed back to the client which sent the PADI (assuming they contain valid Relay-Session-ID tags.) Likewise, PADR frames from clients are relayed back to the matching access concentrator.
When a PADS frame is received, pppoe-relay enters the two peers' MAC addresses and session-ID's into a hash table. (The session-ID seen by the access concentrator may be different from that seen by the client; pppoe-relay must renumber sessions to avoid the possibility of duplicate session-ID's.) Whenever either peer sends a session frame, pppoe-relay looks up the session entry in the hash table and relays the frame to the correct peer.
When a PADT frame is received, pppoe-relay relays it to the peer and deletes the session entry from its hash table.
If a client and server crash (or frames are lost), PADT frames may never be sent, and pppoe-relay's hash table can fill up with stale sessions. Therefore, a session-cleaning routine runs periodically, and removes old sessions from the hash table. A session is considered "old" if no traffic has been seen within timeout seconds. When a session is deleted because of a timeout, a PADT frame is sent to each peer to make certain that they are aware the session has been killed.
EXAMPLE INVOCATIONS
pppoe-relay -C eth0 -S eth1The example above relays frames between PPPoE clients on the eth0 network and PPPoE servers on the eth1 network.
pppoe-relay -B eth0 -B eth1This example is a transparent relay -- frames are relayed between any mix of clients and servers on the eth0 and eth1 networks.
pppoe-relay -S eth0 -C eth1 -C eth2 -C eth3This example relays frames between servers on the eth0 network and clients on the eth1, eth2 and eth3 networks.
2011年1月4日 星期二
Xming
Part I:使用XDMCP
我們要將遠端主機以圖形介面開回自己的桌面上,
首先先執行Putty,它是一個連線軟體,
在左手邊的選單中找到SSH -> X11,
將Enable X11 forwarding 打勾
並在 X display location 這行輸入: localhost:0
然後再開啟Xming
我們選 Fullscreen,
底下的Display number則維持在0就好
(注意:若將Display number的數字更動,則Putty的X display location這行的
localhost:0 數字0的地方也需要跟著更動)
這邊選第三個 Open session via XDMCP
Connect to host 則輸入你想要登入的主機IP (欲登入的主機須先設定XDMCP)
這邊按下一步就好
這邊可以儲存你剛剛的設定,以後只要直接執行設定檔就可以了
按下完成後,就會以全螢幕的方式登入到遠端的主機,
打入帳號密碼以後,就可以在自己的桌面上控制遠端主機了
只要該主機有支援的功能,都可以控制它去執行哦
注意事項:
1. 欲登入的主機需事先開啟XDMCP的功能
2. 本地主機需安裝Xming與Putty
3. 先執行Putty再Xming
4. Putty需留在桌面上執行,不能關閉
Part II:不使用XDMCP
使用圖形介面來操控遠端主機比較耗系統資源,如果我們已經熟悉Linux的指令,那麼不妨直接使用指令來操作還比較方便,底下將介紹不使用XDMCP透過Xming連到遠端主機的方法。
首先開啟Xming,這次我們選擇One window,
選擇Start a program
選Using PuTTY,並輸入欲登入主機的IP與你的帳號
直接下一步
可先儲存你的設定,下一次就直接執行儲存檔就好
按下完成就會跳出下列要求輸入密碼的畫面,
輸入密碼以後就登入了遠端主機
熟悉指令的人就可以直接以下指令的方式來操控遠端主機了
lrzsz: free x/y/zmodem implementation
lrzsz is a unix communication package providing the XMODEM, YMODEM ZMODEM file transfer protocols. lrzsz is a heavily rehacked version of the last public domain release of Omen Technologies rzsz package, and is now free software and released under the GNU General Public Licence.
Features of lrzsz
- very portable, automagically configured with GNU autoconf.
- crash recovery.
- up to 8KB block sizes (ZMODEM8K).
- internationalized (using GNU gettext). German translation of the programs output exists.
- far more secure than the original sources.
- high performance. say `make vcheck-z' and have a look at the BPS rate - i recently saw 1.4 MB per second transfering a large file through pipes (on a I586/133 system. Beat that!).
- good blocksize calculation (tries to compute an optimal blocksize based on the number of errors occured).
- It's free software.
Downloading lrzsz
The lastest release is lrzsz-0.12.20.tar.gz ((about 270KB)).SSH Client — Xshell
Xshell 是一個 Windows 平台下的終端機模擬器,支援 SSH1, SSH2, SFTP, TELNET, RLOGIN, SERIAL。不用 Putty 的理由是因為 Xshell 可以同時開啟多 session,在管理數台伺服器上方便很多。Xshell 是付費軟件,但如果個人使用則免費。
Xshell 官方網站
Xshell 官方網站
2011年1月3日 星期一
2010年12月30日 星期四
Makefile 常見phoney target
make all
產生我們設定的目標,即此範例中的執行檔。只打 make 也可以,此時會開始編譯原始碼,然後連結,並且產生執行檔。 make clean
清除之前所編譯的執行檔及目的檔 (object file, *.o)。 make distclean
除了清除執行檔和目的檔外,也把 configure 所產生的 Makefile也清除掉。 make install
將程式安裝至系統中。如果原始碼編譯無誤,且執行結果正確,便可以把程式安裝至系統預設的執行檔存放路徑。如果我們用bin_PROGRAMS 巨集的話,程式會被安裝至 /usr/local/bin 這個目錄。 make dist
將程式和相關的檔案包裝成一個壓縮檔以供散播 (distribution) 。執行完在目錄下會產生一個以 PACKAGE-VERSION.tar.gz 為名稱的檔案。PACKAGE 和 VERSION 這兩個變數是根據 configure.in 檔中 AM_INIT_AUTOMAKE(PACKAGE, VERSION) 的定義。在此範例中會產生'hello-1.0.tar.gz' 的檔案。
make distcheck
和 make dist 類似,但是加入檢查包裝後的壓縮檔是否正常。這個目標除了把程式和相關檔案包裝成 tar.gz 檔外,還會自動把這個壓縮檔解開,執行 configure,並且進行 make all 的動作,確認編譯無誤後,會顯示這個 tar.gz 檔已經準備好可供散播了。這個檢查非常有用,檢查過關的套件,基本上可以給任何一個具備 GNU 發展環境的人去重新編譯。就 hello-1.tar.gz 這個範例而言,除了在 RedHat Linux 上,在 FreeBSD 2.2.x 版也可以正確地重新編譯。
訂閱:
文章 (Atom)
How to repair and clone disk with ddrescue
ddrescue is a tool that can be used to repair and clone disks on a Linux system . This includes hard drives, partitions, DVD discs, flas...
-
From: http://blog.chinaaet.com/justlxy/p/5100064818 SMI:串行管理接口(Serial Management Interface),通常直接被稱為MDIO接口(Management Data Input/Output I...
-
from: https://www.wpgdadatong.com/tw/blog/detail?BID=B0594 一. PHY包含的各個子層 : PCS:編碼和解碼 PMA:串行器和反序列化器 PMD:取決於物理介質 Firgure 1: OSI模型裡示意...
-
在 前面我們所談的那些可以說是比較基本的東西,但是對於一份文件來說,光有前面所介紹的游標移動、刪除等等功能是不足夠的。面對一份文件我們通常會因為某些 緣故而使得我們必須去修改當中固定出現的字串樣式(pattern)成我們想要的樣子。最常遇到的就像中文文件的標點符號問題,或是 un...


