9/10/2023 0 Comments Get mac address for ip linuxIt is also referred to as the Physical address or Burned-in address. The MAC address is a 48-bit hexadecimal address consisting of six sets of two digits or characters separated by colons or hyphens. This address is used to identify and communicate with other devices, be it a computer, smartphone, or printer, on a network. It’s easy to lock MAC address with IP in Linux.As mentioned above, the MAC Address (or Media Access Control address) is a unique identifier used to recognize devices connected to a network. So the command would be like below: iptables -A INPUT -s A.B.C.D -i eth0 -m mac ! -mac-source 1A:2B:3C:4D:5E:6F -j DROP If you still accept the incoming packets but only drop the forwarding packets, replace the INPUT with FORWARD. The command above simply means that if there is a packet from IP address A.B.C.D with the MAC address is not 1A:2B:3C:4D:5E:6F, then drop / block the connection packet. Using your favorite shell, type the command below in the command line: iptables -A INPUT -s A.B.C.D -i eth0 -m mac ! -mac-source 1A:2B:3C:4D:5E:6F -j DROP In Linux we can easily do this by using ‘iptables’ tool. That means you can block any IP address coming from different source of MAC address in Linux OS. In case you use Linux operating system as the router in your office, instead of using Mikrotik, you can do the same with Mikrotik. The goal of this task is to prevent users from changing their workstation’s IP address to break policy rules. In a previous post, we have shown you how to lock MAC address and IP in Mikrotik.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |