diff --git a/README.md b/README.md index 8e4092c..9f20fb4 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Path calculation: ```ide_cdrom "path"```, ```sata_cdrom "path"```, ```virtio_cdrom "path"``` - creates IDE/SATA/Virtio CDROMs, where "path" must be full path to file. -```network "device-model" "type" "name"``` - create network device. For model, you either specify ```e1000```, when guest doesn't have virtio drivers, or ```virtio-net``` for virtio network device. Type only supports ```tap```, where name is name of the tap (that You probably want to add to bridge) +```network "device-model" "tap" "tap-name" "mac-address"``` - create network device. For model, you either specify ```e1000```, when guest doesn't have virtio drivers, or ```virtio-net``` for virtio network device. Example: ```network "virtio-net" "tap" "vnet0tap1" "52:54:00:12:34:56"``` ```kuemu_start``` - finishes QEMU argument building and spawns virtual machine. @@ -65,7 +65,7 @@ monitor spice uefi virtio_disk "" -network "virtio-net" "tap" "vnet0tap1" +network "virtio-net" "tap" "vnet0tap1" "d6:7d:05:31:93:61" kuemu_start ``` @@ -87,7 +87,7 @@ monitor spice uefi sata_disk "" -network "e1000" "tap" "vnet0tap1" +network "e1000" "tap" "vnet0tap1" "d6:7d:05:31:93:61" kuemu_start ``` \ No newline at end of file diff --git a/kuemu.sh b/kuemu.sh index 50acbf6..cb49773 100644 --- a/kuemu.sh +++ b/kuemu.sh @@ -195,14 +195,15 @@ function virtio_cdrom() { } nic_counter=$(counter_create 0) -function network() { +function network() { # model, mode (tap or bridge), tap name / bridge + # model, tap, tap name, mac address nic="nic$(counter_read $nic_counter)" counter_increment $nic_counter - append "-device $1,netdev=$nic" case "$2" in "tap") + append "-device $1,netdev=$nic,mac=$4" append "-netdev tap,id=$nic,ifname=$3,script=no,downscript=no" ;; *)