[wplug] Interesting question du jour
Vanco, Donald
VANCOD at PIOS.com
Mon Apr 21 15:58:51 EDT 2003
Eric C. Cooper wrote:
> On Mon, Apr 21, 2003 at 02:52:53PM -0400, Vanco, Donald wrote:
>> I have a column delimited set of hostname -vs- MAC addresses.
>> Each of the servers has 2 interfaces - the MAC address listed is for
>> the first interface. I need to make an entry for the second
>> interface, which, as luck would have it, is the SAME as the primary
>> interface save the last pair, which increments by one.
>
> #!/usr/bin/perl
> while (<>) {
> /(.*)\s+(.*):(.*)/;
> printf "%s %s:%s %s:%02X\n", $1, $2, $3, $2, ("0x" . $3) + 1; }
>
> (Note that this won't be correct if the last byte of a MAC address is
> ever 0xFF.)
This seems to change the last byte of every MAC to 01
rcas2123 00:09:6B:63:0A:22 00:09:6B:63:0A:01
rcas2124 00:09:6B:49:09:86 00:09:6B:49:09:01
rcas2125 00:09:6B:63:0A:DD 00:09:6B:63:0A:01
rcas2126 00:09:6B:49:08:EA 00:09:6B:49:08:01
rcas2127 00:09:6B:49:09:20 00:09:6B:49:09:01
rcas2128 00:09:6B:63:0A:89 00:09:6B:63:0A:01
rcas2129 00:09:6B:49:06:5C 00:09:6B:49:06:01
Don
More information about the wplug
mailing list