qemu-toolkit / spec / fixture / etc / nic.rb

virtual_machine "nic" do
  disk '/dev/null'
  # This is a shortcut to create a connection to a vnic. 
  nic 'eth0', 
    macaddr: '2:8:20:52:a6:7e', 
    model: 'virtio', 
    via: 'igb1'

  # This is what happens below the covers.
  net :vnic, vlan: 2, name: 'vm1', ifname: 'vm1', macaddr: '1:8:20:52:a6:7e'
  net :nic, vlan: 2, name: "vm1", model: "virtio", macaddr: '1:8:20:52:a6:7e'

  # And this demonstrates how to configure the built-in DHCP-server: 
  nic 'eth2', 
    macaddr: '0:24:81:67:93:99', model: 'e1000g',
    via: 'igb2', 
    # Important part follows: 
    ip: '', netmask: '', 
    gateway_ip: '', hostname: 'foobar', dns_ip: ','