[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: IPFWADM and telnet

> > At 00:41 22-11-96 -0500, Adam Heath wrote:
> > |I current connect to the Internet with PPPD, and all works well.  I
> > |compiled my kernel (2.0.24) with IP_MASQ enabled, and have verified
> > |this works.  Here is my question.
> > |
> > |Can it be setup, so that when someone telnets into the Linux box,
> instead
> > |of the request being handled there, it is masqueraded to one of the
> private
> > |computers on the LAN?  I have a DOS-based BBS that I can setup to
> > |incoming telnet, but it won't work through DOSEMU.
> > |
> > 
> > It's possible. Have a look around for the 'redir' package, which will
> it
> > for you.
> > 
> Not what I want.  I have looked at 'redir'.  I would like it to be
> implemented more at the kernel level.  Currently, I can run this command:
>   ipfwadm -I -P tcp -a accept -S 0/0 -D 23 -r 1000
> That will take packet coming from anywhere, headed toward the local
> port, and redirect it toward the local 1000 port.  Why can't I also put
> a destination system address?  I currently setup 'redir' to listen on
> 1000, and redirect it across the LAN(actually, across a simulated SLIP
> between linux and DOSEMU), but it seems I should be able to do something
> like it with the kernel.
> If I need to talk to the kernel guys, then if someone could direct me to
> the proper mailing list, I will post my question there.  Txs.
To those who are interested.  I have finally got this to work.

I hacked the 'redir' source to cycle back and forth between to ip 
addresses that are hard-coded into the source as each connection
comes in.  Then I setup a simulated SLIP connection bewteen linux
and two dosemu sessions(read the "Stacker" mini howto).  In each
dos session, I used 'rlfossil' to translate between the fossil and
telnet specs, and ran a dos-based bbs.

I then telnetted to my system on port 1000(where 'redir' was set 
to listen).  I got a connect on line 1 from the bbs.  I aborted the
connect.  I then immediately telnetted again to port 1000.  This
time, it connected on line 2!  I about sh*t myself when I saw it!

Now I just need to get it to load automatically.  I have a script
created to run the programs on the linux side.  I just need to
make a script that can load the dos sessions automatically.

If you think this is a lot to do on one machine, but the way I hacked
the 'redir' program, it will work with many machines on a private
lan.  As each telnet connection comes in to the linux machine, it
can be redirected to any number of IP address.  If the kernel has
a route to the address, then it will work.  So I could have the 2
bbs channels residing on another computer on the private lan, 1
channel residing in DOSEMU on linux, and even another channel
residing on a distant machine on the Internet!

I am planning on making a HOWTO out of this, also, to make
it easier for others to implement this.

(I wonder if it would work with other protocols [FTP, HTTP, whatever])

Adam Heath

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com

Reply to: