2

I installed Xen a while ago but had not yet booted up with the hypervisor. Well I did yesterday and all hell broke loose. I completely lost internet connectivity on my server because of Xen.

When I start up my server and eth0 is not inside of br0, Xen tries to virtualize it by renaming it to peth0 (physical eth0), and then it's supposed to create a veth0 (virtual eth0) and rename it to eth0, at least according to Xen documentation.

The problem is that it does not bring up an eth0 and I am left with absolutely no internet connectivity. I have an eth1 on my server and would like to virtualize that interface instead of eth0. To do this I placed eth1 inside of br0 and br0 is being virtualized to virbr0. How do I stop Xen from virtualizing eth0 and use br0/eth1 instead?

Here is what I get from systemctl -o cat status network.service:

Bringing up lookback interface:  [  OK  ]
Bringing up interface eth0:  Error: either "dev" is a duplicate, or "virbr0" is a garbage.
ERROR    : [/etc/sysconfig/network-scripts/ifup-eth] Failed to bring up peth0 virbr0.
[FAILED]
Bringing up interface eth1:  [  OK  ]
Bringing up interface br0:  [  OK  ]

Gotta love that grammar on the second line (this is verbatim down to the spacing).

virbr0 is handled directly by libvirt, which can be seen from either of the replies to this message as being configured from /etc/libvirt/qemu/networks.

NobleUplift
  • 165
  • 4
  • 17
  • What is your operating system and which XEN-version are you talking about? The network-stack is something that differs from distribution to distribution and then even has differences between major versions. – Nils Jul 08 '13 at 09:00

2 Answers2

2

The answer is contained in the link you provided: Setting up bridged networking.

Prior to XEN 4.1 ist was XEN`s role to set up network bridging.

After that the corresponding bridges should be set up with OS means.

BUT: If no bridges are defined during XEN-Startup, it will create a default-bridge (comparable to the previous behaviour).

There is a good reason to put this outside of XEN-control, since there are very complex bonding/VLAN-combinations that could not be covered by the default-scripts. Also the network-stack is different from OS to OS.

I had a similar problem with SLES10 SP4 - where I needed a quite complex network-setup.

So I set up my own init-script in /etc/init.d/ to set up bridging/bonding/vlans.

With SLES11 SP2 it was a piece of cake and could by set up with the OS-yast2-command.

With that the bridges are up an running before XEND starts.

Something like this may work for you:

XENBRIDGE=/etc/xen/scripts/network-bridge
$XENBRIDGE bridge=br0 netdev=eth1 start

Fedora should be comparable to RHEL6 - so perhaps you can use a network-setup-document and integrate your bridging configuration into the normal network-setup, instead (which is the better way to do this).

Nils
  • 7,657
  • 3
  • 31
  • 71
  • Wait, so what file would I put those two lines in, and how do I stop Xen from renaming eth0 to peth0? – NobleUplift Jul 10 '13 at 08:39
  • Or better yet, could you provide an example of your init script? – NobleUplift Jul 10 '13 at 09:21
  • @NobleUplift the two lines above are an extract from my init-scripts start-method to fit your needs. Bring down your br0 manually and try it on the command-line. If everything looks well, you could use it. – Nils Jul 10 '13 at 21:30
1

To fix this, I changed these:

(network-script 'network-bridge bridge=virbr0')
(vif-script vif-bridge)

to these:

(network-script 'network-bridge bridge=virbr0 netdev=eth1')
(vif-script     vif-nat)

In /etc/xen/xend-config.sxp, which successfully left eth0 alone and only renames eth1 to peth1 now, and I assume does not bring up a veth1/eth1 because it is inside br0. Then, I renamed ifcfg-em1/ifcfg-em2 to ifcfg-eth0/ifcfg-eth1, and changed:

IPADDR0=xxx.xxx.xxx.xxx
PREFIX0=xx
GATEWAY0=xxx.xxx.xxx.xxx
DNS1=xxx.xxx.xxx.xxx

To:

IPADDR=xxx.xxx.xxx.xxx
PREFIX=xx
GATEWAY=xxx.xxx.xxx.xxx
DNS=xxx.xxx.xxx.xxx

This gave me back my internet and localhost.

You know what the best part of this experience was? I can leave NetworkManager permanently disabled.

NobleUplift
  • 165
  • 4
  • 17