0

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

2 Answers2

2

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.

Ken Bloom
  • 121
  • 3
0

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.

ephemient
  • 1,420
  • 1
  • 11
  • 8