How to rewrite only the port on incoming/outgoing packets

How to rewrite only the port on incoming/outgoing packets

Post by InfernalFi » Wed, 20 Jun 2001 03:29:55



I've got a client program that talks to one or more server programs. The
restriction being that each server program must run on the same tcp port or the
client won't communicate properly. When run from different machines, this works
fine. I'd like to run 2 servers from the same machine. One of the
possible ways I've figured to do this is: the servers are run from Netra T1
machines which have 2 ethernet interfaces. Is it possible to get some kind
of port redirection software for unix that can sit on the Netra and listen to
one of the interfaces and rewrite port calls to it? This way one of the servers
could run on 30000, and the other on 30001. Any traffic directed for one
interface on 30000 would remain the same and connect to the server on 30000.  
Any traffic directed for the other interface on 30000 would get rewritten with
the destination port 30001 and passed in to the server at 30001. The same
would have to happen for outgoing packets. Is this possible or can you
think of another way to accomplish this?
 
 
 

How to rewrite only the port on incoming/outgoing packets

Post by Barry Margoli » Wed, 20 Jun 2001 03:35:51




>I've got a client program that talks to one or more server programs. The
>restriction being that each server program must run on the same tcp port or the
>client won't communicate properly. When run from different machines, this works
>fine. I'd like to run 2 servers from the same machine. One of the
>possible ways I've figured to do this is: the servers are run from Netra T1
>machines which have 2 ethernet interfaces. Is it possible to get some kind
>of port redirection software for unix that can sit on the Netra and listen to
>one of the interfaces and rewrite port calls to it? This way one of the servers
>could run on 30000, and the other on 30001. Any traffic directed for one
>interface on 30000 would remain the same and connect to the server on 30000.  
>Any traffic directed for the other interface on 30000 would get rewritten with
>the destination port 30001 and passed in to the server at 30001. The same
>would have to happen for outgoing packets. Is this possible or can you
>think of another way to accomplish this?

You can do this with the "plug-gw" component of the TIS Firewall Toolkit.
You can get this at <ftp://ftp.tis.com/pub/firewalls/toolkit/>.

--

Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

1. Can you port forward both incoming and outgoing packets?

I have a system set-up with 2 routers, 1 router is a cable modem the other
an ISDN router.

They are connected to different ISP's and have different IP addresses. Each
router uses NAT.

I have a Linux server which acts as a gateway for my network. With the
default gateway set to router 1 is it possible to add a port forward command
than will relay all port 25 (SMTP email) to router2 on OUTGOING packets?

I would also like to add an incoming port forward command to redirect my
incoming email on port 25 (it's an SMTP feed) to 192.168.1.51. How would I
do this?

I'm using LRP EigerStein Beta 2 for router 1.

Thanks in advance.
--

|---------------------------------------------------|
| Anti-Spam - Please reply to address below          |

|---------------------------------------------------|

2. Thank

3. Transparent port reassigning of UDP on incoming/outgoing packets?

4. Multi-boot system/FreeBSD screwing up ethernet connection?

5. Incoming and outgoing Packets under Solaris2.6

6. Newbie trying to set up Internet connection

7. Blocking outgoing and incoming DHCP packets

8. csh considered harmful

9. Logging incoming, outgoing packet on firewall, good choice or bad choice ?

10. Tool to view incoming/outgoing packets???

11. How do I open Port 1494 for Incoming and Outgoing?

12. Change the destination port # of an outgoing packet...

13. netfilter: Redirecting incoming udp packets to other port