Load a custom MAC address

Discussion in 'Linux, BSD and Other OS's' started by edijs, Mar 12, 2007.

  1. edijs

    edijs Programmer

    Likes Received:
    9
    Trophy Points:
    38
    Hi!

    I'd like to hear a way to get FreeBSD to put a custom MAC address for my 3COM NIC on every system bootup. I've already tried to do that in rc.conf, but it doesn't work -- it just hangs the NIC and says "no routing" when I try to ping something. The only way it works is to write like this:

    Code:
    ifconfig xl0 link <macaddress>
    But that's somewhat inconvenient. Any help would be nice! Thanks!
     
  2. kenji san

    kenji san Geek Trainee

    Likes Received:
    0
    Trophy Points:
    0
    As far as I know that is not possible. A MAC address is something like a serial number and is unique to each device. Why, may I ask, would you need a custom MAC?
     
  3. edijs

    edijs Programmer

    Likes Received:
    9
    Trophy Points:
    38
    Isn't a startup script capable of executing console commands (?) - I don't know this script language at all, so ...

    I need that to connect the box to a network [temporarily] where only one IP for one MAC address is available.
     
  4. Anti-Trend

    Anti-Trend Nonconformist Geek

    Likes Received:
    118
    Trophy Points:
    63
    It's called MAC spoofing. In FreeBSD, you can change your MAC address with the `ifconfig <interface> link <address>` command.
     
  5. edijs

    edijs Programmer

    Likes Received:
    9
    Trophy Points:
    38
    Yes, I can, but how can I make the system do this at the startup automatically, because, as I mentioned in the initial post, writing this command every time the system boots up is somewhat inconvenient.
     
  6. kenji san

    kenji san Geek Trainee

    Likes Received:
    0
    Trophy Points:
    0
    See the rc man page here. You only need to put an executable script in the /usr/local/etc/rc.d directory. FYI, it is not usually a good idea to put custom scripts in the /etc/rc.d

    If you follow the instructions in the man page, this should not be too difficult.
     

Share This Page