Re: Netfilter and Vonage.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 20, 2004 at 01:14:34AM -0400, John A. Sullivan III wrote:
> iptables -t nat -A PREROUTING -i eth0 -p 17 -d $EXTERNAL_IP --dport
> 10000:20000 -j DNAT --to-destination 192.168.0.5:10000-20000

This turned the trick.  For the record (and those who look for this in the
future) here's what I did to make it all work:

Thanks!
Jason

######################################################################
#!/bin/bash

# NOTES:
# 1) This assumes that eth0 will be the external interface
# 2) We also assume that this is a DHCP assigned external IP.
# 3) Assume that DHCPD will assign Vonage the 192.168.0.5.

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

# Get current details:
EXTERNAL_IP=`ifconfig eth0 | grep "inet addr:" | awk '{print $2}' | \
		cut -f 2 -d :`
VONAGE_IP=192.168.0.5

##############
# Vonage stuff

iptables -t nat -A PREROUTING -i eth0 -p udp -d $EXTERNAL_IP \
		--dport 53 -j DNAT --to ${VONAGE_IP}:53
iptables -t nat -A PREROUTING -i eth0 -p udp -d $EXTERNAL_IP \
		--dport 69 -j DNAT --to ${VONAGE_IP}:69

iptables -t nat -A PREROUTING -i eth0 -p udp -d $EXTERNAL_IP \
		--dport 5060:5061 -j DNAT \
		--to-destination ${VONAGE_IP}:5060-5061
iptables -t nat -A PREROUTING -i eth0 -p udp -d $EXTERNAL_IP \
		--dport 10000:20000 -j DNAT \
		--to-destination ${VONAGE_IP}:10000-20000
##############


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux