Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How to increment a MAC Address?

by jcoxen (Deacon)
on May 24, 2005 at 20:35 UTC ( [id://460159]=note: print w/replies, xml ) Need Help??


in reply to How to increment a MAC Address?

Here's a brute force approach...

#!/usr/bin/perl use strict; use warnings; my %hash = ("1" => "00", "2" => "00", "3" => "00", "4" => "00", "5" => + "00", "6" => "00"); for (my $segment = 6; $segment != 0; $segment--) { for (0..99) { $_ = "0$_" if $_ < 10; $hash{$segment} = $_; print "$hash{1}:$hash{2}:$hash{3}:$hash{4}:$hash{5}:$hash{6}\n +"; } }

Jack

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://460159]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-25 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found