<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: Iptables mac address filtering</title>
	<atom:link href="http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html</link>
	<description>This is a Linux sys admin journal by Vivek about sys admin work, Linux tips &#38; tricks, hacks, news and more.</description>
	<lastBuildDate>Sun, 14 Mar 2010 15:07:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Zohaib Hussain</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-153844</link>
		<dc:creator>Zohaib Hussain</dc:creator>
		<pubDate>Mon, 22 Feb 2010 06:22:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-153844</guid>
		<description>Dear All,

please help me i have different prb facing i m running LAN network with LInux i m facing the prb of mac spoofing but some of users whom i blocked by my server they user mac address changer different softwares and by this software they detect any Online Active user mac address and just change the IP Address and use internet and when i try to block that mac address by iptables but i cant block that mac address because its mine online active users mac and who users blocked the connection of my LAN they do these things and use mac address changing software and get solid and valid legal mac address by network scanning. .... what i do i m much confused</description>
		<content:encoded><![CDATA[<p>Dear All,</p>
<p>please help me i have different prb facing i m running LAN network with LInux i m facing the prb of mac spoofing but some of users whom i blocked by my server they user mac address changer different softwares and by this software they detect any Online Active user mac address and just change the IP Address and use internet and when i try to block that mac address by iptables but i cant block that mac address because its mine online active users mac and who users blocked the connection of my LAN they do these things and use mac address changing software and get solid and valid legal mac address by network scanning. &#8230;. what i do i m much confused</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atheya</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-151417</link>
		<dc:creator>Atheya</dc:creator>
		<pubDate>Mon, 02 Nov 2009 00:50:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-151417</guid>
		<description>How do I execute this Perl script?</description>
		<content:encoded><![CDATA[<p>How do I execute this Perl script?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vivek Gite</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-148014</link>
		<dc:creator>Vivek Gite</dc:creator>
		<pubDate>Mon, 06 Apr 2009 14:19:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-148014</guid>
		<description>Thanks for sharing perl script.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing perl script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lillholm</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-148009</link>
		<dc:creator>Lillholm</dc:creator>
		<pubDate>Mon, 06 Apr 2009 12:30:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-148009</guid>
		<description>Coop&gt;
Here is a script i use to write my iptables.
&lt;pre&gt;#!/usr/bin/perl

use DBI;

$sql_user			= &quot;dhcpd&quot;;
$sql_password			= &quot;*******&quot;;
$sql_database			= &quot;dhcpd&quot;;
$sql_hostname			= &quot;localhost&quot;;
$sql_port			= &quot;3306&quot;;


$dsn		= &quot;DBI:mysql:database=$sql_database;host=$sql_hostname;port=$sql_port&quot;;
print &quot;-----------------------------------------------\n&quot;;
print &quot;      Building iptables config from mysql      \n&quot;;
print &quot;-----------------------------------------------\n&quot;;
print &quot;Getting information from  mysql database...&quot;;
$dbh = DBI-&gt;connect($dsn, $sql_user, $sql_password);
$getmac = $dbh-&gt;prepare(&quot;select mac from trusted order by ip&quot;);
$getip = $dbh-&gt;prepare(&quot;select ip from trusted order by ip&quot;);
$getmac-&gt;execute;
$getip-&gt;execute;

print &quot;Done\n&quot;;
print &quot;Creating temp file...&quot;;
#print `rm iptables.conf.temp`;
open (CONFIGFILE, &#039;&gt;&gt;iptables.conf.temp&#039;);
print &quot;Done\n&quot;;
print &quot;Start writing configfile...\n-----------------------------------------------\n&quot;;

$count 		= 0;

while ( @getmac = $getmac-&gt;fetchrow_array, @getip = $getip-&gt;fetchrow_array ) {
    @mac[$count] = @getmac;
    @ip[$count] = @getip;
    $count++;
}

$dbh-&gt;disconnect;
$count = 0;

foreach (@mac) {
	print CONFIGFILE &quot;iptables -A INPUT -p tcp -s @ip[$count] -m mac --mac-source @mac[$count] -j ACCEPT
&quot; . 			 &quot;&quot;;
	$count++;
    
	print &quot;iptables -A INPUT -p tcp -s @ip[$count] -m mac --mac-source @mac[$count] -j ACCEPT&quot; . &quot;\n&quot;;
}


close (CONFIGFILE);
print &quot;-----------------------------------------------\nDone.\n&quot;;
print `mv iptables.conf.temp iptables.conf`;
sleep(1);
#print `echo &quot;do somthing here :)&quot;`&lt;/pre&gt;

I also made one for dhcpd so unknown mac&#039;s logging on my wireless will be in a diffrent subnet.</description>
		<content:encoded><![CDATA[<p>Coop&gt;<br />
Here is a script i use to write my iptables.</p>
<pre>#!/usr/bin/perl

use DBI;

$sql_user			= "dhcpd";
$sql_password			= "*******";
$sql_database			= "dhcpd";
$sql_hostname			= "localhost";
$sql_port			= "3306";

$dsn		= "DBI:mysql:database=$sql_database;host=$sql_hostname;port=$sql_port";
print "-----------------------------------------------\n";
print "      Building iptables config from mysql      \n";
print "-----------------------------------------------\n";
print "Getting information from  mysql database...";
$dbh = DBI-&gt;connect($dsn, $sql_user, $sql_password);
$getmac = $dbh-&gt;prepare("select mac from trusted order by ip");
$getip = $dbh-&gt;prepare("select ip from trusted order by ip");
$getmac-&gt;execute;
$getip-&gt;execute;

print "Done\n";
print "Creating temp file...";
#print `rm iptables.conf.temp`;
open (CONFIGFILE, '&gt;&gt;iptables.conf.temp');
print "Done\n";
print "Start writing configfile...\n-----------------------------------------------\n";

$count 		= 0;

while ( @getmac = $getmac-&gt;fetchrow_array, @getip = $getip-&gt;fetchrow_array ) {
    @mac[$count] = @getmac;
    @ip[$count] = @getip;
    $count++;
}

$dbh-&gt;disconnect;
$count = 0;

foreach (@mac) {
	print CONFIGFILE "iptables -A INPUT -p tcp -s @ip[$count] -m mac --mac-source @mac[$count] -j ACCEPT
" . 			 "";
	$count++;

	print "iptables -A INPUT -p tcp -s @ip[$count] -m mac --mac-source @mac[$count] -j ACCEPT" . "\n";
}

close (CONFIGFILE);
print "-----------------------------------------------\nDone.\n";
print `mv iptables.conf.temp iptables.conf`;
sleep(1);
#print `echo "do somthing here :)"`</pre>
<p>I also made one for dhcpd so unknown mac&#8217;s logging on my wireless will be in a diffrent subnet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vivek Gite</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-147865</link>
		<dc:creator>Vivek Gite</dc:creator>
		<pubDate>Thu, 26 Mar 2009 16:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-147865</guid>
		<description>I don&#039;t think so.. you need to take help of perl or python and send those IPs using system or exec or `` call to iptables.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think so.. you need to take help of perl or python and send those IPs using system or exec or &#8220; call to iptables.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coop</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-147860</link>
		<dc:creator>coop</dc:creator>
		<pubDate>Thu, 26 Mar 2009 13:46:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-147860</guid>
		<description>Hello

I wanna config a router with iptables for my WLAN. my problem, there is a database (mysql) there are all mac adresses, whitch have access...

is there a way to marry iptables with mysql??

best &amp; THX coop</description>
		<content:encoded><![CDATA[<p>Hello</p>
<p>I wanna config a router with iptables for my WLAN. my problem, there is a database (mysql) there are all mac adresses, whitch have access&#8230;</p>
<p>is there a way to marry iptables with mysql??</p>
<p>best &amp; THX coop</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luis</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-144310</link>
		<dc:creator>Luis</dc:creator>
		<pubDate>Tue, 08 Jul 2008 16:07:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-144310</guid>
		<description>Could someone help.
I have to arm machines whit linux kernel 2.6
I wan&#039;t to make a remote acess but i can&#039;t...
one I have been defined a mac address ifconfig eth0 hw ether 0B:62:9D:6D:1A:34
I made ping suceful but when I try ftp ore telnet it refuse the conection...</description>
		<content:encoded><![CDATA[<p>Could someone help.<br />
I have to arm machines whit linux kernel 2.6<br />
I wan&#8217;t to make a remote acess but i can&#8217;t&#8230;<br />
one I have been defined a mac address ifconfig eth0 hw ether 0B:62:9D:6D:1A:34<br />
I made ping suceful but when I try ftp ore telnet it refuse the conection&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vivek</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-143764</link>
		<dc:creator>vivek</dc:creator>
		<pubDate>Mon, 12 May 2008 20:33:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-143764</guid>
		<description>Sure, you can use -s IP-address option. Verify source IP 192.168.1.200 along with MAC 00:0F:EA:91:04:08 and if both matched drop it: 
&lt;code&gt;iptables -A INPUT -p tcp -s 192.168.1.200 -m mac --mac-source 00:0F:EA:91:04:08 -j DROP&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Sure, you can use -s IP-address option. Verify source IP 192.168.1.200 along with MAC 00:0F:EA:91:04:08 and if both matched drop it:<br />
<code>iptables -A INPUT -p tcp -s 192.168.1.200 -m mac --mac-source 00:0F:EA:91:04:08 -j DROP</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shawn</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-143763</link>
		<dc:creator>Shawn</dc:creator>
		<pubDate>Mon, 12 May 2008 20:26:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-143763</guid>
		<description>Is there a way to use this in conjunction with the source IP. So that you can enforce a MAC address to only be allowed through if it is using a specific IP address?

--
Thanks 
Shawn</description>
		<content:encoded><![CDATA[<p>Is there a way to use this in conjunction with the source IP. So that you can enforce a MAC address to only be allowed through if it is using a specific IP address?</p>
<p>&#8211;<br />
Thanks<br />
Shawn</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Orvalho J Augusto</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-143700</link>
		<dc:creator>Orvalho J Augusto</dc:creator>
		<pubDate>Wed, 07 May 2008 02:32:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-143700</guid>
		<description>Great!

You are good ones
Caveman</description>
		<content:encoded><![CDATA[<p>Great!</p>
<p>You are good ones<br />
Caveman</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lilian</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-141984</link>
		<dc:creator>Lilian</dc:creator>
		<pubDate>Wed, 28 Nov 2007 05:57:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-141984</guid>
		<description>to ZEE

Allow an ip or network group to conect via SSH
/etc/host.allow

SSHD:192.168.0.4 or something like this 192.168.0.


Deny all conection on SSH
/etc/host.deny

SSHD:ALL

I think it will help you</description>
		<content:encoded><![CDATA[<p>to ZEE</p>
<p>Allow an ip or network group to conect via SSH<br />
/etc/host.allow</p>
<p>SSHD:192.168.0.4 or something like this 192.168.0.</p>
<p>Deny all conection on SSH<br />
/etc/host.deny</p>
<p>SSHD:ALL</p>
<p>I think it will help you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zee</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-141901</link>
		<dc:creator>zee</dc:creator>
		<pubDate>Mon, 19 Nov 2007 14:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-141901</guid>
		<description>please i want to ban everyone of using my shell which is port 22 but keep their access on other ports and i owuld like only my PC to log to shell from my MAC address, anyone can help plz???</description>
		<content:encoded><![CDATA[<p>please i want to ban everyone of using my shell which is port 22 but keep their access on other ports and i owuld like only my PC to log to shell from my MAC address, anyone can help plz???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Catalin</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-141841</link>
		<dc:creator>Catalin</dc:creator>
		<pubDate>Tue, 13 Nov 2007 18:30:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-141841</guid>
		<description>Hello. I have a problem when i try to log with iptables. iptables v1.3.8: Unknown arg `LOG&#039;
what should i do ?</description>
		<content:encoded><![CDATA[<p>Hello. I have a problem when i try to log with iptables. iptables v1.3.8: Unknown arg `LOG&#8217;<br />
what should i do ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: irfan</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-141266</link>
		<dc:creator>irfan</dc:creator>
		<pubDate>Wed, 03 Oct 2007 15:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-141266</guid>
		<description>hello i am using iptables 

now i need that only those mac id can accept all other droped  who can i do this</description>
		<content:encoded><![CDATA[<p>hello i am using iptables </p>
<p>now i need that only those mac id can accept all other droped  who can i do this</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rick</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-97420</link>
		<dc:creator>rick</dc:creator>
		<pubDate>Fri, 23 Mar 2007 22:46:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-97420</guid>
		<description>Is there a way to get the MAC address of an attacker via iptable logging? All of the log levels that I&#039;ve tried give me my server&#039;s MAC address. I&#039;d love to get the MAC of the person I&#039;m blocking so I can block on their MAC in case they try using a proxy.

ex: -A RH-Firewall-1-INPUT -s ATTACKER_IP_HERE -j LOG --log-level 4 --log-prefix &quot;DROP ATTACKER: &quot;

this results in logs such as...
Mar 21 13:38:41 server_name kernel: DROP ATTACKER: IN=eth0 OUT= MAC=MY_SERVER_MAC_ADDR_HERE SRC=ATTACKER_IP_HERE DST=MY_SERVER_IP LEN=48 TOS=0x00 PREC=0x00 TTL=114 ID=50714 DF PROTO=TCP SPT=39616 DPT=80 WINDOW=65535 RES=0x00 SYN URGP=0</description>
		<content:encoded><![CDATA[<p>Is there a way to get the MAC address of an attacker via iptable logging? All of the log levels that I&#8217;ve tried give me my server&#8217;s MAC address. I&#8217;d love to get the MAC of the person I&#8217;m blocking so I can block on their MAC in case they try using a proxy.</p>
<p>ex: -A RH-Firewall-1-INPUT -s ATTACKER_IP_HERE -j LOG &#8211;log-level 4 &#8211;log-prefix &#8220;DROP ATTACKER: &#8221;</p>
<p>this results in logs such as&#8230;<br />
Mar 21 13:38:41 server_name kernel: DROP ATTACKER: IN=eth0 OUT= MAC=MY_SERVER_MAC_ADDR_HERE SRC=ATTACKER_IP_HERE DST=MY_SERVER_IP LEN=48 TOS=0&#215;00 PREC=0&#215;00 TTL=114 ID=50714 DF PROTO=TCP SPT=39616 DPT=80 WINDOW=65535 RES=0&#215;00 SYN URGP=0</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Egan</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-27946</link>
		<dc:creator>Michael Egan</dc:creator>
		<pubDate>Wed, 15 Nov 2006 00:40:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-27946</guid>
		<description>Does anybody know if this works on Suse 10.0? I need to filter a few MACs.</description>
		<content:encoded><![CDATA[<p>Does anybody know if this works on Suse 10.0? I need to filter a few MACs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nixcraft</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-19417</link>
		<dc:creator>nixcraft</dc:creator>
		<pubDate>Tue, 15 Aug 2006 15:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-19417</guid>
		<description>You can setup default policy to drop all packets and allow selected incoming packets from MAC based ip filtering.
Set default INPUT to deny all

# Setting default filter policy
&lt;B&gt;iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -m mac --mac-source 
00:0F:EA:91:04:08 -j ACCEPT&lt;/B&gt;

HTH</description>
		<content:encoded><![CDATA[<p>You can setup default policy to drop all packets and allow selected incoming packets from MAC based ip filtering.<br />
Set default INPUT to deny all</p>
<p># Setting default filter policy<br />
<b>iptables -P INPUT DROP<br />
iptables -P OUTPUT ACCEPT<br />
iptables -A INPUT -m mac &#8211;mac-source<br />
00:0F:EA:91:04:08 -j ACCEPT</b></p>
<p>HTH</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-19416</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 15 Aug 2006 09:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-19416</guid>
		<description>hello, how to blok ALL mac address, so i can permit only privileged mac adresses. thanks in advance</description>
		<content:encoded><![CDATA[<p>hello, how to blok ALL mac address, so i can permit only privileged mac adresses. thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-19415</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Sat, 07 Jan 2006 08:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.cyberciti.biz/tips/iptables-mac-address-filtering.html#comment-19415</guid>
		<description>Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.204 seconds -->
<!-- Cached page served by WP-Cache -->
