Talk:Networking: Difference between revisions

From KVM
(Added tip on a (in my opinion) better MAC address generator)
No edit summary
Line 5: Line 5:
However, it will not work and result in an error-message when running ''qemu-system-x86_64''. The command above needs to be run before ''qemu-system-x86_64''.
However, it will not work and result in an error-message when running ''qemu-system-x86_64''. The command above needs to be run before ''qemu-system-x86_64''.


 
-----------------------------------------


I think this oneliner for generating a random MAC address is much more readable, and as an added bonus it will use the entire 16 bit space:
I think this oneliner for generating a random MAC address is much more readable, and as an added bonus it will use the entire 16 bit space:
     printf "DE:AD:BE:EF:%02X:%02X\n" $((RANDOM&255)) $((RANDOM&255))
     printf "DE:AD:BE:EF:%02X:%02X\n" $((RANDOM&255)) $((RANDOM&255))
-----------------------------------------
If you create the bridge manually ("brctl addbr br0") then you should also bring it up, with "ifconfig br0 up".

Revision as of 16:03, 19 July 2010

In the section about running kvm as a non-root contains a setup that will not work. It says that one need to create a qemu-ifup script containing the line:

/usr/bin/sudo /usr/sbin/tunctl -u `whoami` -t $1

However, it will not work and result in an error-message when running qemu-system-x86_64. The command above needs to be run before qemu-system-x86_64.


I think this oneliner for generating a random MAC address is much more readable, and as an added bonus it will use the entire 16 bit space:

   printf "DE:AD:BE:EF:%02X:%02X\n" $((RANDOM&255)) $((RANDOM&255))

If you create the bridge manually ("brctl addbr br0") then you should also bring it up, with "ifconfig br0 up".