Subject: Re: is this a job for ipnat?
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: None <>
List: tech-net
Date: 12/04/1999 16:23:09
On Sat, Dec 04, 1999 at 04:03:07PM -0500, der Mouse wrote:
> Now, one of the things in the serial line netlink was code to rewrite a
> particular address/port to another address/port.  This is because I
> have a mud running on, on ports 5757 and 7575.  But we
> heard of cases where people could telnet but couldn't specify arbitrary
> port numbers.  So I made the mud listen on port 57575 as well, then
> added code to the serial-line encapsulation so that incoming packets to
> port 23 (telnet) get rewritten to port
> 57575, with the converse rewrite for outgoing packets.  (Of course,
> attempts from the world-at-large to connect to port 57575
> will not work, since the return packets will get rewritten; this is why
> I used a third port.)
> Now I want a similar rewriting effect for the DSL link.  I could, I
> suppose, hack some special-case code into the kernel of the gateway box
> (which is dedicated to the purpose), but I'd rather not.  I was
> considering alternatives and it occurred to me that the NAT code may be
> able to do this.

	This should work just fine with a ipnat rule like:

rdr ppp0 port=23 -> port=7575 tcp

	This will allow you to connect to as if you
were connecting to port 7575.  And, since ipnat keeps track of the
connections it is currectly redirecting you will still be able to connect
to port 7575 normally.

rdr ppp0 port=23 -> port=7575 tcp
	if you actually want connections to to
get redirected.