Results 1 to 2 of 2

Thread: iptables open for MAC addresses

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default iptables open for MAC addresses

    I have a DSL account with changing IP addresses, so I want to use the MAC filtering for allowing access only to my MAC address.

    I want to block access to 3306 mysql on the server for all except myself:

    Code:
    iptables -A INPUT -p tcp --destination-port 3306 -j DROP
    iptables -I INPUT -i eth0 -p tcp --destination-port 3306 -m mac --mac-source 00:30:1b:bd:76:c8 -j ACCEPT
    NOTE: I don't want to block everything as a rule.

    iptables -L -v output on the server:

    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT tcp -- anywhere anywhere tcp dpt:mysql MAC 00:30:1B:BD:76:C8
    DROP tcp -- anywhere anywhere tcp dpt:mysql

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination

    But access to mysql fails now (it worked before without iptables rules):

    xxxx@ubuntu:/usr/local/shellscripte/scripts$ mysql -h xxxxxx -u root
    ERROR 2003 (HY000): Can't connect to MySQL server on 'xxxxxx' (110)


    Any ideas what is wrong, or alternative ways of achieving this?

  2. #2
    Junior Member
    Join Date
    Mar 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    Anybody able to give ideas? Help is greatly appreciated. Thanks!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Floating IP addresses
    By gsb1bee in forum High Availability Cluster
    Replies: 2
    Last Post: 4th May 2010, 11:49 AM
  2. Ubuntu 9.04 ip addresses problem
    By ProfiMK in forum Ubuntu / Debian
    Replies: 5
    Last Post: 8th February 2010, 11:53 AM
  3. Open Port in IPTABLES
    By jayank008 in forum Networking, Firewalls and Security
    Replies: 2
    Last Post: 30th January 2010, 02:37 PM
  4. Red Hat open ftp data ports using iptables
    By satish1975 in forum Networking, Firewalls and Security
    Replies: 2
    Last Post: 10th August 2009, 11:34 AM
  5. [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, 10:49 PM

Posting Permissions

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