-
-
Save sonalranjit/639e0c3a4095d2f7cfab45ca9d972cf5 to your computer and use it in GitHub Desktop.
Revisions
-
pklaus revised this gist
Mar 19, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import random def randomMAC(): return [ 0x00, 0x16, 0x3e, random.randint(0x00, 0x7f), random.randint(0x00, 0xff), random.randint(0x00, 0xff) ] -
pklaus revised this gist
Mar 19, 2014 . 2 changed files with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,4 +10,6 @@ TODO * [MAC Adress](http://en.wikipedia.org/wiki/MAC_address) on Wikipedia * redhat's virtualization guide on [Generating a new unique MAC address](http://goo.gl/rtt5T8) * A Perl Script that does the same: [randmac.pl](http://www.hellion.org.uk/cgi-bin/randmac.pl?source=1) * The python module [`netaddr`](https://pypi.python.org/pypi/netaddr) can help you work with MAC addresses. Empty file. -
pklaus created this gist
Mar 19, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ TODO * Create a CLI-Interface with the following options: * Unicast or Multicast? Default: Unicast * Locally Administered or Globally Unique? Default: Locally Administered * Prescribe specific OUI (overwrites the above two) * Number of MACs to generate (they should not collide and be piped out separated by newlines) ### Resources * [MAC Adress](http://en.wikipedia.org/wiki/MAC_address) on Wikipedia * redhat's virtualization guide on [Generating a new unique MAC address](http://goo.gl/rtt5T8) * A Perl Script that does the same: [randmac.pl](http://www.hellion.org.uk/cgi-bin/randmac.pl?source=1) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ #!/usr/bin/env python import random def randomMAC(): mac = [ 0x00, 0x16, 0x3e, random.randint(0x00, 0x7f), random.randint(0x00, 0xff), random.randint(0x00, 0xff) ] def MACprettyprint(mac): return ':'.join(map(lambda x: "%02x" % x, mac)) if __name__ == '__main__': print(MACprettyprint(randomMAC()))