# cat > banda.sh
#!/bin/bash
# Limite de 1Mbps download e upload para o IP 192.168.1.103
#---[ Download ]---
iptables -t mangle -F
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1:0 htb default 40
tc class add dev eth0 parent 1:0 classid 1:1 htb rate 1mbit
iptables -t mangle -A FORWARD -o eth0 -d 192.168.1.103 -j CLASSIFY --set-class 1:1
#---[ Upload ]---
tc qdisc del dev ppp0 root
tc qdisc add dev ppp0 root handle 1:0 htb default 40
tc class add dev ppp0 parent 1:0 classid 1:2 htb rate 1mbit
iptables -t mangle -A FORWARD -o ppp0 -s 192.168.1.103 -j CLASSIFY --set-class 1:2
ctrl + d ( para salvar e fechar arquivo )
------------------------------------------------------------------------------------------------------------------------
===[ Sharing Knowledge ]=== - Obrigado - Thank you - Danke - Merci - Grazie - Gracias - arigatou gozaimasu
“We make a living by what we get, but we make a life by what we give.” - Give and you will receive - just share :)
------------------------------------------------------------------------------------------------------------------------
“We make a living by what we get, but we make a life by what we give.” - Give and you will receive - just share :)
------------------------------------------------------------------------------------------------------------------------
Bom dia, esse script serve no caso de ter o servidor com a conexao pppoe com a operadora tendo essa interface "ppp0" com o ip externo recebido?
ResponderExcluir