• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    Linux與Linux之間的互拔

    發布: 2007-7-02 21:50 | 作者: admin | 來源: | 查看: 8次 | 進入軟件測試論壇討論

    領測軟件測試網

    一.Linux與Linux之間的互拔:
    請看圖一:
    我家里: 辦公室:

    機器名:j128 機器名:vms68
    OS: RedHat5.1 OS: RedHat5.1
    IP: 192.168.88.128 <----電話網----> IP: 192.168.89.68 <--->
    Internet
    | [ttyS0] [ttyS1] [ttyS0]
    |網線
    |
    機器名:j003
    OS: Win98
    IP: 192.168.88.3

    第一步要配置Linux為ppp服務器,允許拔入,如姚飛所說:

    使用mgetty
    (以下假設modem裝在ttyS0)

    cd /etc
    vi inittab

    add :

    d1:2345:respawn:/sbin/mgetty ttyS0 # COM1口允許拔入
    d2:2345:respawn:/sbin/mgetty ttyS1 # COM2口允許拔入

    then: init q # 重讀配置文件/etc/inittab

    注意, 如果想拔號出去, pppd 使用的設備也必須是/dev/ttyS0或/dev/ttyS1,
    而不是/dev/modem, 要不然是撥不出去的.

    我這樣做后,j128和vms68都可允許拔入,但還不是ppp server,還需要以下幾步:
    在vms68里:
    adduser ppp #新加一個用戶
    passwd ppp #為ppp起個密碼
    在/home/ppp下建一個腳本ppplogin,內容如下:
    exec /usr/sbin/pppd 115200 modem asyncmap 0 proxyarp \
    192.168.89.68:192.193.89.69
    ##### LOCALIP:REMOTEIP
    vi /etc/passwd
    將這行ppp:xxxx:505:505:ppp acount:/home/ppp:/bin/bash
    改為ppp:xxxx:505:505:ppp acount:/home/ppp:/home/ppp/ppplogin

    在j128里:
    adduser ppp #新加一個用戶
    passwd ppp #為ppp起個密碼
    在/home/ppp下建一個腳本ppplogin,內容如下:
    exec /usr/sbin/pppd 115200 modem asyncmap 0 proxyarp \
    0.0.0.0:0.0.0.0.0 ###等vms68分配ip地址
    vi /etc/passwd
    將這行ppp:xxxx:505:505:ppp acount:/home/ppp:/bin/bash
    改為ppp:xxxx:505:505:ppp acount:/home/ppp:/home/ppp/ppplogin

    下一步要配j128拔到vms68,這很簡單,
    跟拔到Internet是一樣的,文件ppp-onvms68如下:
    # Script to initiate a ppp connection. This is the first part of the
    # pair of scripts. This is not a secure pair of scripts as the codes
    # are visible with the ps command. However, it is simple.
    #
    # These are the parameters. Change as needed.
    TELEPHONE=xxxx # The telephone number for the connection
    ACCOUNT=ppp # The account name for logon (as in George Burns)
    PASSWORD=xxxx # The password for this account (and Gracie Allen)
    LOCAL_IP=0.0.0.0 # Local IP address if known. Dynamic = 0.0.0.0
    REMOTE_IP=0.0.0.0 # Remote IP address if desired. Normally 0.0.0.0
    NETMASK=255.255.255.0 # The proper netmask if needed
    #
    # Export them so that they will be available at ppp-on-dialer time.
    export TELEPHONE ACCOUNT PASSWORD
    #
    # This is the location of the script which dials the phone and logs
    # in. Please use the absolute file name as the $PATH variable is not
    # used on the connect option. (To do so on a root account would be
    # a security hole so dont ask.)
    #
    DIALER_SCRIPT=/home/ppp/ppp-on-dialer
    #
    # Initiate the connection
    #
    # I put most of the common options on this command. Please, dont
    # forget the lock option or some programs such as mgetty will not
    # work. The asyncmap and escape will permit the PPP link to work with
    # a telnet or rlogin connection. You are welcome to make any changes
    # as desired. Dont use the defaultroute option if you currently
    # have a default route to an ethernet gateway.
    #
    exec /usr/sbin/pppd /dev/ttyS0 115200 modem $LOCAL_IP:$REMOTE_IP \
    defaultroute lock crtscts asyncmap 0 connect $DIALER_SCRIPT \
    debug

    現在配vms68拔到j128,文件ppp-onj128如下:
    # Script to initiate a ppp connection. This is the first part of the
    # pair of scripts. This is not a secure pair of scripts as the codes
    # are visible with the ps command. However, it is simple.
    #
    # These are the parameters. Change as needed.
    TELEPHONE=xxxx # The telephone number for the connection
    ACCOUNT=ppp # The account name for logon (as in George Burns)
    PASSWORD=xxxx # The password for this account (and Gracie Allen)
    LOCAL_IP=192.168.89.68 # Local IP address if known. Dynamic = 0.0.0.0
    REMOTE_IP=192.168.89.69 # Remote IP address if desired. Normally 0.0.0.0
    NETMASK=255.255.255.0 # The proper netmask if needed
    #
    # Export them so that they will be available at ppp-on-dialer time.
    export TELEPHONE ACCOUNT PASSWORD
    #
    # This is the location of the script which dials the phone and logs
    # in. Please use the absolute file name as the $PATH variable is not
    # used on the connect option. (To do so on a root account would be
    # a security hole so dont ask.)
    #
    DIALER_SCRIPT=/home/ppp/ppp-on-dialer
    #
    # Initiate the connection
    #
    # I put most of the common options on this command. Please, dont
    # forget the lock option or some programs such as mgetty will not
    # work. The asyncmap and escape will permit the PPP link to work with
    # a telnet or rlogin connection. You are welcome to make any changes
    # as desired. Dont use the defaultroute option if you currently
    # have a default route to an ethernet gateway.
    #
    exec /usr/sbin/pppd /dev/ttyS1 115200 modem $LOCAL_IP:$REMOTE_IP \
    lock crtscts asyncmap 0 connect $DIALER_SCRIPT \
    debug

    這里要注意LOCAL_IP和REMOTE_IP要給值,還有的是在pppd里沒有defaultroute。
    因為vms68還要拔上Internet,所以不要defaultroute。

    在j128上用ppp-onvms68拔上vms68,連通后telnet vms68,執行以下命令:
    nohup sleep 30;ppp-onj128
    然后在j128上斷線,等待vms68拔入。拔通后,在j128上要執行以下命令:
    route add -net 192.168.89.0 gw 192.168.89.69 ppp0
    route add default gw 192.168.89.69 ppp0
    ipfwadm -F -a m -S 192.168.88.0/24 -D 0.0.0.0/0
    現在可再telnet vms68,在vms68上拔號上網,這樣j003可通過j128,再通
    過vms68上網,我也不用付任何費用。


    二.Win98與Linux之間的互拔:
    請看圖二:
    我家里: 辦公室:

    機器名:j128 機器名:vms68
    OS: RedHat5.1 OS: RedHat5.1
    IP: 192.168.88.128 IP: 192.168.89.68 <--->
    Internet
    | [ttyS1] [ttyS0]
    |網線 |
    | |
    機器名:j003 |
    OS: Win98 ---------------------------
    IP: 192.168.88.3 電話網

    這里vms68要象第一步所說的,要配成允許拔入的ppp server。
    這里主要是win98的配置,首先象上Internet那樣,在拔號網絡里新建一個連接,
    要注意兩點,一要設置連通后彈出終端窗口,二是最主要的,在“控制面板”里
    選“調制解調器”,選用來連線的modem,選“屬性”按鈕,選“連接”,再選
    “高級”按鈕,再在“附加設置”里輸入&C0S0=001。
    為什么要這樣做?因為win98自帶的ppp client會自動退出當遠端ppp server掛線
    時,因此要騙一騙win98,要modem不要報告斷線,并自動應答拔入。&C0就是要
    modem不要檢測carrier,s0=001要modem在響一下后就應答。

    現在配vms68拔到j003,文件ppp-onj003如下:
    # Script to initiate a ppp connection. This is the first part of the
    # pair of scripts. This is not a secure pair of scripts as the codes
    # are visible with the ps command. However, it is simple.
    #
    # These are the parameters. Change as needed.
    TELEPHONE=xxxx # The telephone number for the connection
    #ACCOUNT=ppp # The account name for logon (as in George Burns)
    #PASSWORD=xxxx # The password for this account (and Gracie Allen)
    LOCAL_IP=192.168.89.68 # Local IP address if known. Dynamic = 0.0.0.0
    REMOTE_IP=192.168.89.69 # Remote IP address if desired. Normally 0.0.0.0
    NETMASK=255.255.255.0 # The proper netmask if needed
    #
    # Export them so that they will be available at ppp-on-dialer time.
    export TELEPHONE ###ACCOUNT PASSWORD
    #
    # This is the location of the script which dials the phone and logs
    # in. Please use the absolute file name as the $PATH variable is not
    # used on the connect option. (To do so on a root account would be
    # a security hole so dont ask.)
    #
    DIALER_SCRIPT=/home/ppp/ppp-on-dialer
    #
    # Initiate the connection
    #
    # I put most of the common options on this command. Please, dont
    # forget the lock option or some programs such as mgetty will not
    # work. The asyncmap and escape will permit the PPP link to work with
    # a telnet or rlogin connection. You are welcome to make any changes
    # as desired. Dont use the defaultroute option if you currently
    # have a default route to an ethernet gateway.
    #
    exec /usr/sbin/pppd /dev/ttyS1 115200 modem $LOCAL_IP:$REMOTE_IP \
    lock crtscts asyncmap 0 connect $DIALER_SCRIPT \
    debug

    這里要注意LOCAL_IP和REMOTE_IP要給值,還有的是在pppd里沒有defaultroute。
    因為vms68還要拔上Internet,所以不要defaultroute。還有這里沒有ACOUNT和
    PASSWORD,因為WIN98的PPP CLIENT不要用戶名和密碼,因此在PPP-ON-DIALER里
    要把送ACOUNT和PASSWORD的那兩行去掉。
    J003通過拔號拔上VMS68后,要TELNET VMS68,在VMS68里執行以下腳本:
    kill `cat /var/run/ppp0.pid` ###注意如果是用ppp1,就用ppp1.pid
    nohup sleep 30;ppp-onj003
    這里要特別注意的一點是一定要在linux里斷線,因為在WIN98里斷線,則WIN98
    的PPP CLIENT就會退出,就不會應答呼叫。

    現在WIN98和LINUX之間就可以實現回拔了,但要注意WIN98的路由問題。

    在win98下要自配一下路由,在win98的目錄里有route程序,它的格式如下:
    route print/add/delete/change (直接打route就有幫助看)

    象我的j003,在沒有拔號時,用route print得到如下信息:(行號是我加上的)
    Active Routes:

    Network Address Netmask Gateway Address Interface Metric
    1 0.0.0.0 0.0.0.0 192.168.88.128 192.168.88.3 1
    2 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
    3 192.168.88.0 255.255.255.0 192.168.88.3 192.168.88.3 1
    4 192.168.88.3 255.255.255.255 127.0.0.1 127.0.0.1 1
    5 192.168.88.255 255.255.255.255 192.168.88.3 192.168.88.3 1
    6 224.0.0.0 224.0.0.0 192.168.88.3 192.168.88.3 1
    7 255.255.255.255 255.255.255.255 192.168.88.3 0.0.0.0 1

    通過拔號網絡拔入vms68后,用route print得到如下信息:

    Active Routes:

    Network Address Netmask Gateway Address Interface Metric
    1* 0.0.0.0 0.0.0.0 192.168.89.69 192.168.89.69 1
    2* 0.0.0.0 0.0.0.0 192.168.88.128 192.168.88.3 2
    3 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
    4 192.168.88.0 255.255.255.0 192.168.88.3 192.168.88.3 2
    5 192.168.88.3 255.255.255.255 127.0.0.1 127.0.0.1 1
    6 192.168.88.255 255.255.255.255 192.168.88.3 192.168.88.3 1
    7 192.168.89.0 255.255.255.0 192.168.89.69 192.168.89.69 1
    8 192.168.89.69 255.255.255.255 127.0.0.1 127.0.0.1 1
    9 224.0.0.0 224.0.0.0 192.168.88.3 192.168.88.3 1
    10 224.0.0.0 224.0.0.0 192.168.89.69 192.168.89.69 1
    11 255.255.255.255 255.255.255.255 192.168.89.69 192.168.89.69 1
    注意我打*號的地方,從WIN98拔號到LINUX,WIN98會自動配置路由,從LINUX拔號到WIN98?
    ?
    WIN98就得手工配置路由,打*號的就是要在LINUX拔號到WIN98時要手工加上的。

    現在TELNET上VMS68執行回拔腳本,連通后用route print得到如下信息:

    Active Routes:

    Network Address Netmask Gateway Address Interface Metric
    1 0.0.0.0 0.0.0.0 192.168.88.128 192.168.88.3 1
    2 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
    3 192.168.88.0 255.255.255.0 192.168.88.3 192.168.88.3 1
    4 192.168.88.3 255.255.255.255 127.0.0.1 127.0.0.1 1
    5 192.168.88.255 255.255.255.255 192.168.88.3 192.168.88.3 1
    6 192.168.89.0 255.255.255.0 192.168.89.69 192.168.89.69 1
    7 192.168.89.69 255.255.255.255 127.0.0.1 127.0.0.1 1
    8 224.0.0.0 224.0.0.0 192.168.89.69 192.168.89.69 1
    9 224.0.0.0 224.0.0.0 192.168.88.3 192.168.88.3 1
    10 255.255.255.255 255.255.255.255 192.168.89.69 192.168.89.69 1
    現在可看到跟上面的不同了,要在WIN98的DOS窗口下執行以下批處理:
    route change 0.0.0.0 mask 0.0.0.0 192.168.88.128 metric 2
    route add 0.0.0.0 mask 0.0.0.0 192.168.89.69

    現在再用route print就會得到如下信息:
    .
    Active Routes:

    Network Address Netmask Gateway Address Interface Metric
    1 0.0.0.0 0.0.0.0 192.168.89.69 192.168.89.69 1
    2 0.0.0.0 0.0.0.0 192.168.88.128 192.168.88.3 2
    3 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
    4 192.168.88.0 255.255.255.0 192.168.88.3 192.168.88.3 1
    5 192.168.88.3 255.255.255.255 127.0.0.1 127.0.0.1 1
    6 192.168.88.255 255.255.255.255 192.168.88.3 192.168.88.3 1
    7 192.168.89.0 255.255.255.0 192.168.89.69 192.168.89.69 1
    8 192.168.89.69 255.255.255.255 127.0.0.1 127.0.0.1 1
    9 224.0.0.0 224.0.0.0 192.168.88.3 192.168.88.3 1
    10 224.0.0.0 224.0.0.0 192.168.89.69 192.168.89.69 1
    11 255.255.255.255 255.255.255.255 192.168.89.69 192.168.89.69 1

    現在可TELNET上VMS68,在VMS68上拔號到INTERNET,現在J003可通過VMS68上網了。

    一些不足的地方:
    一.要手工的地方太多,不大方便,請朋友們再改良一下。
    二.只能用兩個串口,我沒有玩過多用戶卡,請有經驗的朋友指點一下在LINUX下用那種多用戶卡最好,在那有賣,多少錢

    文章來源于領測軟件測試網 http://www.kjueaiud.com/


    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備2023014753號-2
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>