Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How to manage filtering by MAC in Ubuntu?

Scenario:

  1. Ubuntu DHCP is configured and working (network 192.168.1.0)

    a) Laptop 1 is set in configuration on Ubuntu as static IP

  2. Laptop 1 is configured for automatic IP and when is connected to server everything works.

  3. I'm taking laptop 2 which is configured as static IP 192.168.1.10 and his configuration is not set in Ubuntu dhcpd.conf

  4. After laptop 2 is connected internet working.

It is possible to do MAC filtering which disallow to connect PCs with address IP set as static but MAC address is not configured in Ubuntu (something like: intruder in network)?

share|improve this question

1 Answer 1

You can configure your DHCP server to only give static addresses to known MACs. Any unknown MAC addresses which attempt to get an address via DHCP will be logged as denied.

You can specify a dynamic address range to allocate to unknown addresses. These won't be static though, so any MAC which connects multiple times won't necessarily have the same IP. However, simply not allowing dynamic IP allocation, and only using static IPs for known MAC addresses is the easiest/best solution to what (I think) you are asking.

If it is WiFi, look into using the built-in MAC filtering on your access points or routers. If it is for wired ethernet, then you'll need to build a bit more complex firewall rules to deal with it. Though, for some things, these too can simply be subverted.

share|improve this answer
    
I have dynamic configuration OFF and only one adrress configured in dhcpd.conf. But thats not working for me. Still second laptop with different MAC can (after add static IP in his configuration) has internet. –  user1655161 Sep 29 '12 at 19:25
    
Are you sure that dhcpd is the DHCP server your clients are connecting to? I'm using dnsmasq as my DHCP and DNS server, and it works fine here. Make sure your wifi router isn't serving DHCP, or that you aren't also running a different DHCP server which is giving out the addresses. –  dobey Sep 29 '12 at 19:39
    
Because its my first steps in ubuntu I my free time I try to reinstall server and try again. –  user1655161 Oct 2 '12 at 15:40
    
Im tried ones again, but seems the problem is when client configured his PC to static adress from even if configuration on ubuntu DHCP is set to static. When client has static manualy enter in example windows configuration, he gets internet on his PC. –  user1655161 Oct 27 '12 at 10:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.