diff --git a/Shorewall2/changelog.txt b/Shorewall2/changelog.txt index 9bb9a54d7..e6fffdcec 100644 --- a/Shorewall2/changelog.txt +++ b/Shorewall2/changelog.txt @@ -104,3 +104,5 @@ Changes since 2.0.3 49) Correct logmartians handling. 50) Add a clarification and fix a typo in the blacklist file. + +51) Allow setting a specify MSS value. diff --git a/Shorewall2/firewall b/Shorewall2/firewall index ea984de26..f7723b290 100755 --- a/Shorewall2/firewall +++ b/Shorewall2/firewall @@ -5475,9 +5475,16 @@ initialize_netfilter () { run_iptables -A $chain -p ! icmp -m state --state INVALID -j DROP done - [ -n "$CLAMPMSS" ] && \ - run_iptables -A FORWARD -p tcp \ - --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu + if [ -n "$CLAMPMSS" ]; then + case $CLAMPMSS in + Yes) + run_iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu + ;; + *) + run_iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss $CLAMPMSS + ;; + esac + fi if [ -z "$NEWNOTSYN" ]; then createchain newnotsyn no @@ -6957,8 +6964,15 @@ do_initialize() { fi [ -z "$BLACKLIST_DISPOSITION" ] && BLACKLIST_DISPOSITION=DROP - - CLAMPMSS=$(added_param_value_no CLAMPMSS $CLAMPMSS) + + case "$CLAMPMSS" in + [0-9]*) + ;; + *) + CLAMPMSS=$(added_param_value_no CLAMPMSS $CLAMPMSS) + ;; + esac + ADD_SNAT_ALIASES=$(added_param_value_no ADD_SNAT_ALIASES $ADD_SNAT_ALIASES) ROUTE_FILTER=$(added_param_value_no ROUTE_FILTER $ROUTE_FILTER) LOG_MARTIANS=$(added_param_value_no LOG_MARTIANS $LOG_MARTIANS) diff --git a/Shorewall2/releasenotes.txt b/Shorewall2/releasenotes.txt index 8bf47a1c0..f40c1ccf3 100755 --- a/Shorewall2/releasenotes.txt +++ b/Shorewall2/releasenotes.txt @@ -551,3 +551,11 @@ New Features: If you wish to globally enable martian logging, you can set MARTIAN_LOGGING=Yes in shorewall.conf. +22) You may now cause Shorewall to use the '--set-mss' option of the + TCPMSS target. In other words, you can cause Shorewall to set the + MSS field of SYN packets passing through the firewall to the value + you specify. + + Example: + + CLAMPMSS=1400 diff --git a/Shorewall2/shorewall.conf b/Shorewall2/shorewall.conf index ca0592441..72284d795 100755 --- a/Shorewall2/shorewall.conf +++ b/Shorewall2/shorewall.conf @@ -444,6 +444,14 @@ MARK_IN_FORWARD_CHAIN=No # # If left blank, or set to "No" or "no", the option is not enabled. # +# You may also set this option to a numeric value in which case Shorewall will +# set up a rule that will modify the MSS value in SYN packets to the value that +# you specify. +# +# Example: +# +# CLAMPMSS=1400 +# CLAMPMSS=No #