pac_rs_124 escreveu:Está ativando a opção:
Ativar Qtd. máxima de conexão: [ 20 ] Qtd. de conexões por usuário ??
Isso não era pra bloquear o número máximo de conexões da REDE?
reytek escreveu:Bom eu uso a verçao 2.31.10 sem subrede e o bloqueio funciona, só testei por enquanto no ares e bloqueou legal, vou testar outros assimque puder e posto aqui os resultados.
# limite de conexões por cliente
iptables -t mangle -F CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 1:79 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 81:1862 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 1864:65535 -j CONNLIMIT
iptables -t mangle -X CONNLIMIT
iptables -t mangle -N CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 1:79 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 81:1862 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 1864:65535 -j CONNLIMIT
iptables -t mangle -A CONNLIMIT -p TCP -m state ! --state RELATED -m connlimit --connlimit-above 20 --connlimit-mask 32 -j DROP
Configuring firewall rules...
Configuring custom firewall rules...
iptables: No chain/target/match by that name
iptables: Too many links
iptables: Chain already exists
Configuring port forwarding for internal hosts...
Running Line UP Scripts...
:
Current IP : 201.13.68.114
www.no-ip.com : Old IP : 201.13.68.114
www.no-ip.com : The Update of xxxxxxxx.no-ip.com is not needed
Setting clock using timeserver br.pool.ntp.org: Success.
Set the bios clock using timeserver
BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=213.22.244.110 DST=201.13.68.114 LEN=144 TOS=0x00 PREC=0x00 TTL=110 ID=12360 DF PROTO=TCP SPT=23547 DPT=4161 WINDOW=16097 RES=0x00 ACK PSH URGP=0
Jan 3 22:56:03 BFW user.warn kernel: BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=89.142.23.117 DST=201.13.68.114 LEN=162 TOS=0x00 PREC=0x00 TTL=111 ID=30451 PROTO=TCP SPT=39354 DPT=4302 WINDOW=17321 RES=0x00 ACK PSH URGP=0
Jan 3 22:56:04 BFW user.warn kernel: BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=69.112.192.53 DST=201.13.68.114 LEN=1492 TOS=0x00 PREC=0x00 TTL=115 ID=20832 DF PROTO=TCP SPT=6218 DPT=1887 WINDOW=64799 RES=0x00 ACK PSH URGP=0
Jan 3 22:56:06 BFW user.warn kernel: BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=123.231.84.221 DST=201.13.68.114 LEN=40 TOS=0x00 PREC=0x00 TTL=113 ID=7371 DF PROTO=TCP SPT=21475 DPT=4443 WINDOW=64800 RES=0x00 ACK FIN URGP=0
Jan 3 22:56:06 BFW user.warn kernel: BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=82.3.163.44 DST=201.13.68.114 LEN=45 TOS=0x00 PREC=0x00 TTL=112 ID=36341 DF PROTO=TCP SPT=8420 DPT=4446 WINDOW=64327 RES=0x00 ACK PSH URGP=0
Jan 3 22:56:06 BFW user.warn kernel: BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=74.140.132.204 DST=201.13.68.114 LEN=40 TOS=0x00 PREC=0x00 TTL=235 ID=7838 PROTO=TCP SPT=11744 DPT=3944 WINDOW=0 RES=0x00 RST URGP=0
Jan 3 22:56:08 BFW user.warn kernel: BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=209.105.222.189 DST=201.13.68.114 LEN=48 TOS=0x00 PREC=0x00 TTL=106 ID=24816 DF PROTO=TCP SPT=58438 DPT=6881 WINDOW=8192 RES=0x00 SYN URGP=0
Jan 3 22:56:08 BFW user.warn kernel: BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=67.170.137.137 DST=201.13.68.114 LEN=48 TOS=0x00 PREC=0x00 TTL=111 ID=47660 DF PROTO=TCP SPT=2007 DPT=32875 WINDOW=65535 RES=0x00 SYN URGP=0
Jan 3 22:56:09 BFW user.warn kernel: BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=70.145.105.18 DST=201.13.68.114 LEN=158 TOS=0x00 PREC=0x00 TTL=108 ID=30367 PROTO=TCP SPT=51459 DPT=4220 WINDOW=63980 RES=0x00 ACK PSH URGP=0
Jan 3 22:56:09 BFW user.warn kernel: BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=142.162.9.209 DST=201.13.68.114 LEN=83 TOS=0x00 PREC=0x00 TTL=109 ID=42107 DF PROTO=TCP SPT=49898 DPT=4166 WINDOW=64135 RES=0x00 ACK PSH URGP=0
Jan 3 22:56:11 BFW user.warn kernel: BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=189.108.119.117 DST=201.13.68.114 LEN=48 TOS=0x00 PREC=0x00 TTL=117 ID=58327 DF PROTO=TCP SPT=41679 DPT=6881 WINDOW=65535 RES=0x00 SYN URGP=0
Jan 3 22:56:11 BFW user.warn kernel: BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=124.169.37.139 DST=201.13.68.114 LEN=133 TOS=0x00 PREC=0x00 TTL=112 ID=13314 DF PROTO=TCP SPT=37297 DPT=4399 WINDOW=65436 RES=0x00 ACK PSH URGP=0
Jan 3 22:56:11 BFW user.warn kernel: BLOCKED CONNECTION:IN=ppp0 OUT= MAC= SRC=209.105.222.189 DST=201.13.68.114 LEN=48 TOS=0x00 PREC=0x00 TTL=106 ID=24913 DF PROTO=TCP SPT=58438 DPT=6881 WINDOW=8192 RES=0x00 SYN URGP=0
iptables -t mangle -F CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto ares -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto bittorrent -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto directconnect -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto edonkey -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto fasttrack -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 1024:1862 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 1864:5189 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 5191:8079 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 8081:8179 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 8181:65535 -j CONNLIMIT
iptables -t mangle -X CONNLIMIT
iptables -t mangle -N CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto ares -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto bittorrent -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto directconnect -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto edonkey -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto fasttrack -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 1024:1862 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 1864:5189 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 5191:8079 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 8081:8179 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 8181:65535 -j CONNLIMIT
iptables -t mangle -A CONNLIMIT -p TCP -m state ! --state RELATED -m connlimit --connlimit-above 12 --connlimit-mask 32 -j DROP
rhine-pr escreveu:Grande Ice Man,
Eu coloquei as regras aqui e parece q funcionou, eu uso assim:
iptables -t mangle -F CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto ares -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto bittorrent -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto directconnect -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto edonkey -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto fasttrack -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 1024:1862 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 1864:5189 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 5191:8079 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 8081:8179 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 8181:65535 -j CONNLIMIT
iptables -t mangle -X CONNLIMIT
iptables -t mangle -N CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto ares -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto bittorrent -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto directconnect -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto edonkey -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto fasttrack -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 1024:1862 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 1864:5189 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 5191:8079 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 8081:8179 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 8181:65535 -j CONNLIMIT
iptables -t mangle -A CONNLIMIT -p TCP -m state ! --state RELATED -m connlimit --connlimit-above 12 --connlimit-mask 32 -j DROP
Configuring firewall rules...
Configuring custom firewall rules...
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name
iptables v1.3.4-20060123: Couldn't find target `CONNLIMIT'
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.3.4-20060123: Couldn't find target `CONNLIMIT'
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.3.4-20060123: Couldn't find target `CONNLIMIT'
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.3.4-20060123: Couldn't find target `CONNLIMIT'
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.3.4-20060123: Couldn't find target `CONNLIMIT'
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.3.4-20060123: Couldn't find target `CONNLIMIT'
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.3.4-20060123: Couldn't find target `CONNLIMIT'
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.3.4-20060123: Couldn't find target `CONNLIMIT'
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.3.4-20060123: Couldn't find target `CONNLIMIT'
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.3.4-20060123: Couldn't find target `CONNLIMIT'
Try `iptables -h' or 'iptables --help' for more information.
iptables: No chain/target/match by that name
Configuring port forwarding for internal hosts...
Running Line UP Scripts...
Editar Regras Personalizadas
rhine-pr escreveu:Andre,
O caso nao e bem esse, o con limit funciona com mascara 32 em todos os ips, se usar mascara 24 ele vai criar o limite pra rede /24 , o conlimit funga, o problemas e o controle de conexoes quem vem por D FULL no bfw quando voce criar a subrede, ele nao ta controlando o numero de conexao por subrede como deveria, voltar a usar o conlimit foi uma opcao ate corrigir o arquivo rc.qos.subnet ou seja la qual for ...
luapufo escreveu:rhine-pr escreveu:Andre,
O caso nao e bem esse, o con limit funciona com mascara 32 em todos os ips, se usar mascara 24 ele vai criar o limite pra rede /24 , o conlimit funga, o problemas e o controle de conexoes quem vem por D FULL no bfw quando voce criar a subrede, ele nao ta controlando o numero de conexao por subrede como deveria, voltar a usar o conlimit foi uma opcao ate corrigir o arquivo rc.qos.subnet ou seja la qual for ...
voce usa as alterações do marcos, aquela para usar " IMQ "
Marcos do Vale escreveu:Srs,
A alteração que houve em relação ao connlimit da versão 2.30.x para a 2.31.x foi a transferência das regras da tabela mangle para a tabela nat.
rhine-pr escreveu:Andre,
O caso nao e bem esse, o con limit funciona com mascara 32 em todos os ips, se usar mascara 24 ele vai criar o limite pra rede /24 , o conlimit funga, o problemas e o controle de conexoes quem vem por D FULL no bfw quando voce criar a subrede, ele nao ta controlando o numero de conexao por subrede como deveria, voltar a usar o conlimit foi uma opcao ate corrigir o arquivo rc.qos.subnet ou seja la qual for ...
jm_athayde escreveu:rhine-pr escreveu:Andre,
O caso nao e bem esse, o con limit funciona com mascara 32 em todos os ips, se usar mascara 24 ele vai criar o limite pra rede /24 , o conlimit funga, o problemas e o controle de conexoes quem vem por D FULL no bfw quando voce criar a subrede, ele nao ta controlando o numero de conexao por subrede como deveria, voltar a usar o conlimit foi uma opcao ate corrigir o arquivo rc.qos.subnet ou seja la qual for ...
ok masi uma coisa vc tem que ter em mente vc nao vai colocar mais de uma pessoa para cada sub-rede criada entao a regra iptables -t mangle -A CONNLIMIT -p TCP -m state ! --state RELATED -m connlimit --connlimit-above 12 --connlimit-mask 24 -j DROP pode util ate solucionar o problema.
jm_athayde escreveu:ok , compriendi o que foi falado , mais entao nao adianta colocar este tipo de regra no fire pois nao serve para nada , correto ? andei notando mesmo em minha rede que esta lenta demais, e nao intendia o que poderia estar acontecendo , deve ser o pessoal usando muito p2p e eu nao estava vendo pois estva seguro que esta regra estava dando conta de tudo .Bom vou esperar vcs que entendem mais deste sistema para ver se tem solução.
jm_athayde escreveu:ok , compriendi o que foi falado , mais entao nao adianta colocar este tipo de regra no fire pois nao serve para nada , correto ? andei notando mesmo em minha rede que esta lenta demais, e nao intendia o que poderia estar acontecendo , deve ser o pessoal usando muito p2p e eu nao estava vendo pois estva seguro que esta regra estava dando conta de tudo .Bom vou esperar vcs que entendem mais deste sistema para ver se tem solução.
jm_athayde escreveu:OK , masi que estou com problemas ainda estou , vou tentar resolver aqui mesmo , estudando. boa noite a todos.
# limite de conexões por cliente
iptables -t mangle -F CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto ares -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto bittorrent -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto directconnect -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto edonkey -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto fasttrack -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 1024:1862 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 1864:5189 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 5191:7999 -j CONNLIMIT
#iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 8081:8179 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 8189:65535 -j CONNLIMIT
iptables -t mangle -X CONNLIMIT
iptables -t mangle -N CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto ares -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto bittorrent -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto directconnect -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto edonkey -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto fasttrack -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 1024:1862 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 1864:5189 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 5191:7999 -j CONNLIMIT
#iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 8081:8179 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 8189:65535 -j CONNLIMIT
iptables -t mangle -A CONNLIMIT -p TCP -m state ! --state RELATED -m connlimit --connlimit-above 30 --connlimit-mask 32 -j DROP
-m connlimit --connlimit-above $CONLIMIT --connlimit-mask 32 -j DROP; }
-m connlimit --connlimit-above 300 --connlimit-mask 32 -j DROP; }
andrefellows escreveu:Mas 300 por subrede nao é demais nao?
Se uma pessoa so está na subrede, vai ter as 300 conexoes livres.
Na regra com mascara 32 vai freiar qualquer ip...
weslei escreveu:jm_athayde escreveu:OK , masi que estou com problemas ainda estou , vou tentar resolver aqui mesmo , estudando. boa noite a todos.
Mesmo a solução estando na cara, todos ficam a espera de um milagre!!!
- Código: Selecionar todos
# limite de conexões por cliente
iptables -t mangle -F CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto ares -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto bittorrent -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto directconnect -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto edonkey -j CONNLIMIT
iptables -t mangle -D POSTROUTING -m layer7 --l7proto fasttrack -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 1024:1862 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 1864:5189 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 5191:7999 -j CONNLIMIT
#iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 8081:8179 -j CONNLIMIT
iptables -t mangle -D POSTROUTING -p TCP -d 0/0 --dport 8189:65535 -j CONNLIMIT
iptables -t mangle -X CONNLIMIT
iptables -t mangle -N CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto ares -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto bittorrent -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto directconnect -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto edonkey -j CONNLIMIT
iptables -t mangle -A POSTROUTING -m layer7 --l7proto fasttrack -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 1024:1862 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 1864:5189 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 5191:7999 -j CONNLIMIT
#iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 8081:8179 -j CONNLIMIT
iptables -t mangle -A POSTROUTING -p TCP -d 0/0 --dport 8189:65535 -j CONNLIMIT
iptables -t mangle -A CONNLIMIT -p TCP -m state ! --state RELATED -m connlimit --connlimit-above 30 --connlimit-mask 32 -j DROP
coloca no Script inicial do BFW..
No meu eu alterei a seguinte linha do rc.subnet
- Código: Selecionar todos
-m connlimit --connlimit-above $CONLIMIT --connlimit-mask 32 -j DROP; }
Para
- Código: Selecionar todos
-m connlimit --connlimit-above 300 --connlimit-mask 32 -j DROP; }
Assim o connlimit da subredes vai liberar 300 conexões por subrede, e chega o connlimit do rc.script e faz o papel de Lobo Mau e segura todo mundo, nas portas altas excluindo 80 entre outras muito uteis que já foram citadas aqui...
Agora é só comer o bolo com cafezinho.. rsrsrs
Abraço
Voltar para BrazilFW 2.x - Ajuda em Geral (Todas as Línguas)
Usuários navegando neste fórum: Nenhum usuário registrado e 12 visitantes