LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   How to Connect 2 Linux Server using serial ports only? (https://www.linuxquestions.org/questions/linux-enterprise-47/how-to-connect-2-linux-server-using-serial-ports-only-480510/)

SebTECH 09-05-2006 02:18 AM

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.

Anybody can help me!!..really urgent

Thanks a lot!!

rahulk 09-05-2006 02:38 AM

firstly you need to get UUCP installed in RHEL. try the following command:-
tip -9600 /dev/ttyb

cu -l /dev/ttyS0 -s 9600

I believe that in your machine the first serial port must be ttyS0 and not ttyS1. anyways, i cud b wrong. u need to know the exact terminal name.

try to search redhat docs to install the UUCP rpm.

hope this helps

rahul.

rahulk 09-05-2006 02:46 AM

you may also use minicom for the same purpose. I suggest you to read a little more about minicom, as it is quite user-friendly.

SebTECH 09-05-2006 04:48 AM

Thanks for the info. But the tip command and the cu command does not exist in Linux. Both commands return "command not found"

for minicom, i have tried but don't understand how to make it work. I entered the following command:

#minicom -o ttyS0
Then once inside minicom, how to make the connection? Do i need to start minicom on both servers?

The purpose of me trying to connect the two servers using serial port is to be able to tip one of them in case the default console is faulty.


Thanks!!!

SebTECH 09-05-2006 07:59 PM

anyone can help me!!.. thanks!!

SebTECH 09-06-2006 03:04 AM

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.

Do you know how to tackle this problem?

Thanks!!

zulfilee 09-06-2006 03:36 AM

Then it may be ttyS1

Try ttyS1 instead of ttyS0.

zulfilee 09-06-2006 03:39 AM

Can you try using pppd command

On one machine
pppd -detach crtscts local 10.0.0.1:10.0.0.2 /dev/ttyS1 9600

On the other
pppd -detach crtscts local 10.0.0.2:10.0.0.1 /dev/ttyS1 9600

SebTECH 09-06-2006 04:01 AM

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.

Thanks

zulfilee 09-06-2006 04:20 AM

Can you try this too

#pppd -detach crtscts lock 10.0.0.1:10.0.0.2 /dev/ttyS1 9600
On both the PC`s. [I tried null modem some time back and not able to remember it]

Also check this link

http://www.faqs.org/docs/Linux-HOWTO...TO.html#DIRECT

[It has routing option as well]

As for your B always to run ppp, you can enable ppd with -nodetach option and once started , it will be running in the background without termination.

I`ll check if I have my old config somewhere and post it if I get it.

rahulk 09-07-2006 12:00 AM

hi,

can you run the followng commands on your linux machine ?

# dmesg | grep tty

if the output shows something like:-

ttyS0 at 0x03f8 (irq = 4) is a 16550A
ttyS1 at 0x02f8 (irq = 3) is a 16550A

or anything with ttyS3, ttyS4 then use the following command to check the status of the serial ports:-

setserial -g /dev/ttyS[01]


on my machine, it shows:-
# setserial -g /dev/ttyS[0-4]
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3

means that ttyS0, ttyS1 are open.

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

/sbin/agetty -L 9600 ttyS1 vt100

let me know what you get on the console.

hope it helps
Rahul.

SebTECH 09-12-2006 02:57 AM

Dear Rahulk,
thanks for the help. Here's what i got when performing the commands you suggested:

# dmesg | grep tty
ttyS0 at 0x03f8 (irq = 4) is a 16550A
ttyS1 at 0x02f8 (irq = 3) is a 16550A

# setserial -g /dev/ttyS[0,1]
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3

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

rahulk 09-13-2006 06:53 AM

Quote:

Originally Posted by SebTECH
Dear Rahulk,
thanks for the help. Here's what i got when performing the commands you suggested:

# dmesg | grep tty
ttyS0 at 0x03f8 (irq = 4) is a 16550A
ttyS1 at 0x02f8 (irq = 3) is a 16550A

# setserial -g /dev/ttyS[0,1]
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3

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.

neil 12-22-2006 04:32 AM

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.

frieza 01-20-2007 09:36 AM

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?


All times are GMT -5. The time now is 03:32 AM.