RHEL6

Why Your KVM Network Bridge Isn't Working

You're trying to get libvirt and KVM working on Red Hat Enterprise Linux 6 or CentOS 6, or maybe even Scientific Linux 6. But it's not going well.

You wanted your VMs to have full access to the network and you've discovered that virbr0 doesn't do that. Finally you stumbled upon the way to do it by Creating a Network Bridge using your primary interface. And yet, something just ain't right.

You've verified that bridge-utils is in fact present:

# rpm -q bridge-utils
bridge-utils-1.2-9.el6.x86_64

Telltale signs are this message during network startup:

Device bridge0 does not seem to be present, delaying initialization.

And the following entries in /var/log/messages:

/sys/devices/virtual/net/bridge0: couldn't determine device driver; ignoring...

and

ifcfg-rh: parsing /etc/sysconfig/network-scripts/ifcfg-bridge0 ...
NetworkManager[1802]: ifcfg-rh: error: Bridge connections are not yet supported

You've stared at your /etc/sysconfig/network-scripts/ifcfg-bridge0 file until your eyes hurt, yet nothing seems to be wrong:

DEVICE="bridge0"
TYPE="bridge"
BOOTPROTO="none"
ONBOOT="yes"
IPADDR="203.0.113.2"
NETMASK="255.255.255.0"
DELAY=0
GATEWAY="203.0.113.254"
DNS1="x.x.x.x"

I'm here to tell you: you forgot to capitalize the word Bridge in your TYPE entry.

DEVICE="bridge0"
TYPE="Bridge"
BOOTPROTO="none"
ONBOOT="yes"
IPADDR="203.0.113.2"
NETMASK="255.255.255.0"
DELAY=0
GATEWAY="203.0.113.254"
DNS1="x.x.x.x"

Have a nice day!

Topic: 

Solved: Renaming em1 to eth0 on Red Hat Enterprise Linux 6

We had a software package that had a braindead licensing scheme. To generate the license, it uses the MAC address of the network interface card of the machine you are running it on. OK, that's a way of identifying a unique machine. But here's the kicker. It just assumes that your ethernet device is /dev/eth0.

For a while now, NICs that are embedded on the motherboard are identified by udev as em1, em2, etc. This is part of an attempt to make interface naming more predictable and meaningful.

So, how to get em1 renamed to eth0? Here's what worked for me. I should emphasize that I had access to the console, so when ethernet was down I could still access the box.

0. I've been burned enough times to do this out of habit: make a backup of /etc/grub.conf, retaining SELinux info:

# cp --preserve=context /etc/grub.conf /etc/grub.bak

1. Add biosdevname=0 to the kernel boot arguments in /etc/grub.conf.

2. Rename /etc/sysconfig/network-scripts/ifcfg-em1 to /etc/sysconfig/network-scripts/ifcfg-eth0, changing the line

DEVICE="em1"

to

DEVICE="eth0"

3. Delete /etc/udev/rules.d/70-persistent-net.rules

4. Reboot.

Presto, I get eth0 for the former em1 and the rest of the NICs on this Dell R715 are still em2, em3, em4.

Reference:

How to Still Use ethX on Fedora 15
Consistent Network Device Naming
Nicnaming - Solving it with Biosdevname

Topic: 

Solution to Invalid command 'PubcookieAppID'

When setting up Pubcookie, you may encounter an "Internal Server Error" in your browser and the following error in /var/log/httpd/ssl_error_log (or wherever you're keeping your SSL error log):

[alert] [client] /var/www/html/foo/bar/baz/.htaccess: Invalid command 'PubcookieAppID', perhaps misspelled or defined by a module not included in the server configuration

This might be a headscratcher for a while, since you've probably been working hard to make sure that your Pubcookie configuration is nice and tidy and your .htaccess file is set up with PubcookieAppID, like this:

AuthType NetID
PubcookieAppID fribble
require valid-user

In fact, Apache is telling you exactly what you need to know: it can't make sense of the PubcookieAppID directive because the module that interprets that directive is not loading and thus is "not included in the server configuration."

To solve this, make sure that a line like this is actually somewhere in your configuration, normally somewhere like /etc/httpd/conf.d/pubcookie.conf:

LoadModule pubcookie_module modules/mod_pubcookie.so

In my case, I had commented it out while getting SSL to work. Duh.

Installing rpy and rpy2 on RHEL6

I wanted to install rpy and rpy2 on Red Hat Enterprise Linux 6. Here's how I did it. There have been several fixes in the rpy SVN repository that have not shown up in the version downloadable from SourceForge. Hopefully that's been fixed by now, but here's how I installed it by retrieving rpy directly from the repository.

First I made sure that the python-devel package was installed to avoid the error src/RPy.h:63:20: error: Python.h: No such file or directory:

yum install python-devel

Then I installed R and R-devel from EPEL:

rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
yum install R R-devel

Then I downloaded rpy and extracted it:

curl http://rpy.svn.sourceforge.net/viewvc/rpy/trunk/rpy/?view=tar > rpy.tar.gz
tar xvzf rpy.tar.gz
cd rpy
python setup.py install

Lo and behold, it imports without error:

python -c "import rpy"

Yay!

Besides R and R-devel, rpy2 requires that the readline-devel package be installed, otherwise installation fails with ./rpy/rinterface/_rinterface.c:79:31: error: readline/readline.h: No such file or directory.

yum install readline-devel

After that, rpy2 installs easily:

curl http://pypi.python.org/packages/source/r/rpy2/rpy2-2.2.0.tar.gz#md5=a42a7f1e6ddb10dc3a1886c2f4309fab > rpy2-2.2.0.tar.gz
tar xvzf rpy2-2.2.0.tar.gz
cd rpy2-2.2.0
python setup.py install

Pages

Subscribe to RSS - RHEL6