Results 1 to 3 of 3

Thread: IPtables - IP & MAC combined rule to define internet access

  1. #1
    Junior Member
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default IPtables - IP & MAC combined rule to define internet access

    Hi,
    This is what i'm thinking of. i would like to deny everyone's access to use my internet facility. The i would like to give them access one by one through IP and MAC binding.

    can anyone pls enlighten me about this?

  2. #2
    Member
    Join Date
    Feb 2008
    Posts
    61
    Thanks
    0
    Thanked 5 Times in 4 Posts
    Rep Power
    7

    Default

    Quote Originally Posted by Tawfiq View Post
    i would like to deny everyone's access to use my internet facility. The i would like to give them access one by one through IP and MAC binding.
    If you got the idea from looking at how a Wireless AP's DHCPd allows you to allow/deny MAC/IP pairs then simply put for wired machines MAC addressing only works inside the LAN, not beyond. Of course you could use a DHCPd to deny certain MAC addresses from getting a lease in the first place.

  3. #3
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,498
    Thanks
    17
    Thanked 788 Times in 506 Posts
    Rep Power
    10

    Default

    I'm adding little bit to unSpawn post, just deny everything using iptables and allow access to certain IPs or Mac:
    Code:
    #!/bin/sh
    IPT="/sbin/iptables"
    MACS="00:0F:EA:91:04:08 00:0F:EA:91:03:08 00:0F:EA:91:04:09"
    IPS="192.168.1.2 202.54.1.2"
    
    $IPT -P INPUT DROP
    $IPT -P OUTPUT ACCEPT
    
    echo "Allowing Mac Addresses..."
    for m in $MACS
    do
        $IPT -A INPUT -m mac --mac-source ${m} -j ACCEPT
    done
    
    
    echo "Allowing IP Addresses..."
    for i in $IPS
    do
        $IPT -A INPUT -p tcp -s ${i} -j ACCEPT
    done
    Iptables mac address filtering
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How do I connect two computers together to access the Internet?
    By ibolah in forum Computer Networking and Internet/broadband
    Replies: 3
    Last Post: 14th October 2009, 10:31 AM
  2. IPtables MAC & IP rule for internet access
    By Tawfiq in forum Networking, Firewalls and Security
    Replies: 4
    Last Post: 2nd August 2009, 07:53 AM
  3. [Solved] ipTables rule to block a port for all internal IP Addresses except one
    By pranaysharmadelhi in forum Networking, Firewalls and Security
    Replies: 2
    Last Post: 14th July 2009, 09:49 PM
  4. Iptables Two ISP Load Balancing Internet Connection
    By please in forum Networking, Firewalls and Security
    Replies: 2
    Last Post: 23rd June 2009, 11:25 AM
  5. unable to access ftp server via Internet explorer
    By satishap in forum Web servers
    Replies: 1
    Last Post: 14th September 2008, 09:26 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •