Re: Redirect *:port to ip:port on the same machine?

2005-05-12 Thread Carlos Alloatti
On 5/11/05, Andrew P. [EMAIL PROTECTED] wrote:
 Hello!
 
 I have a program that binds to ip:port. What are
 my options, if I want it to listen on all interfaces
 (*:port)? Let's say reconfiguring the program
 and/or running one instance per interface is
 not possible. I've got ipfw as a firewall.
 
 Thanks!

How about using a port forwarder or port mapper.

I think you could use ipfw and natd for it, with a divert rule, found this:

quote
 If I want to have a port mapping on the same interface, can I do that ? 

 127.0.0.1: 8890 - 127.0.0.: 25 ? 
 If I want to do so, what is natd command ? 
 natd -redirect_port 127.0.0.1:8890 25? 



--­--­ 
 
#!/bin/sh 

outip=my ip address which will be redirected 
server=ip address redirect to 


# for request redirect 
ipfw add 1000 divert  tcp from any to ${outip} 8890 via cx0 
ipfw add 2000 divert  ip from ${server} to any via cx0 


#run natd 
natd -p  -n cx0 -redirect_port tcp ${server}:25 8890 
ipfw add 2500 allow tcp from any to ${server} 25 via any 

/quote


but how about this:

http://www.taronga.com/plugdaemon/
http://www.freebsd.org/cgi/url.cgi?ports/net/jumpgate/pkg-descr

the port mapper will bind to *:port2 and forward to ip:port1


-- 
Carlos Alloatti
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Redirect *:port to ip:port on the same machine?

2005-05-12 Thread WMC
At 12:56 PM 5/12/2005, you wrote:
I have a program that binds to ip:port. What are my options, if I want it 
to listen on all interfaces (*:port)? Let's say reconfiguring the program 
and/or running one instance per interface is not possible.
How 'bout:
* Install ports/net/redir
* Config original program to listen on localhost
* Config redir to pass from the other IPs to localhost.
  -Wayne
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Redirect *:port to ip:port on the same machine?

2005-05-12 Thread Andrew P.
On 5/12/05, Carlos Alloatti [EMAIL PROTECTED] wrote:
 On 5/11/05, Andrew P. [EMAIL PROTECTED] wrote:
  Hello!
 
  I have a program that binds to ip:port. What are
  my options, if I want it to listen on all interfaces
  (*:port)? Let's say reconfiguring the program
  and/or running one instance per interface is
  not possible. I've got ipfw as a firewall.
 
  Thanks!
 
 How about using a port forwarder or port mapper.
 
 I think you could use ipfw and natd for it, with a divert rule, found this:
 
 quote
  If I want to have a port mapping on the same interface, can I do that ?
 
  127.0.0.1: 8890 - 127.0.0.: 25 ?
  If I want to do so, what is natd command ?
  natd -redirect_port 127.0.0.1:8890 25?
 
 --­--­
 
 #!/bin/sh
 
 outip=my ip address which will be redirected
 server=ip address redirect to
 
 # for request redirect
 ipfw add 1000 divert  tcp from any to ${outip} 8890 via cx0
 ipfw add 2000 divert  ip from ${server} to any via cx0
 
 #run natd
 natd -p  -n cx0 -redirect_port tcp ${server}:25 8890
 ipfw add 2500 allow tcp from any to ${server} 25 via any
 
 /quote
 
 but how about this:
 
 http://www.taronga.com/plugdaemon/
 http://www.freebsd.org/cgi/url.cgi?ports/net/jumpgate/pkg-descr
 
 the port mapper will bind to *:port2 and forward to ip:port1

Yeah, thanks, I think that's just what I need!

Best wishes,
Andrew P.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Redirect *:port to ip:port on the same machine?

2005-05-11 Thread Tomas Quintero
On 5/11/05, Andrew P. [EMAIL PROTECTED] wrote:
 Hello!
 
 I have a program that binds to ip:port. What are
 my options, if I want it to listen on all interfaces
 (*:port)? Let's say reconfiguring the program
 and/or running one instance per interface is
 not possible. I've got ipfw as a firewall.
 
 Thanks!
 Andrew P.

In something like PF, for instance I have FTP connections forwarding
to FTP-Proxy locally so I use a line like:

rdr on $int_if inet proto tcp from $int_net to any port ftp -
127.0.0.1 port 8021

I have no idea how you would write that for IPFW however.

-- 
-Tomas Quintero
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: redirect port

2004-02-19 Thread Deling Ren
Are you using ipfilter or ipfw? In the former case, read this how-to:

http://www.obfuscation.org/ipf/ipf-howto.html

Deling

On Sat, 2 Jan 1999, Stanley Chan wrote:

 Dear Friends,

 The example in the NAT documents is sufficient, can anyone tell me how
 to redirect ports in the NAT machine. How to put the following command
 in the rc.conf ? I want to use one of the amchine behind the NAT to run
 web server.


 -redirect_port tcp 192.168.0.2:6667 6667
 -redirect_port tcp 192.168.0.3:80 80

 Thanks

 Sanley



 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: redirect port

2004-02-19 Thread Randy Grafton
Stanley,

If you are using natd and have recompiled your kernel with the appropriate
options then this should work for you.
These are entries to your /etc/rc.conf, (just a starting point, you can fine
tune to your needs):
gateway_enable=YES
firewall_enable=YES
firewall_type=OPEN
firewall_quiet=YES
firewall_logging=YES
natd_enable=YES
natd_interface=fxp0
natd_flags=-f /etc/natd.conf

In the above statement natd_interface=fxp0, fxp0 is the outside nic of
your system.
Next put these statements in your /etc/natd.conf file as referenced above,
(natd.conf doesn't exist by default, you'll create it):
same_ports  yes
dynamic yes
redirect_port tcp inside_address:port outside_address:port
redirect_port udp inside_address:port outside_address:port

As shown above, don't forget to redirect udp traffic if the service you're
trying to facilitate needs it. Also know that the ports for the inside and
the outside don't have to match. For example, my service provider blocks
http/port 80 traffic coming in to my connection so my statement in the
natd.conf file would be something like:
redirect_port 192.168.1.10:80 outside_address:8080

By doing so outside connectivity attempts to my isp assigned address have to
be stated as: http://outside_address:8080.

FYI if you ever want to host gaming sessions on an inside system like
Counter strike or Unreal Tournament, then put a couple of lines like these
in your natd.conf file, (these examples are ones that I used so that my
buddies and I could blast away in Unreal Tournament):

redirect_port tcp inside_address:-7781 outside_address:-7781
redirect_port udp inside_address:-7781 outside_address:-7781

As you make these changes you can apply them without restarting by running
/etc/netstart.

Hope that helps.

-Randy



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Stanley Chan
Sent: Friday, January 01, 1999 9:10 AM
To: [EMAIL PROTECTED]
Subject: redirect port


Dear Friends,

The example in the NAT documents is sufficient, can anyone tell me how to
redirect ports in the NAT machine. How to put the following command in the
rc.conf ? I want to use one of the amchine behind the NAT to run web server.


-redirect_port tcp 192.168.0.2:6667 6667
-redirect_port tcp 192.168.0.3:80 80

Thanks

Sanley



___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]