On Tue, 2014-09-09 at 17:44 +1200, aaron mcewan wrote: > On Tue, 09 Sep 2014 17:21:06 +1200 > Steve Holdoway <[email protected]> wrote: > > > I really never did get the hang of this... much like Mondays. > > > > I have a little linuxgateway box that delivers the usual > > DNS/DHCP/squid/squidguard etc services, and it also runs as a VoIP > > gateway. > > > > At the moment I have a SIP softphone running, and when away from home, > > I access the Asterisk server over a VPN... I've seen the volume of > > attempted hacks if you leave SIP on the internet! > > > > I would like to use an IAX2 extension instead, and access the exchange > > directly. To do this with a single configuration, I'd like to be able to > > redirect traffic that is sent to the (static) external IP address from > > an internal source. > > > > I'm sure that iptables can do this, but it's beyond me today. > > > > Any suggestions?? > > > > Cheers, > > > > Steve > > hi, > something like this should do the trick: > > iptables -t nat -A PREROUTING -i <external interface> -p udp --dport 4596 -j > DNAT --to-destination <dest ip>:4596 > > aaron m
Once I got the idea that this would be the only traffic directed to the external IP address, it got a bit simpler: iptables -t nat -A PREROUTING -p udp --destination <externip> --dport 4569 -j DNAT --to-destination <internipofgateway>:4569 Seems to be working a treat. Cheers, Steve -- Steve Holdoway BSc(Hons) MIITP http://www.greengecko.co.nz Linkedin: http://www.linkedin.com/in/steveholdoway Skype: sholdowa _______________________________________________ Linux-users mailing list [email protected] http://lists.canterbury.ac.nz/mailman/listinfo/linux-users
