That was it. Thanks!

I've set a fixed IP address to bg0 in the host:

# ifconfig bge0 192.168.0.9 255.255.255.0

Now the guest can DHCP:

# vmctl start vm.test -c
Connected to /dev/ttyp1 (speed 9600)

Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2017 OpenBSD. All rights reserved.
https://www.OpenBSD.org

OpenBSD 6.1-current (RAMDISK_CD) #41: Tue May  2 21:13:30 MDT 2017
    [email protected]:/usr/src/sys/arch/amd64/compile/RAMDISK_CD
real mem = 1056964608 (1008MB)
avail mem = 1021235200 (973MB)
mainbus0 at root
bios0 at mainbus0
acpi at bios0 not configured
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel(R) Celeron(R) CPU G1610T @ 2.30GHz, 2295.37 MHz
cpu0:
FPU,VME,DE,PSE,MSR,PAE,MCE,CX8,SEP,PGE,MCA,CMOV,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SSE3,PCLMUL,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,XSAVE,HV,NXE,LONG,LAHF,FSGSBASE,SMEP,ERMS
cpu0: 256KB 64b/line 8-way L2 cache
pvbus0 at mainbus0: OpenBSD
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "OpenBSD VMM Host" rev 0x00
virtio0 at pci0 dev 1 function 0 "Qumranet Virtio RNG" rev 0x00
viornd0 at virtio0
virtio0: irq 3
virtio1 at pci0 dev 2 function 0 "Qumranet Virtio Storage" rev 0x00
vioblk0 at virtio1
scsibus0 at vioblk0: 2 targets
sd0 at scsibus0 targ 0 lun 0: <VirtIO, Block Device, > SCSI3 0/direct fixed
sd0: 4096MB, 512 bytes/sector, 8388608 sectors
virtio1: irq 5
virtio2 at pci0 dev 3 function 0 "Qumranet Virtio Network" rev 0x00
vio0 at virtio2: address fe:e1:bb:d1:44:af
virtio2: irq 7
virtio3 at pci0 dev 4 function 0 "OpenBSD VMM Control" rev 0x00
virtio3: no matching child driver; not configured
isa0 at mainbus0
com0 at isa0 port 0x3f8/8 irq 4: ns8250, no fifo
com0: console
softraid0 at root
scsibus1 at softraid0: 256 targets
root on rd0a swap on rd0b dump on rd0b

erase ^?, werase ^W, kill ^U, intr ^C, status ^T

Welcome to the OpenBSD/amd64 6.1 installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? I
At any prompt except password prompts you can escape to a shell by
typing '!'. Default answers are shown in []'s and are selected by
pressing RETURN.  You can exit this program at any time by pressing
Control-C, but this can leave your system in an inconsistent state.

Terminal type? [vt220]
System hostname? (short form, e.g. 'foo') vmtest

Available network interfaces are: vio0 vlan0.
Which network interface do you wish to configure? (or 'done') [vio0]
IPv4 address for vio0? (or 'dhcp' or 'none') [dhcp]
DHCPDISCOVER on vio0 - interval 1
DHCPOFFER from 192.168.0.1 (6c:b0:ce:3f:2e:b7)
DHCPREQUEST on vio0 to 255.255.255.255
DHCPACK from 192.168.0.1 (6c:b0:ce:3f:2e:b7)
bound to 192.168.0.13 -- renewal in 1800 seconds.
IPv6 address for vio0? (or 'autoconf' or 'none') [none]


Do you have any idea how to avoid this issue?



On Thu, May 4, 2017 at 3:27 PM, trondd <[email protected]> wrote:

> On Thu, May 4, 2017 8:51 am, Francois Stephany wrote:
> > Hi,
> >
> > I'm new to OpenBSD and I'm trying a simple setup where a VMM guest has
> > access to the network via tap and bridge. The host uses a wired
> connection
> > and gets its network address with DHCP.
> >
> > Here's my /etc/vm.conf:
> >
> > switch "vms_switch" {
> >         interface bridge0
> >         add bge0
> > }
> >
> > vm "vm.test" {
> >         memory 1G
> >         boot /home/fstephany/bsd.rd
> >         disk /var/vms/fstephany/vmtest-disk.img
> >         owner fstephany
> >         interface tap {
> >                 switch "vms_switch"
> >         }
> >         disable
> > }
> >
> >
> > I've stopped vmd with #rcctl stop vmd
> > and started it manually:
> >
> > # vmd -dvv
> > startup
> > /etc/vm.conf:4: switch "vms_switch" registered
> > /etc/vm.conf:15: vm "vm.test" registered (disabled)
> > vm_priv_brconfig: interface bridge0 description switch1-vms_switch
> > vm_priv_brconfig: interface bridge0 add bge0
> > vmd_configure: not creating vm vm.test (disabled)
> > vm_opentty: vm vm.test tty /dev/ttyp1 uid 0 gid 4 mode 620
> > vm_priv_ifconfig: interface tap0 description vm1-if0-vm.test
> > vm_priv_ifconfig: interface bridge0 add tap0
> > vm.test: started vm 1 successfully, tty /dev/ttyp1
> > loadfile_elf: loaded ELF kernel
> > run_vm: initializing hardware for vm vm.test
> > virtio_init: vm "vm.test" vio0 lladdr fe:e1:bb:d1:6d:23
> > run_vm: starting vcpu threads for vm vm.test
> > vcpu_reset: resetting vcpu 0 for vm 5
> > run_vm: waiting on events for VM vm.test
> > i8259_write_datareg: master pic, reset IRQ vector to 0x20
> > i8259_write_datareg: slave pic, reset IRQ vector to 0x28
> > vcpu_exit_i8253: channel 0 reset, mode=7, start=11932
> > virtio_blk_io: device reset
> > virtio_net_io: device reset
> > vionet queue notify - no space, dropping packet
> > vionet queue notify - no space, dropping packet
> > vionet queue notify - no space, dropping packet
> > vionet queue notify - no space, dropping packet
> > vionet queue notify - no space, dropping packet
> > virtio_net_io: device reset
> >
> >
> > Here's what happens when the installer tries to get a network address:
> >
> > # vmctl status
> >    ID   PID VCPUS  MAXMEM  CURMEM     TTY        OWNER NAME
> >     1     -     1    1.0G       -       -    fstephany vm.test
> > # vmctl start vm.test -c
> > Connected to /dev/ttyp1 (speed 9600)
> >
> > Copyright (c) 1982, 1986, 1989, 1991, 1993
> >     The Regents of the University of California.  All rights reserved.
> > Copyright (c) 1995-2017 OpenBSD. All rights reserved.
> > https://www.OpenBSD.org
> >
> > OpenBSD 6.1-current (RAMDISK_CD) #41: Tue May  2 21:13:30 MDT 2017
> >     [email protected]:/usr/src/sys/arch/amd64/compile/RAMDISK_CD
> > real mem = 1056964608 (1008MB)
> > avail mem = 1021235200 (973MB)
> > mainbus0 at root
> > bios0 at mainbus0
> > acpi at bios0 not configured
> > cpu0 at mainbus0: (uniprocessor)
> > cpu0: Intel(R) Celeron(R) CPU G1610T @ 2.30GHz, 2295.33 MHz
> > cpu0:
> > FPU,VME,DE,PSE,MSR,PAE,MCE,CX8,SEP,PGE,MCA,CMOV,PSE36,
> CFLUSH,MMX,FXSR,SSE,SSE2,SSE3,PCLMUL,SSSE3,CX16,SSE4.1,SSE4.
> 2,POPCNT,XSAVE,HV,NXE,LONG,LAHF,FSGSBASE,SMEP,ERMS
> > cpu0: 256KB 64b/line 8-way L2 cache
> > pvbus0 at mainbus0: OpenBSD
> > pci0 at mainbus0 bus 0
> > pchb0 at pci0 dev 0 function 0 "OpenBSD VMM Host" rev 0x00
> > virtio0 at pci0 dev 1 function 0 "Qumranet Virtio RNG" rev 0x00
> > viornd0 at virtio0
> > virtio0: irq 3
> > virtio1 at pci0 dev 2 function 0 "Qumranet Virtio Storage" rev 0x00
> > vioblk0 at virtio1
> > scsibus0 at vioblk0: 2 targets
> > sd0 at scsibus0 targ 0 lun 0: <VirtIO, Block Device, > SCSI3 0/direct
> > fixed
> > sd0: 4096MB, 512 bytes/sector, 8388608 sectors
> > virtio1: irq 5
> > virtio2 at pci0 dev 3 function 0 "Qumranet Virtio Network" rev 0x00
> > vio0 at virtio2: address fe:e1:bb:d1:6d:23
> > virtio2: irq 7
> > virtio3 at pci0 dev 4 function 0 "OpenBSD VMM Control" rev 0x00
> > virtio3: no matching child driver; not configured
> > isa0 at mainbus0
> > com0 at isa0 port 0x3f8/8 irq 4: ns8250, no fifo
> > com0: console
> > softraid0 at root
> > scsibus1 at softraid0: 256 targets
> > root on rd0a swap on rd0b dump on rd0b
> >
> > erase ^?, werase ^W, kill ^U, intr ^C, status ^T
> >
> > Welcome to the OpenBSD/amd64 6.1 installation program.
> > (I)nstall, (U)pgrade, (A)utoinstall or (S)hell? I
> > At any prompt except password prompts you can escape to a shell by
> > typing '!'. Default answers are shown in []'s and are selected by
> > pressing RETURN.  You can exit this program at any time by pressing
> > Control-C, but this can leave your system in an inconsistent state.
> >
> > Terminal type? [vt220]
> > System hostname? (short form, e.g. 'foo') vmtest
> >
> > Available network interfaces are: vio0 vlan0.
> > Which network interface do you wish to configure? (or 'done') [vio0]
> > IPv4 address for vio0? (or 'dhcp' or 'none') [dhcp]
> > DHCPDISCOVER on vio0 - interval 1
> > DHCPDISCOVER on vio0 - interval 2
> > DHCPDISCOVER on vio0 - interval 2
> > DHCPDISCOVER on vio0 - interval 2
> > DHCPDISCOVER on vio0 - interval 2
> > DHCPDISCOVER on vio0 - interval 2
> > No acceptable DHCPOFFERS received.
> > No working leases in persistent database - sleeping.
> > IPv6 address for vio0? (or 'autoconf' or 'none') [none]
> >
> >
> > Here's ifconfig when the VM is running. The bridge is there with bge0 and
> > tap0:
> >
> > # ifconfig
> > lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
> >         index 4 priority 0 llprio 3
> >         groups: lo
> >         inet6 ::1 prefixlen 128
> >         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
> >         inet 127.0.0.1 netmask 0xff000000
> > bge0: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,
> SIMPLEX,MULTICAST>
> > mtu 1500
> >         lladdr 00:fd:45:fc:00:fc
> >         index 1 priority 0 llprio 3
> >         groups: egress
> >         media: Ethernet autoselect (1000baseT
> full-duplex,rxpause,txpause)
> >         status: active
> >         inet 192.168.0.9 netmask 0xffffff00 broadcast 192.168.0.255
> > bge1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
> >         lladdr 00:fd:45:fc:00:fd
> >         index 2 priority 0 llprio 3
> >         media: Ethernet autoselect (none)
> >         status: no carrier
> > enc0: flags=0<>
> >         index 3 priority 0 llprio 3
> >         groups: enc
> >         status: active
> > pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33136
> >         index 5 priority 0 llprio 3
> >         groups: pflog
> > bridge0: flags=41<UP,RUNNING>
> >         description: switch1-vms_switch
> >         index 6 llprio 3
> >         groups: bridge
> >         priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto
> > rstp
> >         bge0 flags=3<LEARNING,DISCOVER>
> >                 port 1 ifpriority 0 ifcost 0
> >         tap0 flags=3<LEARNING,DISCOVER>
> >                 port 13 ifpriority 0 ifcost 0
> > tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu
> 1500
> >         lladdr fe:e1:ba:d6:54:17
> >         description: vm1-if0-vm.test
> >         index 13 priority 0 llprio 3
> >         groups: tap
> >         status: active
> >
> >
> > Any idea of  what I'm doing wrong?
> > Thanks!
> >
>
> I ran into this as well.  My theory is that because you have dhclient
> listening on the real interface, it's intercepting the responses before
> they go to the bridge and to the VM.
>
> I haven't had the time to test this theory.  Can you get a static IP for
> the host interface?
>
>

Reply via email to