How to Connect 2 Linux Server using serial ports only?
Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to Connect 2 Linux Server using serial ports only?
I have two Linux Servers running RHEL3 on HP server DL360.
Previously I used to tip one Unix Server from another Unix Server via their serial ports using the command:
On UNIX Server A
#tip -9600 /dev/ttyb
#Connected.
#<from here connected to UNIX server B console>
where ttyb is the serial port B behind Sun Server.
I would like to do the same to my Linux servers. But I am not able to do this since the tip command does not exist in Linux RHEL3. I am using null-modem cable to connect the 2 HP servers.
Hi Rahulk,
I installed UUCP rpm. The tip command still does not exist but the CU command works now.
When applying the command
#cu -l /dev/ttyS0 -s 9600
I get
cu: open <dev/ttyS0>: Permission denied
cu: /dev/ttyS0: Line in use
The same applies for ttyS1.
#cu -l /dev/ttyS1 -s 9600
I get
cu: open <dev/ttyS1>: Permission denied
cu: /dev/ttyS1: Line in use
what is for sure is that the two servers are connected by a null modem cable via serial ports. Their other serial port is used for the standard console.
Hi Zulfilee,
I tried your command, but i get the following result on both machines:
#pppd -detach crtscts local 10.0.0.1:10.0.0.2 /dev/ttyS1 9600
using interface ppp0
Connect: ppp0 <--> /dev/ttyS1
LCP: timeout sending Config-Requests
Connection terminated.
I need to get access to the server B through server A via serial port. However, we should assume that server B cannot be accessed via the console because of console faults. Hence all the commands should be done on only one server A trying to connect to another server B.
if the serial port is open then try to use the cu command for all the four COM ports (ttyS0, ttyS1, ttyS2, ttyS3). I am sure one of the serial port must be useful for you. if non of this works then you will have to open the port via "agetty" command.
# /sbin/agetty 9600 ttyS1 ## or ttyS[0,2,3]
in case your terminal just sleeps without showing the login console then try this command
I am sending the following command though remote SSH connection to the server
# /sbin/agetty 9600 ttyS1 ## or ttyS[0,1]
When i use ttyS0 - the ssh connection to the remote server is closed
when i user ttyS1, the terminal sleeps or hangs there...until I CTRL-C.
/sbin/agetty -L 9600 ttyS1 vt100
terminal sleeps..or hang there...until I CTRL-C
I am sending the following command though remote SSH connection to the server
# /sbin/agetty 9600 ttyS1 ## or ttyS[0,1]
When i use ttyS0 - the ssh connection to the remote server is closed
when i user ttyS1, the terminal sleeps or hangs there...until I CTRL-C.
/sbin/agetty -L 9600 ttyS1 vt100
terminal sleeps..or hang there...until I CTRL-C
any idea?
thanks
seb
yes you are right, the command will hang up. What you need to do is to put the command
/sbin/agetty -L 9600 ttyS1 vt100
in background.
afterwards try to connect to this via cu.
if u r still unable to use the port then I suggest using the following command:-
setserial -a /dev/ttyS0
setserial -a /dev/ttyS1
to figure out exact issue with the serial port.
FYI:- cu command in Linux is an alternative to "tip" command. minicom simply needs a setup on a particular port ttyS0 or ttyS1 to allow the connection to other computer. after making settings in "minicom" you can directly connect to other computer. Alternatively, as others have posted "ppp" can also be used to have communication between two servers.
using
cu -l /dev/ttyS0 -s 9600
above
If it says ttyS0 is in use.
There is a lock file you need to delete.
usually in
/var/lock/
you will find lock file to remove in there.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
well... that actually worked... im sure this is an old post.. so im sry for rezing it so to speak, but... i have 2 questions pertaining to this subject.. first of all, using suse 10.0, how would i go about adding that to my inittab file to make the 'server' end of the pppd persistant instead of having to manually enter the command on both ends every time, second... the server end uses firestarter to share a dialup internet connection with an ethernet lan, how can i setup firestarter to recognize 3 interfaces so i can share the dialup internet connection to the null modem connection as well?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.