亚洲韩日午夜视频,欧美日韩在线精品一区二区三区,韩国超清无码一区二区三区,亚洲国产成人影院播放,久草新在线,在线看片AV色

您好,歡迎來到思海網絡,我們將竭誠為您提供優質的服務! 誠征網絡推廣 | 網站備案 | 幫助中心 | 軟件下載 | 購買流程 | 付款方式 | 聯系我們 [ 會員登錄/注冊 ]
促銷推廣
客服中心
業務咨詢
有事點擊這里…  531199185
有事點擊這里…  61352289
點擊這里給我發消息  81721488
有事點擊這里…  376585780
有事點擊這里…  872642803
有事點擊這里…  459248018
有事點擊這里…  61352288
有事點擊這里…  380791050
技術支持
有事點擊這里…  714236853
有事點擊這里…  719304487
有事點擊這里…  1208894568
有事點擊這里…  61352289
在線客服
有事點擊這里…  531199185
有事點擊這里…  61352288
有事點擊這里…  983054746
有事點擊這里…  893984210
當前位置:首頁 >> 技術文章 >> 文章瀏覽
技術文章

Linux與Linux之間的互拔

添加時間:2011-5-5  添加: admin 

一.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如下:
# to initiate a ppp connection. This is the first part of the
# pair of s. This is not a secure pair of s 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 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_=/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_ \
debug

現在配vms68拔到j128,文件ppp-onj128如下:
# to initiate a ppp connection. This is the first part of the
# pair of s. This is not a secure pair of s 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 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_=/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_ \
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如下:
# to initiate a ppp connection. This is the first part of the
# pair of s. This is not a secure pair of s 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 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_=/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_ \
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下用那種多用戶卡最好,在那有賣,多少錢

關鍵字:拔號、服務器、IP

分享到:

頂部 】 【 關閉
版權所有:佛山思海電腦網絡有限公司 ©1998-2024 All Rights Reserved.
聯系電話:(0757)22630313、22633833
中華人民共和國增值電信業務經營許可證: 粵B1.B2-20030321 備案號:粵B2-20030321-1
網站公安備案編號:44060602000007 交互式欄目專項備案編號:200303DD003  
察察 工商 網安 舉報有獎  警警  手機打開網站