Bandwidth can be limited on Mac OS X machines using ipfw commands.
This bandwidth traffic can be controlled on all the process and ports
and also on specific ports. Traffic can also be controlled from source
and destinations hosts.
Below are the commands used in terminal for limiting bandwidth
To limit the bandwidth for all the traffic, use:
sudo ipfw pipe 1 config bw 400kbit/s (change 400 to what ever speed you desire)
sudo ipfw add pipe 1 dst-ip 0.0.0.0/0
To liming bandwidth for specific ports, use:
sudo ipfw pipe 1 config bw 440kbit/s
sudo ipfw add pipe 1 dst-port
Examples:
sudo ipfw pipe 1 config bw 400kbit/s
sudo ipfw add pipe 1 dst-port http
sudo ipfw add pipe 1 dst-port 80
sudo ipfw add pipe 1 dst-port https
To limit for source and destination IP:
sudo ipfw add pipe 1 src-ip
sudo ipfw add pipe 1 dst-ip
Examples:
sudo ipfw add pipe 1 src-ip 192.168.1.0/24
sudo ipfw add pipe 1 dst-ip 192.168.1.0/24
You can also limit bandwidth for source and destination IP that is not yours:
Examples:
sudo ipfw add pipe 1 not src-ip 192.168.1.0/24
sudo ipfw add pipe 1 not dst-ip 192.168.1.0/24
To Flush all the rules:
sudo ipfw flush
Below are the commands used in terminal for limiting bandwidth
To limit the bandwidth for all the traffic, use:
sudo ipfw pipe 1 config bw 400kbit/s (change 400 to what ever speed you desire)
sudo ipfw add pipe 1 dst-ip 0.0.0.0/0
To liming bandwidth for specific ports, use:
sudo ipfw pipe 1 config bw 440kbit/s
sudo ipfw add pipe 1 dst-port
Examples:
sudo ipfw pipe 1 config bw 400kbit/s
sudo ipfw add pipe 1 dst-port http
sudo ipfw add pipe 1 dst-port 80
sudo ipfw add pipe 1 dst-port https
To limit for source and destination IP:
sudo ipfw add pipe 1 src-ip
sudo ipfw add pipe 1 dst-ip
Examples:
sudo ipfw add pipe 1 src-ip 192.168.1.0/24
sudo ipfw add pipe 1 dst-ip 192.168.1.0/24
You can also limit bandwidth for source and destination IP that is not yours:
Examples:
sudo ipfw add pipe 1 not src-ip 192.168.1.0/24
sudo ipfw add pipe 1 not dst-ip 192.168.1.0/24
To Flush all the rules:
sudo ipfw flush
No comments:
Post a Comment