Subject: Does IPNAT rdr work?
To: None <current-users@NetBSD.ORG>
From: Ian Dall <Ian.Dall@dsto.defence.gov.au>
List: current-users
Date: 05/11/1998 22:37:11
I have a headless machine as a gateway and I wish to redirect X traffic
to an Xterm (well a Sun3 with Xkernel).

10.0.0.1 is the address of the gateway on the local net and 131.185.44.51
is the (static) ip address for the ppp interface.

I have an ipnat config file:

#
rdr ppp0 131.185.44.51/32 port X0 -> 10.0.0.2 port X0
rdr lo0 127.0.0.1/32 port X0 -> 10.0.0.2 port X0
rdr lo0 10.0.0.1/32 port X0 -> 10.0.0.2 port X0


This seems to *almost* work. If I say do

  telnet 131.185.44.51 6000

it hangs. Then if I do "ipnat -l" 

bash# ipnat -l
List of active MAP/Redirect filters:
rdr ppp0 131.185.44.51/32 port 6000 -> 10.0.0.2 port 6000 tcp
rdr lo0 127.0.0.1/32 port 6000 -> 10.0.0.2 port 6000 tcp
rdr lo0 10.0.0.1/32 port 6000 -> 10.0.0.2 port 6000 tcp

List of active sessions:
RDR 10.0.0.2        6000  <- -> 131.185.44.51   6000  [131.185.30.33 5750] 113 0 5a15


Whereas if I say try and telnet to port 6001, I get an immediate
"Unable to connect to remote host: Connection refused".

However, if I watch the interface for my local net with tcpdump no packets
ever are actually forwarded.

Documentation for the redirect function is *extremely* thin. Am I
doing something wrong? Is the rdr functionality broken or have I
misunderstood what rdr does? Am I trying to do the impossible?

Ian