# [solved] Libvirt/Qemu with macvtap - wrong network via dhcp

## musv

Hi there, 

I'm running a NAS with Gentoo. Installed on that thing is a dhcp server. Works fine so far. 

```

authoritative;

allow booting;

allow bootp;

option domain-name "localnet.loc";

option domain-search "localnet.loc";

option domain-name-servers 192.168.109.11, 192.168.109.1;

option routers 192.168.109.1;

option subnet-mask 255.255.255.0;

option broadcast-address 192.168.109.255;

option ntp-servers 192.168.109.1;

option architecture code 93 = unsigned integer 16;

default-lease-time 604800;

max-lease-time 1209600;

ddns-update-style none;

subnet 192.168.109.0 netmask 255.255.255.0 {

    range 192.168.109.50 192.168.109.79; 

}

# TFTP-Server

group {

    #next-server 192.168.109.11;

    next-server nas.blechnet.de;

    if option architecture = 00:07 {

        filename "/tftproot/syslinux.efi";

    } else {

        filename "/tftproot/pxelinux.0";

    }

}

host …
```

192.168.109.1 is my router (Fritzbox) with DHCP deaktivated

192.168.109.11 is my NAS with DHCP and DNS

192.168.109.20 is the fixed assigned IP to my desktop computer.

Now I wanted start a virtual machine (libvirt/Qemu) in bridged mode (macvtap). And here starts something, which I don't understand. 

```
Dez 01 23:55:51 nas dhcpd[21613]: DHCPNAK on 192.168.2.100 to 52:54:00:d6:09:32 via eth0

Dez 01 23:55:52 nas dhcpd[21613]: DHCPOFFER on 192.168.109.66 to 52:54:00:d6:09:32 via eth0
```

That means: The VM wants to assign for some unknown reason the IP 192.168.2.100, but my DHCP server denies. Instead it offers 192.168.109.66. 

Nevertheless inside the virtual machine I get access to the world outside (ping google). But I don't get any ping to the other machines inside my home network. 

```
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 52:54:00:d6:09:32 brd ff:ff:ff:ff:ff:ff

    inet 192.168.2.100/24 brd 192.168.2.255 scope global dynamic eth0
```

Where is the VM getting its strange IP (192.168.2.100) from? And why isn't it accepting an IP from my DHCP server?Last edited by musv on Fri Dec 02, 2016 10:47 pm; edited 1 time in total

----------

## musv

Found the solution. I'm using a powerline network connection. And my neighbor in the same building seems to have a powerline connection too. So I got a dhcp response from his router.

----------

