Skip to contentSkip to conversation

using iptables to speed limit connections

DISCUSSION J Webster 3 participants 4 messages Oct 26, 2011

lore
Share & tools
lore

J Webster

author
#0 lore raw

Is there any easy way to speed limit connections on a VPN to 2 Mbps?
My server is 100Mbps but I have connections on a VPN of 10.8.0.0. so need to limit the outbound connection from 10.8.0.0 to 2 Mbps. I tried reading the stuff on leaf but the tutorial doesn't seem very straightforward and there is not much information on this on the net.

#1 lore raw
Quoted 3 lines · J Webster

Is there any easy way to speed limit connections on a VPN to 2 Mbps?
My server is 100Mbps but I have connections on a VPN of 10.8.0.0. so need to limit the outbound connection from 10.8.0.0 to 2 Mbps. I tried reading the stuff on leaf but the tutorial doesn't seem very straightforward and there is not much information on this on the net.

You probably should have a look at http://lartc.org/howto/lartc.qdisc.html

----------------------------------------------------------------------

 Jon Lewis, MCP :)           |  I route
 Senior Network Engineer     |  therefore you are
 Atlantic Net                |

_________ http://www.lewis.org/~jlewis/pgp for PGP public key_________

author
#2 lore raw

The problem is not so much limiting the overall connection but limiting the connection of each individual vpn user to 2Mbps.
So, there is 100Mbps to share between 10 users, they should each get 2, giving a use of 20Mbps.
Also, I wasn't sure from those pages whether this should be applied to each IP on the VPN network 10.8.0.0/24 or every IP with outgoing packets but that would then limit the server to 2 Mbps.

Quoted 13 lines · Jon Lewis
Quoted 3 lines · J Webster

Is there any easy way to speed limit connections on a VPN to 2 Mbps?
My server is 100Mbps but I have connections on a VPN of 10.8.0.0. so need to limit the outbound connection from 10.8.0.0 to 2 Mbps. I tried reading the stuff on leaf but the tutorial doesn't seem very straightforward and there is not much information on this on the net.

You probably should have a look at http://lartc.org/howto/lartc.qdisc.html

----------------------------------------------------------------------

 Jon Lewis, MCP :)           |  I route
 Senior Network Engineer     |  therefore you are
 Atlantic Net                |

_________ http://www.lewis.org/~jlewis/pgp for PGP public key_________

#3 lore raw
Quoted 4 lines · J Webster
Quoted 3 lines · Jon Lewis
Quoted 1 line · J Webster

Is there any easy way to speed limit connections on a VPN to 2 Mbps?

Not really any easy way that I am aware of...

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

My server is 100Mbps but I have connections on a VPN of 10.8.0.0. so need to limit the outbound connection from 10.8.0.0 to 2 Mbps. I tried reading the stuff on leaf but the tutorial doesn't seem very straightforward and there is not much information on this on the net.

Agreed.

Quoted 3 lines
Quoted 3 lines

You probably should have a look at
http://lartc.org/howto/lartc.qdisc.html

<Top posting fixed>

Quoted 4 lines

The problem is not so much limiting the overall connection but limiting the connection of each individual vpn user to 2Mbps.
So, there is 100Mbps to share between 10 users, they should each get 2, giving a use of 20Mbps.

In which case you'll need a classful qdisc. HTB is probably a good place to start. You'll need a leaf class for each user, and you'll need to add a filter for each one, probably by IP address from what you've already said (or you can do using a netfilter mark using flowid)

Quoted 3 lines

Also, I wasn't sure from those pages whether this should be applied to each IP on the VPN network 10.8.0.0/24 or every IP with outgoing packets but that would then limit the server to 2 Mbps.

If I'm reading correctly, I suggest you'll need one HTB qdisc on your outbound interface, with a leaf class for each IP on the VPN network.

I've found these pages very helpful:

http://www.opalsoft.net/qos/DS.htm

See how you get on, and if you need more help then please shout.

Andy