Re: [suse-linux-s] Comando ARP
El Martes, 30 de Agosto de 2005 00:29, cartman escribió:
Lo que necesito hacer es bloquear el FORWARDING para una máquina:
IP=`ping -b 192.168.0.63 | arp | grep 00:0B:6A:6F:99:7A | awk '{print $1}'` iptables -A FORWARD -d $IP -j DROP iptables -A FORWARD -s $IP -j DROP
El caso es que la ip puede variar, entonces lo que hago es conocer la ip actual de la máquina por medio de su dirección mac.
Tengo este script corriendo por medio de un cron, pero la cache arp tarda en actualizarse y por lo tanto el bloqueo es intermitente.
Necesito conocer el intervalo con que se actualiza esta cache, me habian dicho que se actualizaba al realizar un ping al broadcast pero no funciona.
* La jugada deberia ser diferente, en la maquina a bloquear debe haber un cron que testee su ip, y envie un gratuitus arp al servidor con su nueva ip, esto refrescara la ip en la cache del servidor. * Prueba el ping al broadcast con la opcion -f * Yo esto lo veo complicarse la vida * No bloqueo por mac por que las mac pueden cambiarse no obstante el modulo ipt_mac esta disponible. * ejemplo iptables -A INPUT --mac-source (direccion mac) -j DROP iptables -A FORWARD --mac-source (direccion mac) -j DROP
participants (1)
-
jose maria