25 June 2008

11:47 PM Server move and upgrade
Recently I moved this web server's services from London to Dallas, which meant building a new installation pretty much from scratch. So instead of being based on a very creaky initial base of Red Hat 7.3, customised and running under UML, it's all now running on CentOS 5 under Xen.

Last night I upgraded the virtual hosts to CentOS 5.2, which went reasonably smoothly, so tonight I went ahead and upgraded the "real" host as well. That didn't go so well. On rebooting, everything came back up, but I couldn't route to any of the virtual hosts any more.

It seems that the updated version of Xen had modified some scripts which meant I ended up with two bridge devices - my old one, virbr0, containing all of my virtual hosts and an alias for the real host, and a new one, xenbr0, containing a renamed version of the raw Ethernet device plus one more interface I've blotted from my memory. For some reason this caused all of the iptables DNAT rules to fail to work. SNAT / masquerading for outbound connections worked fine, but inbound data would only go in; the responses wouldn't go back out.

Anyway, if you are trying to get Xen working again after upgrading and are seeing mysterious DNAT failures, try applying these two patches:

--- /etc/xen/scripts/network-bridge.rpmnew 2008-06-21 23:09:32.000000000 +0100
+++ /etc/xen/scripts/network-bridge 2008-05-20 21:14:32.000000000 +0100
@@ -110,8 +110,7 @@
ip addr show dev ${src} | egrep '^ *inet ' | sed -e "
s/inet/ip addr add/
s@\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+/[0-9]\+\)@\1@
-s/${src}/dev ${dst} label ${dst}/
-s/secondary//
+s/${src}/dev ${dst}/
" | sh -e
# Remove automatic routes on destination device
ip route list | sed -ne "

--- /etc/xen/scripts/xen-network-common.sh.rpmnew 2008-06-21 23:09:32.000000000 +0100
+++ /etc/xen/scripts/xen-network-common.sh 2008-05-20 21:14:32.000000000 +0100
@@ -120,12 +120,7 @@
ip link set ${bridge} arp off
ip link set ${bridge} multicast off
fi
-
- # A small MTU disables IPv6 (and therefore IPv6 addrconf).
- mtu=$(ip link show ${bridge} | sed -n 's/.* mtu \([0-9]\+\).*/\1/p')
- ip link set ${bridge} mtu 68
ip link set ${bridge} up
- ip link set ${bridge} mtu ${mtu:-1500}
}

# Usage: add_to_bridge bridge dev

I've not looked into why it works; the above is just a reversion to the scripts as they were before upgrading to xen-3.0.3-64.el5_2.1, and it works for me, so I'm happy.

Labels:

0 Comments:

Post a Comment

<< Main index