-   Linux - Networking (
-   -   agetty over the network (

keirvt 04-18-2013 01:20 AM

agetty over the network
I have friend that has terminals connected to a server that has terminal server cards. Time for that to go beside the terminal cards have lost the magic smoke. They don't want to rewire the premises with ethernet cable and we want to use the serial cabling and more or less existing serial software..

I bought an Advantek EKI 1521, that is an ethernet to serial converter. I would like to connect a Wyse style terminal to the EK 1521 and get a login session most likely converting the serial port traffic to network traffic.

Using wireshark I can see the EK and my test linux box are exchanging packets. Instead of a terminal I'm using a second linus machine and talking to the EK through its serial port using cutecom. I can sed characters to the EK and they display on cutecom or even simply cat /dev/ttyS0 shows characters sent using netcat on an appropriate port for the EK device

However I want a login session.

My question is how do I get agetty or mgetty to not address the serial port but instead create network traffic to a particular IP on a certain port(the EK) perhaps using something like netcat.

There is a network serial software called ser2net that allows network connections to be made to a serial port. This daemon listen on serial port where as I want mgetty to talk not to a serial port but to the network.

pan64 04-18-2013 01:43 AM

I would say you missed a very important point. the serial interface gives you a very simple and straightforward connection to the box. You can reach and handle even a half-dead os using serial teminals. Using it over network has no real meaning. There are much better and advanced solutions available for example telnet or ssh can be used.
(but probably I missed something)

michaelk 04-18-2013 08:33 AM

From the manual the EK has a client mode whereby you can configure an IP address and port on the device. This might satisfy your requirements.

keirvt 04-21-2013 04:32 PM

Need to replace the serial ports
Just go over it again.

There is a linux server with multiple serial ports and terminals attached to each serial port. The serial port card has died (digicard). In any event we would like to begin replacing the multiple serial connections with ethernet connections.

With the serial to ethernet converter EK 1521 characters on a serial line coming from a Wyse terminal characters are converted to ethernet and delivered to the server. I can see the packets with wireshark.

I want the server to respond to the ethernet connection with a login prompt and have this appear on the Wyse terminal. I'm simulating the Wyse on a second linux box using cutecom.

Can't use telnet because you need a telnet client one the serial (Wyse) end.

The program getty provides the login behaviour I want but only talks to a serial port and I want it to talk to a network connection.

Is there a way I can get this application (or some other similar application) to chat on a network connection?

keirvt 04-24-2013 05:30 PM

Should work but needs work
I can listen to a terminal on the server using
netcat. So to see typing on the serial port of the remote machine I can use

nc -l 8701
where 8701 is the outgoing port I use on the serial to ethernet converter.
I can direct listened output into a file

I can send data back to the terminal using the designated import port 8702

echo "Some stuff"|nc 8702
where is the IP of the ethernet converter

What I would like to do is

nc -l 8701 | bash | nc 8702
The idea being that listened data goes to a shell and the output from the shell is sent back to the terminal. The problem seems to be the bash or sh invocation not responding or sending back to the terminal through netcat.

I could write a Python program (because Python is the easiest) that listens on a port executes the OS command collects the output and sends back to the IP device but that is a a bit of effort and may not work anyway. Probably should be written in C or I could get the code for agetty and modify that which is a lot of work too.

Any suggestions?

All times are GMT -5. The time now is 12:51 AM.