mac addr

Marcel Kunath kunathma@pilot.msu.edu
Thu, 27 Apr 2000 11:54:12 -0400 (EDT)


just saw this on /.     said to change the mac addr of eth card?!


            #!/usr/bin/perl -w

            $if = "eth0";
            $hwaddr = "";

            # From Programming Perl, 2nd ed, p 224
            srand(time ^ $$ ^ unpack "%32L*", `ps axww | gzip`);

            for($i = 0; $i != 6; $i++) {
                    $hwaddr .= sprintf "%lX", (rand 256);
                    $hwaddr .= ":";
            }

            chop($hwaddr);
            `ifconfig $if hw ether $hwaddr`;


didn't know u could do that.....

--
Marcel Kunath