# Solved: Can't set DHCP Hostname behind a bridge network...

## StifflerStealth

Hi all,

I have a bridge network set up because I want to share my network card with between my host and guest OSes. I am using qemu/kvm/libvirt for the guests. A bridge was supposed to be easier as the host can ping the guests machines and talk to each other without resulting in some hacks. I used the following guide to set up the bridge:

http://ask.xmodulo.com/configure-linux-bridge-network-manager-ubuntu.html

Both the host and the guest are able to obtain IP address. From the Linux machine I can ping the guests using their hostnames, however the guests are not able to ping the host by hostname -- only the IP address. When I look at the router's DHCP table, the host is listed as unknown_{mac address}. I even edited the /etc/dhcp/dhclient.conf file to include send host-name "{my hostname}".

The connection between host and guest is also unstable. I set up samba to share files between all the guests and hosts. The only way to connect to the host is to use \\{IP of host} instead of the hostname. Then when transferring would start, the speed would be like a sine wave going between 0 and 150m/s constantly. Sometimes it would drop altogether and the guest would no long see the samba server of the host at all.

Would switching to Open vSwitch be a better solution? I only have two guests OSes.

Thanks.

----------

## szatox

How to bridge the host and guest to let them share a single NIC:

1) create the bridge (br0)

2) create tap device (tap0)

3) remove IP from NIC (eth0)

4) enslave tap0 and eth0 with br0

5) bind the guest to tap0

6) bind the host network to br0

7) leave eth0 up but not configured

The order of the above steps is irrelevant save for the part when you create interfaces. Obviously you must do that before you configure them.

----------

## StifflerStealth

@szatox Thanks for the reply. I did make the bridge and the guest network in that order, just used NetworkManager.

I did solve the issue, but in a way most will not expect... I used systemd-networkd.

Here are the configs if anyone is interested:

```
[NetDev]

Name=br0

Kind=bridge

```

```
[Match]

Name=eno1

[Network]

Bridge=Br0

```

```
[Match]

Name=br0

[Network]

DHCP=ipv4

```

The computer name is registered in the DHCP table. I can the guest using host name and the guest can ping the host using the host name. Samba is also more stable as well.

Strange...

Jon

----------

