Discussion:
CASAR IP+MAC En Ubuntu 12.04 con Firehol..!!
Gabriel Agramonte Samper
2013-06-14 00:34:58 UTC
Permalink
Hola Listeros..!!!

Estoy configurando el Firehol en mi Server Ubuntu 12.04 ...
y quiero casar la IP+MAC pero me da el siguiente error:

he probado poner la regla delante Interfaces y abajo pero nada...

mac 192.168.0.19 00:e6:ba:80:3f:a6 #(Regla)

Alguien me puede ayudar con esto..??
Saludoss



ERROR : # 1.
WHAT : A runtime command failed to execute (returned error 2).
SOURCE : line INIT of /etc/firehol/firehol.conf
COMMAND : /sbin/iptables -t filter -A INPUT -s 192.168.0.19 -m mac
--mac-source \! 00:e6:ba:80:3f:a6 -j WRONGMAC
OUTPUT :
--
-------------------------------------------
Gabriel Agramonte Samper
"Especialista en Ciencias Informáticas"
Empresa Pecuaria Triángulo Tres
Camagüey-Cuba

Tel-Trabajo: 281767
Móvil: 0153624717
E-Mail: gabriel-0s+***@public.gmane.org

*** Utiliza GNU/Linux y serás libre...***
--
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.
Harold VIamontes
2013-06-13 14:33:01 UTC
Permalink
en iptables lo puedes hacer así
de entrada
iptables -A INPUT -i eth0 -s S.U.I.P -p tcp --destination-port XXX -m
mac --mac-source 00:e6:ba:80:3f:a6 -j ACCEPT
y el FORWARD...
iptables -A FORWARD -s S.U.I.P -m mac ! --mac-source 00:e6:ba:80:3f:a6
-p tcp -j DROP
iptables -A FORWARD -s S.U.I.P -m mac ! --mac-source 00:e6:ba:80:3f:a6
-p udp -j DROP

En el forward es recomendable q' pongas las interfaces de entrada y de
salida, ganando más control del tráfico de origen y destino, existen
formas de marcar los paquetes de entradas y luego tratarlo, pero bueno
en el firehol creo que no te será fácil hacerlo.

Salue2 Harold.

Esto que va aquí gracias a la cooperación de muchos colegas, gracias a
internet y además de horas de lectura.
Post by Gabriel Agramonte Samper
Hola Listeros..!!!
Estoy configurando el Firehol en mi Server Ubuntu 12.04 ...
he probado poner la regla delante Interfaces y abajo pero nada...
mac 192.168.0.19 00:e6:ba:80:3f:a6 #(Regla)
Alguien me puede ayudar con esto..??
Saludoss
ERROR : # 1.
WHAT : A runtime command failed to execute (returned error 2).
SOURCE : line INIT of /etc/firehol/firehol.conf
COMMAND : /sbin/iptables -t filter -A INPUT -s 192.168.0.19 -m mac
--mac-source \! 00:e6:ba:80:3f:a6 -j WRONGMAC
--
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.
Félix Pupo Pérez
2013-06-13 14:58:49 UTC
Permalink
Hola.
Puedes leer en la documentación de firehol que no es difícil marcar paquetes.
Sobre "casar" una ip con su mac, aparentemente es correcto lo que haces, pero puede que la mac no sea correcta, que es lo que dice el error. Yo lo uso sin problema alguno, antes de interfaces, ejemplo:
version 5

mac 192.168.0.1 00:20:b9:03:81:10

interface eth0 red
policy reject
client all accept

interface ppp+ internet
protection strong 10/sec 10
server ident reject with tcp-reset
client all accept
Saludos.
Documentación:
mac <IP> <MAC>
The mac helper verifies that all traffic comming in with source the IP address, comes from the MAC address. The helper applies its rules to filter/INPUT and filter/FORWARD and checks the source IP address in combination with the source MAC address.

The same MAC address is allowed to use other IPs; only the specific IP is required to be used with the specified MAC address.

Packets with the given IP address but with wrong MAC address will be DROPped and a log (as in loglimit) with label "MAC MISSMATCH" will appear in the system logs.

This helper has to be used before all interface or router statements. Of course, you can use as many mac statements as you wish.

Example: mac 195.97.5.202 00:02:8a:21:a9:d8

mark <NUMBER> <WHERE> [optional rule parameters]
The mark helper marks the traffic with a specific mark NUMBER that can be matched by traffic shapping tools for controlling the traffic.
Parameters

NUMBER is a number to mark the packets with.

WHERE tells FireHOL where to search for the specific traffic to be marked.
Currently, WHERE can be one of the build-in iptables chains attached to table mangle. (for example: INPUT, FORWARD, OUTPUT, PREROUTING, POSTROUTING - case does matter here).

optional rule parameters is a set of rules that allow further restriction of the traffic that gets matched by this rule. See Optional Rules Parameters for more information.

Example 1: mark 1 OUTPUT, will mark with 1 all packets send by the local machine.
Example 2: mark 2 FORWARD, will mark with 2 all packets passing through the local machine.
Example 3: mark 3 FORWARD proto tcp dport 25 dst 1.1.1.1 src 2.2.2.2, will match with 3 all packets sent by 2.2.2.2, passing through the local machine and targeting port TCP/25 of host 1.1.1.1.


On Thu, 13 Jun 2013 10:33:01 -0400
Post by Harold VIamontes
en iptables lo puedes hacer así
de entrada
iptables -A INPUT -i eth0 -s S.U.I.P -p tcp --destination-port XXX -m
mac --mac-source 00:e6:ba:80:3f:a6 -j ACCEPT
y el FORWARD...
iptables -A FORWARD -s S.U.I.P -m mac ! --mac-source 00:e6:ba:80:3f:a6
-p tcp -j DROP
iptables -A FORWARD -s S.U.I.P -m mac ! --mac-source 00:e6:ba:80:3f:a6
-p udp -j DROP
En el forward es recomendable q' pongas las interfaces de entrada y de
salida, ganando más control del tráfico de origen y destino, existen
formas de marcar los paquetes de entradas y luego tratarlo, pero bueno
en el firehol creo que no te será fácil hacerlo.
Salue2 Harold.
Esto que va aquí gracias a la cooperación de muchos colegas, gracias a
internet y además de horas de lectura.
Post by Gabriel Agramonte Samper
Hola Listeros..!!!
Estoy configurando el Firehol en mi Server Ubuntu 12.04 ...
he probado poner la regla delante Interfaces y abajo pero nada...
mac 192.168.0.19 00:e6:ba:80:3f:a6 #(Regla)
Alguien me puede ayudar con esto..??
Saludoss
ERROR : # 1.
WHAT : A runtime command failed to execute (returned error 2).
SOURCE : line INIT of /etc/firehol/firehol.conf
COMMAND : /sbin/iptables -t filter -A INPUT -s 192.168.0.19 -m mac
--mac-source \! 00:e6:ba:80:3f:a6 -j WRONGMAC
--
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.
______________________________________________________________________
Lista de correos del Grupo de Usuarios de Tecnologías Libres de Cuba.
https://listas.jovenclub.cu/cgi-bin/mailman/listinfo/gutl-l
--
Félix Pupo Pérez <fpp-TQ+***@public.gmane.org>

--

Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/
--
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.
Loading...