Find the answer to your Linux question:
Results 1 to 2 of 2
hi I want to change (have to - internet connection is bound to my other network card) my MAC address on my laptop I did this with ifconfig...., but it's ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2005
    Posts
    9

    changing MAC adr. with script - suse9.2 pro


    hi

    I want to change (have to - internet connection is bound to my other network card) my MAC address on my laptop

    I did this with ifconfig...., but it's pretty anoying to type it every startup, therefore I wanted to do this via script

    problem is I don't know how to write such a script
    I'd be very gratefull, if someone could explain me how to do it (preferably in easy words -> newbie)

    OS: Suse 9.2 Pro

    thanks

  2. #2
    Linux Enthusiast
    Join Date
    Feb 2005
    Location
    SE, Stockholm
    Posts
    512
    You could allways create a script in your /etc/init.d directory where you set your own "ifconfig" commands in.

    Content of script file (e.g. changeMac)
    Code:
    #!/bin/bash
    ifconfig eth0 ether 00:11:22:33:44:55
    Then you should do a couple of symlinks as well
    Code:
    ln -s /etc/init.d/changeMac /etc/init.d/rc3.d/S99changeMac
    ln -s /etc/init.d/changeMac /etc/init.d/rc5.d/S99changeMac
    Thats just about it.

    Yeah, don't forgett to do "/etc/init.d/changeMac" executable
    Code:
    chmod u+x /etc/init.d/changeMac

Posting Permissions

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