You are not logged in.

#1 2016-02-07 22:12:11

folatt
Member
Registered: 2015-08-01
Posts: 96

[Solved] Help needed for configuring network bridge using Xen.

I Followed this tutorial -> https://wiki.archlinux.org/index.php/Xen

The network bridge part was kind of vague, so I tried doing this:

ip link add name xenbr0 type bridge
ip link set dev xenbr0 up
ip link set dev enp3s0 promisc on
ip link set dev enp3s0 up
ip link set dev enp3s0 master xenbr0

Resulting into this `ip addr` output:

: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc fq_codel master xenbr0 state UP group $
    link/ether d0:50:99:8f:1e:31 brd ff:ff:ff:ff:ff:ff
    inet 192.168.178.112/24 brd 192.168.178.255 scope global enp3s0
       valid_lft forever preferred_lft forever
    inet6 2001:983:8610:1:31e2:78bb:7efd:4b4d/64 scope global mngtmpaddr noprefixroute dynamic
       valid_lft 3712sec preferred_lft 1943sec
    inet6 fe80::ebb8:6b64:34bf:49de/64 scope link
       valid_lft forever preferred_lft forever
3: xenbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether d0:50:99:8f:1e:31 brd ff:ff:ff:ff:ff:ff
    inet6 2001:983:8610:1:d250:99ff:fe8f:1e31/64 scope global mngtmpaddr dynamic
       valid_lft 3714sec preferred_lft 3512sec
    inet6 fe80::a426:3fff:fe2b:47f2/64 scope link
       valid_lft forever preferred_lft forever
4: vif2.0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master xenbr0 state UP group default $
    link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fcff:ffff:feff:ffff/64 scope link
       valid_lft forever preferred_lft forever

After chatting on the #xen channel, I'm told that my network bridge is probably wrongly configured
and that the correct result should have the `inet 192.168.178.112/24` line in the xenbr0 section.

Is this correct?

P.S.  I have to type those `ip link` commands on every boot, is there a way to turn this into a service?

Last edited by folatt (2016-02-13 16:29:35)

Offline

#2 2016-02-08 02:18:10

branch
Member
Registered: 2014-03-16
Posts: 209

Re: [Solved] Help needed for configuring network bridge using Xen.

Yes, you were told correctly. Whatever is configuring an IPv4 address on enp3s0 should be changed to configure xenbr0 instead. Also router advertisements should not be accepted on enp3s0 to prevent the global IPv6 address from being configured on this interface. All addresses should be assigned to the bridge, not the physical interface.

As for configuration on boot, you can either have your network configuration tool set up the bridge for you (i believe both netctl and systemd-networkd are capable of this, maybe others also), or you can simply write a systemd service file containing the commands to configure the bridge. If you write a service file you will need to use BindsTo=sys-subsystem-net-devices-enp3s0 in the [Unit] section to make sure the interface is available before the service starts. You may also need to make the service file sleep for about 30 seconds after upping the bridge so that it enters the forwarding state before anything that depends on it is started (turning of STP for the bridge in sysctl will reduce the necessary sleep).

Offline

#3 2016-02-08 04:10:57

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved] Help needed for configuring network bridge using Xen.

For netctl, there is an example profile /etc/netctl/examples/bridge


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#4 2016-02-08 09:47:14

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [Solved] Help needed for configuring network bridge using Xen.

@folatt,

Please change the thread title to something more descriptive like "Help needed for configuring network bridge using Xen".

Offline

#5 2016-02-10 13:03:29

folatt
Member
Registered: 2015-08-01
Posts: 96

Re: [Solved] Help needed for configuring network bridge using Xen.

Following this wiki part:

https://wiki.archlinux.org/index.php/Sy … _interface

I made the this:

/etc/systemd/network/xenbr0.netdev
---------------------------------------------------
[NetDev]
Name=xenbr0
Kind=bridge
/etc/systemd/network/eth.network
---------------------------------------------------
[Match]
Name=en*

[Network]
Bridge=xenbr0
/etc/systemd/network/xenbr0.network
---------------------------------------------------
[Match]
Name=xenbr0

[Network]
DHCP=ipv4

And got this result:

$ ip addr
---------------------------------------------------
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master xenbr0 state UP group default qlen 1000
    link/ether d0:50:99:8f:1e:31 brd ff:ff:ff:ff:ff:ff
    inet6 2001:983:8610:1:d250:99ff:fe8f:1e31/64 scope global noprefixroute dynamic 
       valid_lft 4235sec preferred_lft 3157sec
    inet6 fe80::ebb8:6b64:34bf:49de/64 scope link 
       valid_lft forever preferred_lft forever
4: xenbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether d0:50:99:8f:1e:31 brd ff:ff:ff:ff:ff:ff
    inet 192.168.178.113/24 brd 192.168.178.255 scope global dynamic xenbr0
       valid_lft 862096sec preferred_lft 862096sec
    inet6 2001:983:8610:1:d250:99ff:fe8f:1e31/64 scope global noprefixroute dynamic 
       valid_lft 4235sec preferred_lft 3157sec
    inet6 2001:983:8610:1:6424:4bff:feb3:ea82/64 scope global noprefixroute dynamic 
       valid_lft 4236sec preferred_lft 1695sec
    inet6 fe80::6424:4bff:feb3:ea82/64 scope link 
       valid_lft forever preferred_lft forever
5: vif2.0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master xenbr0 state UP group default qlen 32
    link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fcff:ffff:feff:ffff/64 scope link 
       valid_lft forever preferred_lft forever

And I can log in to both Dom0 and DomU now smile

If I can figure out what branch means by this:

branch wrote:

"Also router advertisements should not be accepted on enp3s0 to prevent the global IPv6 address from being configured on this interface."

Then I will consider this thread as solved.

Offline

#6 2016-02-11 16:06:06

branch
Member
Registered: 2014-03-16
Posts: 209

Re: [Solved] Help needed for configuring network bridge using Xen.

folatt wrote:

If I can figure out what branch means by this:

Now we know you are configuring the ports with systemd.networkd I can be more specific. Setting

IPv6AcceptRouterAdvertisements=false

in the [Network] section of /etc/systemd/network/eth.network will prevent the global IPv6 addresses from being assigned to enp3s0, fixing the configuration for IPv6.

Offline

Board footer

Powered by FluxBB