looking to translate SRC port as well.

Dmitriy Demidov dima_bsd at inbox.lv
Fri Feb 25 19:51:56 UTC 2011


> In short, I have a sip server that is very restrictive on the dst port,
> and a sip trunk provider that is very restrictive on src ports.
> Naturally, its a great sip server, and a great sip trunk service, and
> the ports each one demands are not the same.
> the sip server listens on udp port 5080, and the sip trunk provider MUST
> send TO udp port 5060.
> (easy, right?) no, when the sip server sends to the sip trunk provider,
> the sip trunk provider must think the sip server src port is 5060 also!
> (and it is not)
> So, the sip server must think it is sending and receiving sip on port
> 5080, the sip trunk must think it is sending and receiving on port 5060.
> I have looked at ipfw/divert sockets, netawk, natd, and trying to find
> the easiest way to do it.
> I thought about writing a perl module, and have ipfw divert to it (perl
> has optional divert socket pm's)

Hi,

you can try to use Netgraph and ng_path node to alter src/dst UDP port number 
in outgoing/incoming packets flow. This node allows you change just 
*anything* in the packet.

Take a look at man page for ng_path:
www.freebsd.org/cgi/man.cgi?query=ng_patch&apropos=0&sektion=0&manpath=FreeBSD+8.1-stable&format=html


Good luck.


More information about the freebsd-ipfw mailing list