Installing MasterShaper 0.44

=Install MasterShaper Package=

In a terminal:

su apt-get update apt-get install php-net-ipv4 php-db php5-gd

Download the MasterShaper tarball:

mkdir /usr/src/mastershaper cd /usr/src/mastershaper wget http://www.mastershaper.org/files/mastershaper_0.44.tar.bz2 bunzip2 mastershaper_0.44.tar.bz2 tar -xvf mastershaper_0.44.tar mv MasterShaper-0.44/htdocs /var/www/mastershaper

=Configure phpmyadmin=


 * 1) Browse to http://192.168.100.1/phpmyadmin
 * 2) user username: root, password:
 * 3) click privileges
 * 4) click add a new user
 * 5) create a new user named mastershaper
 * 6) set host to local, localhost will automatically be populated in the field
 * 7) click generate, then click copy to randomly generate a password and copy it to the password fields
 * 8) either copy the password to a clipboard or write it down, you will need it later
 * 9) choose Create database with same name and grant all privileges
 * 10) click Go

=Install jpgraph and phplayersmenu=

cd /var/www/mastershaper wget http://downloads.sourceforge.net/project/phplayersmenu/phplayersmenu-devel/3.2.0-rc/phplayersmenu-3.2.0-rc.tar.gz gunzip phplayersmenu-3.2.0-rc.tar.gz tar -xvf phplayersmenu-3.2.0-rc.tar ln -s /var/www/mastershaper/phplayersmenu-3.2.0 /var/www/mastershaper/phplayersmenu mkdir jpgraph cd jpgraph wget http://hem.bredband.net/jpgraph2/jpgraph-3.0.7.tar.bz2 bunzip2 jpgraph-3.0.7.tar.bz2 tar -xvf jpgraph-3.0.7.tar chown -R www-data:www-data /var/www/mastershaper

=Edit the sudoers file=

Use visudo to edit the sudoers file

sudo visudo

anywhere in the file, add the line:

www-data	ALL= NOPASSWD: /var/www/mastershaper/shaper_loader.sh


 * Use the 'j' key to move to the end of the file
 * Press 'o' to insert a new line at the end
 * Copy and paste in the above line. To manually type the line, press 'o' to insert a line and begin typing.
 * Press to exit edit mode
 * Type ':wq' to save and exit

=Configure MasterShaper in Webmin=


 * 1) browse to http://192.186.100.1/mastershaper
 * 2) change MySQL Database to mastershaper
 * 3) change MySQL User to mastershaper
 * 4) change MsSQL Pass to the password created in phpmyadmin
 * 5) uncheck port numbers and protocol number if administered over a slow connection as loading can take some time
 * 6) click Next
 * 7) click Next
 * 8) Once complete, the installer should change permissions on itself to avoid people being able to run it, click Switch to MasterShaper Web Interface.

=Install the init script= This makes sure rules are loaded on every startup.

cd /usr/src/mastershaper/MasterShaper-0.44/tools nano mastershaper.init

Set PATH_TO_MS variable location to /var/www/mastershaper save (cntrl + o) and exit (cntrl + x)

cp mastershaper.init /etc/init.d/mastershaper update-rc.d mastershaper defaults

This adds to the default runlevels to load rules and start the collector script at boot

=Install the Webmin Module=

From a command line
cd /usr/share/webmin wget http://www.inveneo.org/download/invmastershaper.tar.bz2 bunzip2 invmastershaper.tar.bz2 tar -xvf invmastershaper.tar

From a browser

 * 1) Log in to webmin as the root user (not inveneo user)
 * 2) Click webmin -> webmin users -> inveneo
 * 3) Check Inveneo MasterShaper Configuration
 * 4) Click Save
 * 5) log out as root and log in as inveneo
 * 6) browse to the MasterShaper module - Servers > Inveneo Mastershaper Configuration > MasterShaper Configuratin
 * 7) Settings > Users > Create a new users
 * 8) Enter information about the user. Enter the user information before enabling authentication.
 * 9) *Name: inveneo
 * 10) *Password: [same password used to log into webmin as inveneo]
 * 11) *Status: Enabled
 * 12) *Global Permissions: Check ALL boxes
 * 13) Click Save
 * 14) Settings > Options
 * 15) Under Bandwidth > Inbound and Outbound Bandwidth
 * 16) *Enter the maximum speed of the bandwidth allowed by the Ethernet hardware
 * 17) *102400 for 10/100 Ethernet card
 * 18) *1024000 for 10/100/1000 (Gigabit) Ethernet card
 * 19) Under Interfaces
 * 20) *Incoming Interface: [the WAN port, likely eth0 but you will need to verify]
 * 21) *Outgoing Interface: [the LAN port, likely eth1 but you will need to verify]
 * 22) Scroll down to the very bottom of the page to Authentication. Click Yes > Save

=NAT=

Disable NAT on IHL
Important Note: For MasterShaper to shape inbound and outbound traffic properly, the machine running MasterShaper cannot be performing NAT for the clients it is attempting to shape. If performing NAT, download traffic will be properly shaped but upload traffic will not be. To disable NAT:

nano /opt/inveneo/sbin/wan-firewall.sh.

Comment out the two following lines by putting a # in front of them, the lines are not text to each other in the file:

iptables -t nat -A POSTROUTING -o $IFACE -j MASQUERADE iptables -t nat -D POSTROUTING -o $IFACE -j MASQUERADE

save (cntrl + o) and exit (cntrl + x)

NAT on Another Device
Another device between the MasterShaper box and the internet must perform NAT and must know the static route to the clients behind MasterShaper. This other device can be another linux box, something like DD-WRT on a router, or even a windows machine.

Installing NAT on XP Professional

Sample Network Diagram


Return to MasterShaper main page