This blog is about anything technically opensource or copyleft-ed/ GPL-ed, obviously most of it Linux or connected to Linux in some way.

Sunday, December 26, 2010

MAC cloning

I never thought that cloning MAC addresses was so simple, especially in Linux. But first I will digress as usual and start off as to what led me to cloning the MAC address. To skip all the blabber, goto to the bullets where it says skipblabber. :) Since my Toshiba laptop went out for service, it has started giving many problems in a row. First the heating issue led to a shutdown problem, then I messed up the alcohol used to clean the chips' heatsinks and conked my display off. The service guys fixed that but damaged all the navigation keys which almost need me to stand on them to move intermittently. With so many problems, how would I not suspect the laptop's networking when my ISP refused to connect?

My ISP kept on giving me errors on all flavours: Vista, Maverick and even downgrade installations to Jaunty! The error code indicated authentication problems, which may be protocol issues. I went ahead and got the ethernet and wifi checked elsewhere and all worked fine. Only then did I call my ISP and ask what the heck was going on. It turns out that my ISP has recently locked the account to a single MAC address for "security reasons". They wanted me to fill up a form to say that they should open my account to other MAC addresses and any misuse then would be my responsibility. I went straightaway looking for forms but they didn't tell me that Sunday their branch here is closed. I came back disappointed, but a search online landed me a simpler solution. Why go out at all signing forms when a few keystrokes get the job done?! :) So here goes:


skipblabber:
  • Get your source system (my PC thats locked with the ISP) MAC address by ipconfig /all if you're in Windoze or in good ol' Linux you check the entry for ether by ifconfig. This MAC is used further as xx:xx:xx:xx:xx:xx
  • Repeat the above for the target system (my laptop thats locked out from the ISP) so that I can jot it down in case something ever goes wrong. Contingency, that is. :)
  • To change the target MAC on Linux:
    • sudo ifconfig eth0 down
    • sudo ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
    • sudo ifconfig eth0 up (Goes off on reboot)
    • OR in recent Ubuntu systems, just right click on network ->Edit Connections -> Eth0 -> Edit -> add xx:xx:xx:xx:xx:xx to Clone MAC. (Stays on reboot)
  • To change the target MAC on Windoze:
    • Go to LAN properties -> General -> Configure (LAN card) -> Advanced -> Network Address (Property) -> add xx:xx:xx:xx:xx:xx to Value -> OK
    • Disable & enable the LAN or reboot (the Windoze way) :)
    • OR regedit/ regedit32 and expand HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}
    • While there, check all subkeys 0001, 0002... till you get your LAN card in DriverDesc.
    •  Add xx:xx:xx:xx:xx:xx to NetworkAddress value.
    • Reboot.
If all went well, ipconfig /all or ifconfig should show you xx:xx:xx:xx:xx:xx as your new MAC. You need to try connecting to your ISP after the MAC change. In case of Linux, this would mean:
  • sudo poff -a dsl-provider
  • sudo pon dsl-provider
  • OR sudo pppoeconf (if not already done earlier)
Note: In case your pppoeconf is stuck at 100% and goes nowhere, you're fast and lazy at the same time like me. :) You didn't read all that pppoeconf throws and pressed enter, enter,... If that, pppoeconf is likely stuck searching other network interfaces for announcements; this is a guess, by the way. Best way to get ahead immediately now is to unplug the LAN cable and replug it. :) Don't worry, its at 100% on eth0 search, so it will have those settings.

Thursday, December 16, 2010

Using Linux for Windows fix!

I downloaded the trial version of BitDefender antivirus for my XP today and in its scanning during the installation itself, it found some 3 issues with Windows files and quarantined them. It asked for a reboot to continue installation. On reboot, it resumed or started the scan afresh without even really giving me my desktop; it was a blank screen with BitDefender scanning in the foreground. Meanwhile, a pop-up box told me that SYSTEM is going for a shutdown as the explorer.exe or some other service crashed. Well, okay, hardly a choice! However, on restart this time, I got a command line message on NTOSKRNL.EXE missing. Obviously, BitDefender knocked it off for a virus or something and am stuck with a command line. Worse yet, I can't restore it because I don't have a DVD/CD ROM drive. (It *burnt* a couple of months back).

So much for background. Next, I rebooted in Ubuntu Maverick and searched my system for an XP install ISO dumped. Maverick is awesome, because it opened .iso as is. Within that I386 folder, there was this NTOSKRNL.EX_ that needed to be expanded. I sent it straight down to my pen drive, ran an expand on it from Vista on my laptop and got it back here. All I needed now is to get the expanded NTOSKRNL.EXE (renamed from expanded NTOSKRNL.EX_) into C:\Windows\System32\. Phew.

Windows is mighty sick but my bank webpages and software unfortunately works only with Windows. :(

Followers