PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : MAC-Filter



AssetBurned
13.03.02, 12:45
moin

im moment habe ich die simpele IPTABLES regel:
iptables -t nat -A POSTROUTING -j MASQUERADE (alles andere als geschickt, ich weiß ;-))

nun möchte ich diese regel so abändern das sie nur für gewisse rechner im lan zutrifft, allerdings möchte ich nicht per IP filtern, sondern per MAC!

wie kann ich das anstellen?
ich hab gesehen das es eine funktion gibt "--source-mac 00:2c:de:ad:be:ef" nur wenn ich die einfach dahinter hänge läuft die rule nicht.

axo sonstige verbesserungen dieser möchtegern firewall werden auch gerne gesehen :-)

CU AssetBurned

Buck Rogers
13.03.02, 16:09
Die Syntax lautet:


Auszug aus: man iptables:

------------ Schnipp ----------------
MATCH EXTENSIONS
iptables can use extended packet matching modules. These
are loaded in two ways: implicitly, when -p or --protocol
is specified, or with the -m or --match options, followed
by the matching module name; after these, various extra
command line options become available, depending on the
specific module. You can specify multiple extended match
modules in one line, and you can use the -h or --help
options after the module has been specified to receive
help specific to that module.

The following are included in the base package, and most
of these can be preceded by a ! to invert the sense of
the match.

tcp
These extensions are loaded if `--protocol tcp' is speci*
fied. It provides the following options:
.............
blablasblabla
.............
mac
--mac-source [!] address
Match source MAC address. It must be of the form
XX:XX:XX:XX:XX:XX. Note that this only makes sense
for packets entering the PREROUTING, FORWARD or
INPUT chains for packets coming from an ethernet
device.

....
------------Schnapp------------

Versuche es mal mit:
iptables -t nat -A PREROUTING --match mac --mac-source 00:A0:C9:29:59:87 -j ACCEPT