Results 1 to 2 of 2

Thread: Change mac and name of interface

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Beans
    110

    Question Change mac and name of interface

    Hello *

    I have a pc that I would like to use as a router and I am facing some difficulties.

    First of all I would like to do the following two changes on one of the interfaces (let's say eth0):

    • Change the name from "eth0" to "WAN"
    • Change the mac address so that it matches the one registered with my ISP

    The problem here is that I am not really sure how linux handles these changes. For instance, in the /etc/network/interfaces I have set:
    Code:
    auto eth0
    iface eth0 inet dhcp
           hwaddress ether 01:02:03:04:05:06
    And then in /etc/udev/rules.d/ I have a file with
    Code:
    KERNEL=="eth*", ATTR{address}=="00:56:78:98:76:54", NAME="WAN"
    So my confusion comes from the fact that to change the mac I do it based on the name, to change the name I do it based on the mac. Is this correct, is there some better way to do this?
    Last edited by sakishrist; April 30th, 2013 at 08:26 AM.

  2. #2
    Join Date
    Mar 2011
    Beans
    110

    Re: Change mac and name of interface

    I found a solution, using a single udev rule:
    Code:
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:d9:ea:b0", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="WAN", RUN="/sbin/ip link set dev %k address 08:00:27:d9:ea:b1"

Tags for this Thread

Bookmarks

Posting Permissions

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