Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] iptables w/mac filtering question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ccosse
Apprentice
Apprentice


Joined: 10 Mar 2004
Posts: 169
Location: Las Vegas, NV

PostPosted: Thu Oct 25, 2012 6:57 pm    Post subject: [SOLVED] iptables w/mac filtering question Reply with quote

Hi, Could someone please tell me what I'm doing wrong? Below is my simple iptables configuration ... I'm trying to do forwarding through a homemade hotspot. Clients connect on wlan3 and gateway to WAN is eth0. I want to drop everyone except the indicated MAC. But it doesn't work and I don't see why!?!?!

Code:

-P INPUT ACCEPT
-P FORWARD DROP
-P OUTPUT ACCEPT
-A FORWARD -m mac --mac-source XX:XX:XX:XX:XX:XX -j ACCEPT


Thank you for any help!


EDIT: Solution (sort-of) is to add the line:
iptables -A FORWARD -m state --state ESTABLISHED -s 0/0 -j ACCEPT
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Fri Oct 26, 2012 3:32 pm    Post subject: Reply with quote

Quote:
DIT: Solution (sort-of) is to add the line:
iptables -A FORWARD -m state --state ESTABLISHED -s 0/0 -j ACCEPT


It is actually the right solution, you can skip the -s 0/0 part, add the RELATED state (think icmp error message, ftp...) and also you can start using the (new) shiny conntrack module instead of the g'old state one:
Code:
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

_________________
The End of the Internet!
Back to top
View user's profile Send private message
ccosse
Apprentice
Apprentice


Joined: 10 Mar 2004
Posts: 169
Location: Las Vegas, NV

PostPosted: Mon Oct 29, 2012 1:25 pm    Post subject: Reply with quote

Truc,
just posting a Thank You for responding to my post. I've implemented your suggestions and they are working well. Thank you!
-CC
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum