RES: [FUG-BR] Re: IPFW + MAC

Sérgio José Ferreira sergio em wgo.com.br
Sex Fev 11 21:00:02 BRST 2005


tenta algo assim :


# primeiro, permitir layer2 em lo0 e nas interfaces externas
ipfw add 10 permit ip from any to any layer2 via lo0
ipfw add 20 permit ip from any to any layer2 via ${Ext_Interface}
#
# Se nao for layer2, saltar para depois das regras de controle de MAC
ipfw add 30 skipto 5000 ip from any to any not layer2

# depois, permitir layer2 saindo pela interface interna
ipfw add 30 permit ip from any to any layer2 out via vr0

# agora, permitir layer2 de cada cliente junto com o ip
ipfw add 250 allow all from 192.168.11.9 to any MAC any 00:80:C8:B7:2F:F4 layer2 in via vr0
#
# se for bridge, ou o cliente tiver dois ips, macs
ipfw add 260 allow all from { 192.168.11.26 or 192.168.11.25 } to any MAC any 00:0D:88:96:16:0B layer2 in via vr0
ipfw add 261 allow all from { 192.168.11.26 or 192.168.11.25 } to any MAC any 00:E0:7D:DB:D7:C4 layer2 in via vr0
...
...
## se chegar até aqui, bloquear
ipfw add 4999 drop all from any to any layer2

## controle de banda começa na 5000 ( olhe regra 30 skipto 5000.... )
# exemplo :
ipfw add 5000 pipe 5000 ip from 192.168.11.9 to any in via vr0
ipfw add 5010 pipe 5000 ip from any to 192.168.11.9 out via vr0
ipfw pipe 5000 config bw 500Kbit/s 
...
....

[]'s

Sérgio José Ferreira
WGO Internet

-----Mensagem original-----
De: Freebsd-bounces em fug.com.br [mailto:Freebsd-bounces em fug.com.br]Em
nome de bruno
Enviada em: sexta-feira, 11 de fevereiro de 2005 09:36
Para: freebsd em fug.com.br
Assunto: [FUG-BR] Re: IPFW + MAC


Prezados, 

Para que server o layer2 no ipfw2 e o mac-type arp ??? 

Posso fazer uma regra como esta abaixo ??? 

ipfw add pipe 1 all from any to any in mac BO:BO:BO:BO:BO layer2 in
ipfw add pipe 2 all from any to any out mac any BO:BO:BO:BO:BO layer2 out
ipfw pipe 1 config bw 128Kbit/s queue 11Kbytes
ipfw pipe 2 config bw 128Kbit/s queue 11Kbytes
ipfw add allow all from any to any in mac BO:BO:BO:BO:BO any mac-type arp
ipfw add allow all from any to any out mac any BO:BO:BO:BO:BO mac-type arp 

Obrigado,
Bruno Motta 




-------------- Próxima Parte ----------
_______________________________________________________________
Para enviar um novo email para a lista: freebsd em fug.com.br
Sair da Lista: http://mail.fug.com.br/mailman/listinfo/freebsd_fug.com.br
Historico: http://www4.fugspbr.org/lista/html/FUG-BR/


Mais detalhes sobre a lista de discussão freebsd