[TriLUG] vonage behind nat

Jon Carnes jonc at nc.rr.com
Sat Mar 5 01:38:21 EST 2005


On Fri, 2005-03-04 at 16:49, Joshua Gitlin wrote:
> I have two Vonage boxes, which brought up the question, which one do I 
> forward the ports to? It turns out you don't have to forward the port 
> at all, it just works.
> 
> However, I have a linux router and can't get QoS to work properly. I 
> set the priority flags for the packets in iptables, but it still 
> doesn't work. If I'm downloading a torrent, for example, the phone is 
> unusable.
> 
> What I'd like to do is have the phone adaptors on a separate subnet 
> (well, they already are...) and possibly on a separate ethernet nic, 
> like eth2. (eth0 is my cable modem and eth1 is my local network). Then 
> I'd like to guarantee bandwidth to eth2 over eth1... not just 
> "preference" VoIP traffic, because preferencing isn't working...
> 
> is this possible? Or do I just have my QoS all screwed up?
> 
> -Josh
> 
> 
> -----------

Try something like this script... It sets the maximum bandwidth for TCP
applications to 300Kb - leaving the rest of the Bandwidth for UDP (used
for Voice traffic). Not including comments, it's 3 lines (so beware of
line-wrap).

#http://www.linuxforum.com/linux-advanced-routing/lartc.ratelimit.single.html
# Commands to add rate limiting for TCP in Linux
# These commands must be run as root
#
#  eth0     = firewall's external network card (attached to internet)
#  10mbit   = speed of external network card
#  300kbit  = max TCP upload speed
 
# Create a Class based queue
# Set normal interface speed (10Mb) for use in calculations
tc qdisc add dev eth0 root handle 1: cbq avpkt 1000 bandwidth 10mbit
 
# Create a 300Kb class
tc class add dev eth0 parent 1: classid 1:1 cbq rate 300kbit allot 1500
prio 5 bounded isolated
 
# Tell which traffic should use the shaped class
# Protocol 6 = TCP
tc filter add dev eth0 parent 1: protocol ip prio 16 u32 match ip
protocol 6 0xff flowid 1:1
 
# ... to match a single ip address
#       ...  match ip dst 195.96.96.97 flowid 1:1
#       ...  match ip dst ! 216.134.205.166 flowid 1:1
 
# If it breaks everything, back out by using:
# tc qdisc del dev eth0 root

===

Jon Carnes




More information about the TriLUG mailing list