LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
Search this Thread
Old 09-05-2006, 02:18 AM   #1
SebTECH
LQ Newbie
 
Registered: Sep 2006
Location: Singapore
Posts: 6

Rep: Reputation: 0
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!!
 
Old 09-05-2006, 02:38 AM   #2
rahulk
Member
 
Registered: Mar 2006
Posts: 110

Rep: Reputation: 16
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.
 
Old 09-05-2006, 02:46 AM   #3
rahulk
Member
 
Registered: Mar 2006
Posts: 110

Rep: Reputation: 16
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.
 
Old 09-05-2006, 04:48 AM   #4
SebTECH
LQ Newbie
 
Registered: Sep 2006
Location: Singapore
Posts: 6

Original Poster
Rep: Reputation: 0
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!!!
 
Old 09-05-2006, 07:59 PM   #5
SebTECH
LQ Newbie
 
Registered: Sep 2006
Location: Singapore
Posts: 6

Original Poster
Rep: Reputation: 0
anyone can help me!!.. thanks!!
 
Old 09-06-2006, 03:04 AM   #6
SebTECH
LQ Newbie
 
Registered: Sep 2006
Location: Singapore
Posts: 6

Original Poster
Rep: Reputation: 0
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!!

Last edited by SebTECH; 09-06-2006 at 03:53 AM.
 
Old 09-06-2006, 03:36 AM   #7
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
Then it may be ttyS1

Try ttyS1 instead of ttyS0.
 
Old 09-06-2006, 03:39 AM   #8
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
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
 
Old 09-06-2006, 04:01 AM   #9
SebTECH
LQ Newbie
 
Registered: Sep 2006
Location: Singapore
Posts: 6

Original Poster
Rep: Reputation: 0
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

Last edited by SebTECH; 09-06-2006 at 04:02 AM.
 
Old 09-06-2006, 04:20 AM   #10
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
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.
 
Old 09-07-2006, 12:00 AM   #11
rahulk
Member
 
Registered: Mar 2006
Posts: 110

Rep: Reputation: 16
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.

Last edited by rahulk; 09-07-2006 at 12:02 AM.
 
Old 09-12-2006, 02:57 AM   #12
SebTECH
LQ Newbie
 
Registered: Sep 2006
Location: Singapore
Posts: 6

Original Poster
Rep: Reputation: 0
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
 
Old 09-13-2006, 06:53 AM   #13
rahulk
Member
 
Registered: Mar 2006
Posts: 110

Rep: Reputation: 16
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.

Last edited by rahulk; 09-13-2006 at 07:55 AM.
 
Old 12-22-2006, 04:32 AM   #14
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: AIX/Gentoo/Fedora/Solaris 8/9/10
Posts: 100

Rep: Reputation: 15
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.
 
Old 01-20-2007, 09:36 AM   #15
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,079

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
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?
 
  


Reply

Tags
connect, port, serial, servers


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Serial Port to connect to server deathazre Linux - Networking 4 07-16-2006 10:15 PM
connect linux to MS-windows via serial ports longnam Slackware 2 04-30-2005 03:08 PM
Problem Programming Serial Ports in Linux 7.2 esi-eric Linux - Hardware 1 07-19-2004 12:03 PM
Serial ports doesn't work under SuSE Linux 9.0... peso Linux - Hardware 13 02-20-2004 01:38 AM
Monitoring Serial Ports under Linux fcAL Linux - General 0 09-17-2002 12:10 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration