There is TCPMSS target to edit MSS value of connections (including forwarded).
How to edit window size (for example, cap to some maximum value) by iptables rule?
Expecting something like
iptables -t mangle -A OUTPUT -p tcp --dport 1234 -j TCPWINDOW --tcpwindow-set 'min(val,100000)'
Answer
To change TCP window from iptables you need to:
- checkout https://github.com/p5n/ipt_tcpwin
- build both modules using “make”
- add iptables rule, for example:
iptables -t mangle -I OUTPUT -p tcp --sport 80 --tcp-flags SYN,ACK SYN,ACK -j TCPWIN --tcpwin-set 1000
Attribution
Source : Link , Question Author : Vi. , Answer Author : sergej