Solved

iptables

Posted on 2001-09-14
7
360 Views
Last Modified: 2012-05-04
I need an expamle of how to make a rule with an IP and MAC addressess on iptables for Linux.
0
Comment
Question by:CyberGod
  • 3
  • 2
  • 2
7 Comments
 
LVL 5

Accepted Solution

by:
BlackDiamond earned 100 total points
ID: 6483687
iptables -A INPUT -s 2.3.4.0/24 -m mac --mac-source 00:11:22:33:44:55 -j ACCEPT
0
 

Author Comment

by:CyberGod
ID: 6484413
Can you be more specific about this -m mac --mac-source
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6484736
does
   man iptables
not give you the answer
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 5

Expert Comment

by:BlackDiamond
ID: 6485092
CyberGod,
"-m mac" tells iptables that you want to use the built-in mac module, and that module has the --mac-source parameter.  The rule that I showed above would accept anything originating from the 2.3.4.0 subnet that was routed through an interface in the same broadcast domain (on the same subnet) with mac 00:11:22:33:44:55.

As ahoffmann stated, "man iptables" will show you all of these options.
0
 

Author Comment

by:CyberGod
ID: 6485504
iptables -A INPUT -s 2.3.4.5/32 -m mac --mac-source 00:11:22:33:44:55 -j ACCEPT

Does this means that I can accept packets from a NIC with IP 2.3.4.5 and MAC 00:11:22:33:44:55 ? (yes/no)
0
 
LVL 5

Expert Comment

by:BlackDiamond
ID: 6487901
Cybergod, that is correct.  But keep in mind that if you have more than one subnet, then you will need to use ip ranges combined with the MAC of your router interface.  This is because MAC addresses are seen in the same broadcast domain, so you will see the MAC address of the last device to touch the packet (which would be your router).  
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6488055
BTW, would be nice to see what happens with such an iptables configuration with clients comming from a TokenRing network (where you need to set the MAC).
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now