LINUX.ORG.RU

limit speed of 2 IPs using iptables

 ,


0

1

Hello everyone.I do have a VPS running services for me, such as: -email server -web server -openvpn for remote connection -ssh

the available speed is 10Mbps up to now the system is protected by iptables and allows only the forementioned services and blocks the brute force attackers. I have noticed that when i get connected through openvpn it consumes all the available traffic of the system, as far i am using it. So i would like to limit it down to 1Mbps maximum speed. The VPS has a public IP such as 62.62.38.100 and the OPENVPN user when gets connected it has an IP from the range 10.0.8.0/24. The VPS has the 10.0.8.1/24 IP for the OPENVPN as a getway. Is there a way to limit the speed of download/upload of the connected users through OPENVPN?

John

You can use OpenVPN shaper:

       --shaper n
              Limit bandwidth of outgoing tunnel data to n bytes per second on the TCP/UDP port.  If you want  to
              limit the bandwidth in both directions, use this option on both peers.

              OpenVPN  uses  the following algorithm to implement traffic shaping: Given a shaper rate of n bytes
              per second, after a datagram write of b bytes is queued on the TCP/UDP port, wait a minimum of (b /
              n) seconds before queuing the next write.

              It  should be noted that OpenVPN supports multiple tunnels between the same two peers, allowing you
              to construct full-speed and reduced bandwidth tunnels at the same time, routing  low-priority  data
              such as off-site backups over the reduced bandwidth tunnel, and other data over the full-speed tun‐
              nel.

              Also note that for low bandwidth tunnels (under 1000 bytes per second),  you  should  probably  use
              lower MTU values as well (see above), otherwise the packet latency will grow so large as to trigger
              timeouts in the TLS layer and TCP connections running over the tunnel.

              OpenVPN allows n to be between 100 bytes/sec and 100 Mbytes/sec.
ValdikSS ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.