This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Permanent Mac address change

Hello all,
i have a problem with my isp. they have locked my mac adress to my ip. So when im going to install my Astaro linux i need to clone my mac address. this is done easily by doing this:
ifconfig eth1 down
ifconfig eth1 hw ether 
ifconfig eth1 up

But is there a way to make this change happen every time the computer starts. now i have to do it manually every time i restart my computer. Thankful for all suggestions.

/Hans


This thread was automatically locked due to age.
Parents
  • hi hans,

    in '/sbin/init.d/networks' all interfaces are configured at startup. you could edit the settings of the appropriate interface there.

    bye,
    michael
  • I too would like to be able permanently to change the MAC address of my gateway NIC in case I need to remove and replace it.

    I checked /sbin/init.d/networks, and it contains the following comment: "Automatically generated, useless editing."  Does this mean that any editing you do would be overwritten [by some cron job] [at the next boot] ....?

    If editing will not be overwritten, would very much appreciate help with MAC address syntax.  I know how to do it in RedHat (MACADDR="aabbccddeeff").  Will this work in Astaro as well?

    Thanks to anyone who can help.
  • Re. the above, I didn't really mean to say that I want "permanently to change the MAC address of my gateway NIC"; that controversy has gone on for far too long in other arenas.  I should have said that I want to change the MAC address other devices see, or something of the sort.
  • hi,

    i think it will be overwritten, when changing interface settings in webmin ...
    but i'm not shure - maybe someone knows exactly ...?!

    bye,
    michael
  • i did i dirty hack like this. Since i use the dhcp client from the attic dir i edited the dhcp file that is run when the computer boots and added the following before the line with
    "dhcpcd eth1".
    ifconfig eth1 down
    ifconfig eth1 hw ether 00:00:00: and son on
    ifconfig eth1 up

    And now it works great!

    /Hans
  • Does anyone know how to manage this in Astaro 3.207 ?  I like to get this firewall up and running but Rogers tech support just su... and I have been poking through the setitfhw.pl without getting anywhere as it is putting out an ifconfig -a (for all ether cards).  I need to be able to change the MAC address through software or take my system down for 7 days.
  • Here's what has worked for me in all versions of 3.2:

    1. Copy /etc/itfhw.conf to a new file in /etc (let's name it macaddr). In macaddr, change the mac of eth1 (or the eth card of interest) to the spoof value you need.

    2. Edit /sbin/init.d/init_nics:

    a). after row 38 (which reads "ifconfig $nic down"), and before the first "fi", enter:  

    ifconfig eth1 hw ether XX:XX:XX:XX:XX:XX      (XX:XX:... is the spoof value you need).

    b). after what is now Row 44 (which reads "/usr/local/bin/setitfhw.pl"), and just above the ";;" which terminates (start), 

    enter:

    cp /etc/macaddr /etc/itfhw.conf.

    NOTE: I'm not sure steps 1. and 2b). are really needed, but if you use them, I strongly suspect you will need to reconstitute macaddr if any of the hardware settings for any of your ethernet cards change.

    3. Reboot.  (You probably can reinitialize without rebooting, but not knowing for sure when /etc/itfhw.conf does whatever it does, I always reboot.)
  • Don't forget to reset/unplug your cable modem when you make MAC changes.  With the Motorola modems that Shaw uses here in Calgary, if you have a single DHCP IP on your account and you shut down one computer and power up another, you may get an IP address, but the second system won't have a valid connection until the modem is reset.  I don't know what the timeout is exactly, but I imagine it would be 15-30 minutes before the modem released the first MAC/IP.

    ttfn.
  • Cable modems and upstream systems may vary.  My ISP is Earthlink using an Atlanta Scientific modem.

    Here, if the eth1 MAC addresses are different on my two Astaro boxes, I can't get an IP on my "unspoofed" second box, even if I reboot the modem and wait an hour or so for it to cool off.

    If I keep the eth1 MAC address the same on both Astaro boxes, DHCPC always gets the same IP when I shut down the first box, swap TCP cables at the modem from the first box to the second, and then boot the second box.  The only thing the modem knows is that its TCP connection shut down, then restarted after whatever time it takes to shut down the first box, swap cables, and boot the second box.  After I make a swap, it does take either Astaro box some 30-60 seconds to get an IP after the boot beeps finish.
Reply
  • Cable modems and upstream systems may vary.  My ISP is Earthlink using an Atlanta Scientific modem.

    Here, if the eth1 MAC addresses are different on my two Astaro boxes, I can't get an IP on my "unspoofed" second box, even if I reboot the modem and wait an hour or so for it to cool off.

    If I keep the eth1 MAC address the same on both Astaro boxes, DHCPC always gets the same IP when I shut down the first box, swap TCP cables at the modem from the first box to the second, and then boot the second box.  The only thing the modem knows is that its TCP connection shut down, then restarted after whatever time it takes to shut down the first box, swap cables, and boot the second box.  After I make a swap, it does take either Astaro box some 30-60 seconds to get an IP after the boot beeps finish.
Children
No Data