U32 Port Masks – Calculator

Like quite a few other linux/networking nutters out there, I run traffic shaping scripts on my server to optimise traffic, and stop things like torrents from knocking the hell out of browsing, or gaming, and so on.

The script I use is based on the Wonder Shaper Script - http://lartc.org/wondershaper/

It’s a good script, but if you want to prioritise a ‘port range’ rather than just an individual port it gets tricker since you need to calculate u32 matches.  For the most part calculating that manually is well over my head.  But, this guy wrote a script for it. It’s a great utility, and I’d hate to see it disappear if he ever deletes his blog, so I’ve copied the code to here aswell. Full credit goes to M. Trojahn - http://marcelustrojahn.blogspot.com/

Tips for usage – try slightly larger ranges and work your way backwards. I needed one for Steam Port Ranges, and since I’m not fussed about going over by a half dozen or so ports, ended up going to 27055, rather than just 27050. Saves using several extra ‘smaller’ ranges. Enjoy. :)


Insert the port range and wait for the magic:
   

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>