Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Solved: Can't set DHCP Hostname behind a bridge network...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
StifflerStealth
l33t
l33t


Joined: 03 Jul 2002
Posts: 968

PostPosted: Wed Feb 17, 2016 9:25 am    Post subject: Solved: Can't set DHCP Hostname behind a bridge network... Reply with quote

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.
_________________
Nothing to read in this sig. Move along.


Last edited by StifflerStealth on Thu Feb 18, 2016 9:50 am; edited 1 time in total
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1762

PostPosted: Wed Feb 17, 2016 6:00 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
StifflerStealth
l33t
l33t


Joined: 03 Jul 2002
Posts: 968

PostPosted: Thu Feb 18, 2016 9:49 am    Post subject: Reply with quote

@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:
/etc/systemd/network/bridge.netdev:
[NetDev]
Name=br0
Kind=bridge

/etc/systemd/network/host.network:
[Match]
Name=eno1

[Network]
Bridge=Br0

/etc/systemd/network/dhcp.network:
[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
_________________
Nothing to read in this sig. Move along.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum