Date: Fri, 25 Feb 2011 19:35:43 +0000 From: Dmitriy Demidov <dima_bsd@inbox.lv> To: michael.scheidell@secnap.com, freebsd-ipfw@freebsd.org Subject: Re: looking to translate SRC port as well. Message-ID: <201102251935.43414.dima_bsd@inbox.lv>
next in thread | raw e-mail | index | archive | help
> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102251935.43414.dima_bsd>