LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-11-2007, 07:34 PM   #1
mitchden
LQ Newbie
 
Registered: Oct 2007
Posts: 1

Rep: Reputation: Disabled
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
 
Old 10-12-2007, 05:47 AM   #2
rmitev
LQ Newbie
 
Registered: Sep 2007
Posts: 27

Rep: Reputation: 15
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
 
Old 10-16-2007, 01:23 PM   #3
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

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


Reply


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
PLESK [Solution] Change port to 23 (telnet) instead of default port 8443 x5452 Linux - Software 6 05-10-2009 05:58 AM
telnet port 25 frankcchan Linux - Software 2 12-30-2006 11:38 PM
serial port (ttyS1) - Sending commands via terminal... HELP!!! Nalorin Linux - Networking 2 08-21-2005 10:22 PM
How do I setup telnet on Fedorac1 so I can telnet to it from winxp? mman49 Fedora 6 05-02-2004 12:40 PM
telnet to port 80 davee Linux - Networking 5 08-06-2003 03:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:36 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration