[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

iptables

Posted on 2001-09-14
7
Medium Priority
?
394 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 5

Accepted Solution

by:
BlackDiamond earned 300 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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.
Suggested Courses

649 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