Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a regular linux box with limited banwidth which I acess through SSH.

From time to time I transfer files to/from this box with sshfs/sftp.

Please advise me on how can I set up the traffic shaping on this box so that the (interactive) ssh sessions remain responsive irrespective of the sshfs/sftp transfers.

Thank you.

Best wishes,

Tintapok

share|improve this question

migrated from stackoverflow.com Feb 13 '11 at 23:42

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

You can use WonderShaper to get pretty good QoS for ssh, and to tell SSH and SFTP apart.

Wondershaper does this based on the Type of Service bit in the IP header. SSH sets this correctly, so it's pretty easy to perform QoS based on it.

# TOS Minimum Delay (ssh, NOT scp) in 1:10:

tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
      match ip tos 0x10 0xff  flowid 1:10

For the theory, see the Linux Advanced Routing and Traffic Control HOWTO.

share|improve this answer
add comment

The default ssh_config should automatically set IPQoS appropriately for interactive versus non-interactive invocations.

Just make sure you're obeying those IP options in your traffic shaping configuration.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.