LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Setup ttys1 as telnet / IP port (https://www.linuxquestions.org/questions/linux-networking-3/setup-ttys1-as-telnet-ip-port-591186/)

mitchden 10-11-2007 07:34 PM

Setup ttys1 as telnet / IP port
 
Hi

I have a CentOS 4.0 box running as a router it uses a ppp dialer to get its internet connection and has iptables do various things.

In short I have a requirement to forward telnet packets (port 23) to/from the outside to/from a serial port.

The port forwarding and ip tables is the easy part from what I can see however the configuration of the serial port (ttys1) as an IP address is where I seem to get stuck.

I can provide a deep explanation of the whole project if required but I thought there may just be a simple solution out there.

Thanks

rmitev 10-12-2007 05:47 AM

Modem Sharing mini-HOWTO

It is assumed that the server is a Linux system with either:

* a modem attached to a /dev/ttySx device
* an 'isdn4linux'-emulated modem mapped to a /dev/ttyIx device

The easiest setup I can think of uses a five lines perl script to implement a modem daemon in /usr/sbin/modemd:


#!/usr/bin/perl
select((select(STDOUT), $| = 1)[$[]);
select((select(STDIN), $| = 1)[$[]);
exec 'cu -s 115200 -l /dev/ttyS1';
die '$0: Cant exec cu: $!\n';

The modem daemon is started by the inetd process if a client connects to the appropriate port as described below. The modemd simply connects the socket handle with STDIN and STDOUT of the cu command and lets cu handle the actual modem device.

The existence of the modem daemon must be made known to the inetd process by updating its configuration file, usually /etc/inetd.conf like:

#
# modem daemon
#
modem stream tcp nowait root /usr/sbin/tcpd /usr/sbin/modemd /dev/ttyS1

In order to make this work, an entry to /etc/services needs to be added like:


modem 2006/tcp modemd

....

______________________________________________
http://www.faqs.org/docs/Linux-mini/...m-Sharing.html

archtoad6 10-16-2007 01:23 PM

Is the modem working & are you getting a 'Net connection?

It's not clear how many interfaces you have.

Is the "ppp dialer" connected to the "serial port (ttys1)"? If so, then the IP address should be supplied by your ISP.

OTOH, if these are separate interfaces, I see 3 possibilities:
  • Assign a static IP.
  • Run a DHCP server on the server.
  • The connection doesn't need an IP address.


All times are GMT -5. The time now is 01:23 AM.