国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

Linux與Linux之間的互拔

2024-07-21 02:37:41
字體:
來源:轉載
供稿:網友

  一.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 don't ask.)
  #
  DIALER_SCRIPT=/home/ppp/ppp-on-dialer
  #
  # Initiate the connection
  #
  # I put most of the common options on this command. Please, don't
  # 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. Don't 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 don't ask.)
  #
  DIALER_SCRIPT=/home/ppp/ppp-on-dialer
  #
  # Initiate the connection
  #
  # I put most of the common options on this command. Please, don't
  # 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. Don't 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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 花垣县| 金堂县| 五常市| 理塘县| 哈巴河县| 盈江县| 玉龙| 肥西县| 屯留县| 安徽省| 中阳县| 孟连| 茶陵县| 来宾市| 丹寨县| 隆安县| 扬中市| 新余市| 佛学| 丰城市| 民丰县| 山阴县| 阿拉善右旗| 雷波县| 云林县| 比如县| 米易县| 安溪县| 福建省| 枞阳县| 建平县| 陵川县| 通渭县| 五指山市| 双牌县| 清水河县| 淳安县| 辽阳市| 黔西| 海淀区| 类乌齐县|