Jump to content

Iptables firewall questions.


tvlad
 Share

Recommended Posts

I took the fw from the Ip masquerading howto and i blocked those that i didn't want to have net in our lan by their mac addresses, i allowed myself and a couple of others by our mac addresses and then i blocked everyone by using ip ranges.

 

#------------BLOCK BY MAC ADDRESS-----------------------

$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -m mac --mac-source 00:A0:D2:A4:91:25 \ -d $UNIVERSE -j DROP #CONTE

#--------------ALLOW NET ACCESS-------------------------

$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -m mac --mac-source 00:02:44:41:1E:DB \

-d $UNIVERSE -j ACCEPT #VLAD

#-------------BLOCK EVERYONE ELSE----------------------

$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -s 192.168.0.0/16 -d $UNIVERSE -j DROP

$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -s 172.16.0.0/12 -d $UNIVERSE -j DROP

$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -s 10.0.0.0/0 -d $UNIVERSE -j DROP

$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -s 169.254.0.0/8 -d $UNIVERSE -j DROP

 

UNIVERSE="0.0.0.0/0"

 

Is the order in which i block and allow a good one ?,

 

And another question, would smth like -m mac --mac-source **:**:**:**:**:**

block all possible mac addresses.If not, how could i do that ???

 

Should i remove this line

# anything else outgoing on remote interface is valid

#

$IPTABLES -A OUTPUT -o $EXTIF -s $EXTIP -d $UNIVERSE -j ACCEPT

Edited by tvlad
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...