[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Debian whezzy & Xen 4.1 & IPv6


  • To: Ian Campbell <ian.campbell@xxxxxxxxxx>
  • From: Ronny Wagner <r.wagner@xxxxxxxxx>
  • Date: Wed, 10 Jul 2013 05:56:50 +0000
  • Accept-language: de-DE, en-US
  • Cc: "Xen-users@xxxxxxxxxxxxx" <Xen-users@xxxxxxxxxxxxx>
  • Delivery-date: Wed, 10 Jul 2013 05:58:29 +0000
  • Domainkey-signature: a=rsa-sha1; c=simple; d=licoho.de; h=from:to:cc :subject:date:message-id:references:in-reply-to:content-type :mime-version; q=dns; s=dkim; b=kZf4EqPbm+8giztbS1mIVEpyu0EjRDLi PMI7P35bODaT6lONYSEU7fVHCZpLbv1XZtIqAG1dQlPG+aBuBHclHNfxeqDC6GM7 n+fVSrFR2ypWPss5JLSOZL2VHVIS9Rhd9qZUaDENQAe8bWFBPJXRNTft7LUJuW+p fGGWXrYkTcw=
  • List-id: Xen user discussion <xen-users.lists.xen.org>
  • Thread-index: Ac58hf2ghmO1+NzvRWunZ3zsi36oHAAAEXcAAATArZAABXzigAAf/xHA
  • Thread-topic: [Xen-users] Debian whezzy & Xen 4.1 & IPv6

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Ian,

here is the config file "vif-route":
#!/bin/bash
# Read from the store:
# ip      list of IP networks for the vif, space-separated (default given in
#         this script). IPv6 should also work.
#============================================================================

exec 1>>/tmp/vif-route.log;
exec 2>&1
echo "$0 $@ at `date`"
set -x 

dir=$(dirname "$0")
. "$dir/vif-common.sh"

ip6_of()
{
        ip -6 addr show "$1" | perl -wane '/scope global/ && /inet6 
(([0-9a-f]+:*)+)/ && print $1;'
}

dom0_ip6()
{
  local nd=${netdev:-eth0}
  local result=$(ip6_of "$nd")
  if [ -z "$result" ]
  then
        ""
  else
        echo "$result"
  fi
}

is_ipv6()
{
        echo "$1" | perl -wane '/:/ && print "yes"'
}

main_ip=$(dom0_ip)
main_ip6=$(dom0_ip6)


case "$command" in
    online)
        log info "[vif-route] online request, ip ${ip} with main_ip ${main_ip} 
and main_ip6 ${main_ip6} for $vif."
        ifconfig ${vif} ${main_ip} netmask 255.255.255.255 up
        if [ ! -z "${main_ip6}" ]; then
                ip -6 addr add ${main_ip6} dev ${vif}
                echo 1 >/proc/sys/net/ipv6/conf/${vif}/proxy_ndp

        fi
        echo 1 >/proc/sys/net/ipv4/conf/${vif}/proxy_arp
        ipcmd='add'
        cmdprefix=''
        ;;
    offline)
        do_without_error ifdown ${vif}
        ipcmd='del'
        cmdprefix='do_without_error'
        ;;
esac

if [ "${ip}" ] ; then
    # If we've been given a list of IP addresses, then add routes from dom0 to
    # the guest using those addresses.
    for addr in ${ip} ; do
        result=$(is_ipv6 "${addr}")
        if [ -z "${result}" ] ; then
                log info "[vif-route] Adding IPv4 address ${addr} with src 
${main_ip} for $vif."
              result=`${cmdprefix} ip route ${ipcmd} ${addr} dev ${vif} src 
${main_ip} 2>&1`
                log info "[vif-route] Result: ${result}"
        else
                log info "[vif-route] Adding IPv6 address ${addr} with src 
${main_ip6} for $vif."
              result=`${cmdprefix} ip -6 route ${ipcmd} ${addr} dev ${vif} src 
${main_ip6} 2>&1`
                log info "[vif-route] Result: ${result}"

                 log info "[vif-route] Adding IPv6 proxy ${addr} on 
${netdev:-eth0}."
              result=`${cmdprefix} ip -6 neighbor ${ipcmd} proxy ${addr} dev 
${netdev:-eth0} 2>&1`
                 log info "[vif-route] Result: ${result}"

        fi
    done 
fi

handle_iptable

log debug "Successful vif-route $command for $vif."
if [ "$command" = "online" ]
then
  success
fi

And when I understand you correct, you need the output from the log file 
/var/log/xen/xen-hotplug.log:

+++ export 
PATH=/usr/bin:/usr/sbin:/usr/lib/xen-/bin:/usr/lib/xen-/bin:/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+++ 
PATH=/usr/bin:/usr/sbin:/usr/lib/xen-/bin:/usr/lib/xen-/bin:/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+++ export LANG=POSIX
+++ LANG=POSIX
++++ set
++++ grep '^LC_'
++++ cut -d= -f1
+++ unset
+++ trap sigerr ERR
+++ log debug netdev=eth0 online type_if=vif XENBUS_PATH=backend/vif/13/0
+++ local level=debug
+++ shift
+++ logger -p daemon.debug -- /etc/xen/scripts/vif-route: netdev=eth0 online 
type_if=vif XENBUS_PATH=backend/vif/13/0
++ . /etc/xen/scripts/xen-network-common.sh
+++ which ifup
++ findCommand netdev=eth0 online type_if=vif
++ for arg in '"$@"'
++ expr index netdev=eth0 =
++ for arg in '"$@"'
++ expr index online =
++ command=online
++ return
++ '[' online '!=' online ']'
++ evalVariables netdev=eth0 online type_if=vif
++ for arg in '"$@"'
++ expr index netdev=eth0 = '>' 1
++ eval netdev=eth0
+++ netdev=eth0
++ for arg in '"$@"'
++ expr index online = '>' 1
++ for arg in '"$@"'
++ expr index type_if=vif = '>' 1
++ eval type_if=vif
+++ type_if=vif
++ : vif
++ case "$type_if" in
++ dev=vif13.0
++ case "$command" in
++ test vif '!=' vif
++ '[' vif = vif ']'
++ XENBUS_PATH=backend/vif/13/0
++ dev=vif13.0
+++ xenstore_read_default backend/vif/13/0/vifname ''
+++ xenstore-read backend/vif/13/0/vifname
++ vifname=nagios1
++ '[' nagios1 ']'
++ '[' online == online ']'
++ ip link show nagios1
++ do_or_die ip link set vif13.0 name nagios1
++ ip link set vif13.0 name nagios1
++ dev=nagios1
++ ip=
+++ xenstore_read_default backend/vif/13/0/ip ''
+++ xenstore-read backend/vif/13/0/ip
++ ip='x.x.x.x x:x:x:x::11'
++ dom0_ip
++ local nd=eth0
+++ ip_of eth0
+++ sed -n '1 s,/.*,,p'
+++ awk '/^.*inet.*eth0$/{print $2}'
+++ ip addr show eth0
++ local result=
++ '[' -z '' ']'
++ fatal
++ _xenstore_write backend/vif/13/0/hotplug-error '' 
backend/vif/13/0/hotplug-status error
++ log debug 'Writing backend/vif/13/0/hotplug-error' '' 
backend/vif/13/0/hotplug-status 'error to xenstore.'
++ local level=debug
++ shift
++ logger -p daemon.debug -- /etc/xen/scripts/vif-route: 'Writing 
backend/vif/13/0/hotplug-error' '' backend/vif/13/0/hotplug-status 'error to 
xenstore.'
++ xenstore-write backend/vif/13/0/hotplug-error '' 
backend/vif/13/0/hotplug-status error
++ log err
++ local level=err
++ shift
++ logger -p daemon.err -- /etc/xen/scripts/vif-route:
++ exit 1
+ main_ip=
++ sigerr
++ fatal '/etc/xen/scripts/vif-route failed; error detected.'
++ _xenstore_write backend/vif/13/0/hotplug-error '/etc/xen/scripts/vif-route 
failed; error detected.' backend/vif/13/0/hotplug-status error
++ log debug 'Writing backend/vif/13/0/hotplug-error' 
'/etc/xen/scripts/vif-route failed; error detected.' 
backend/vif/13/0/hotplug-status 'error to xenstore.'
++ local level=debug
++ shift
++ logger -p daemon.debug -- /etc/xen/scripts/vif-route: 'Writing 
backend/vif/13/0/hotplug-error' '/etc/xen/scripts/vif-route failed; error 
detected.' backend/vif/13/0/hotplug-status 'error to xenstore.'
++ xenstore-write backend/vif/13/0/hotplug-error '/etc/xen/scripts/vif-route 
failed; error detected.' backend/vif/13/0/hotplug-status error
++ log err '/etc/xen/scripts/vif-route failed; error detected.'
++ local level=err
++ shift
++ logger -p daemon.err -- /etc/xen/scripts/vif-route: 
'/etc/xen/scripts/vif-route failed; error detected.'
++ exit 1
+++ export 
PATH=/usr/bin:/usr/sbin:/usr/lib/xen-/bin:/usr/lib/xen-/bin:/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+++ 
PATH=/usr/bin:/usr/sbin:/usr/lib/xen-/bin:/usr/lib/xen-/bin:/sbin:/bin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+++ export LANG=POSIX
+++ LANG=POSIX
++++ set
++++ cut -d= -f1
++++ grep '^LC_'
+++ unset
+++ trap sigerr ERR
+++ log debug netdev=eth0 offline type_if=vif XENBUS_PATH=backend/vif/13/0
+++ local level=debug
+++ shift
+++ logger -p daemon.debug -- /etc/xen/scripts/vif-route: netdev=eth0 offline 
type_if=vif XENBUS_PATH=backend/vif/13/0
++ . /etc/xen/scripts/xen-network-common.sh
+++ which ifup
++ findCommand netdev=eth0 offline type_if=vif
++ for arg in '"$@"'
++ expr index netdev=eth0 =
++ for arg in '"$@"'
++ expr index offline =
++ command=offline
++ return
++ '[' offline '!=' online ']'
++ '[' offline '!=' offline ']'
++ evalVariables netdev=eth0 offline type_if=vif
++ for arg in '"$@"'
++ expr index netdev=eth0 = '>' 1
++ eval netdev=eth0
+++ netdev=eth0
++ for arg in '"$@"'
++ expr index offline = '>' 1
++ for arg in '"$@"'
++ expr index type_if=vif = '>' 1
++ eval type_if=vif
+++ type_if=vif
++ : vif
++ case "$type_if" in
++ dev=nagios1
++ case "$command" in
++ test vif '!=' vif
++ '[' vif = vif ']'
++ XENBUS_PATH=backend/vif/13/0
++ dev=nagios1
+++ xenstore_read_default backend/vif/13/0/vifname ''
+++ xenstore-read backend/vif/13/0/vifname
++ vifname=nagios1
++ '[' nagios1 ']'
++ '[' offline == online ']'
++ dev=nagios1
++ ip=
+++ xenstore_read_default backend/vif/13/0/ip ''
+++ xenstore-read backend/vif/13/0/ip
++ ip='x.x.x.x x:x:x:x::11'
++ dom0_ip
++ local nd=eth0
+++ ip_of eth0
+++ ip addr show eth0
+++ awk '/^.*inet.*eth0$/{print $2}'
+++ sed -n '1 s,/.*,,p'
++ local result=
++ '[' -z '' ']'
++ fatal
++ _xenstore_write backend/vif/13/0/hotplug-error '' 
backend/vif/13/0/hotplug-status error
++ log debug 'Writing backend/vif/13/0/hotplug-error' '' 
backend/vif/13/0/hotplug-status 'error to xenstore.'
++ local level=debug
++ shift
++ logger -p daemon.debug -- /etc/xen/scripts/vif-route: 'Writing 
backend/vif/13/0/hotplug-error' '' backend/vif/13/0/hotplug-status 'error to 
xenstore.'
++ xenstore-write backend/vif/13/0/hotplug-error '' 
backend/vif/13/0/hotplug-status error
++ log err
++ local level=err
++ shift
++ logger -p daemon.err -- /etc/xen/scripts/vif-route:
++ exit 1
+ main_ip=
++ sigerr
++ fatal '/etc/xen/scripts/vif-route failed; error detected.'
++ _xenstore_write backend/vif/13/0/hotplug-error '/etc/xen/scripts/vif-route 
failed; error detected.' backend/vif/13/0/hotplug-status error
++ log debug 'Writing backend/vif/13/0/hotplug-error' 
'/etc/xen/scripts/vif-route failed; error detected.' 
backend/vif/13/0/hotplug-status 'error to xenstore.'
++ local level=debug
++ shift
++ logger -p daemon.debug -- /etc/xen/scripts/vif-route: 'Writing 
backend/vif/13/0/hotplug-error' '/etc/xen/scripts/vif-route failed; error 
detected.' backend/vif/13/0/hotplug-status 'error to xenstore.'
++ xenstore-write backend/vif/13/0/hotplug-error '/etc/xen/scripts/vif-route 
failed; error detected.' backend/vif/13/0/hotplug-status error
++ log err '/etc/xen/scripts/vif-route failed; error detected.'
++ local level=err
++ shift
++ logger -p daemon.err -- /etc/xen/scripts/vif-route: 
'/etc/xen/scripts/vif-route failed; error detected.'
++ exit 1

What do you think?

Thank you
Ronny

- -----UrsprÃngliche Nachricht-----
Von: Ian Campbell [mailto:ian.campbell@xxxxxxxxxx] 
Gesendet: Dienstag, 9. Juli 2013 18:19
An: Ronny Wagner
Cc: Xen-users@xxxxxxxxxxxxx
Betreff: Re: [Xen-users] Debian whezzy & Xen 4.1 & IPv6

On Tue, 2013-07-09 at 11:48 +0000, Ronny Wagner wrote:
> Hi Ian,
> 
> Thank you for your help. I replace the "vif-route" script with the entry on 
> the website and add the debug entry too. Here is the output.
> Debug-Log:
> ++ dirname /etc/xen/scripts/vif-route
> + dir=/etc/xen/scripts
> + . /etc/xen/scripts/vif-common.sh
> +++ dirname /etc/xen/scripts/vif-route
> ++ dir=/etc/xen/scripts
> ++ . /etc/xen/scripts/xen-hotplug-common.sh
> ++++ dirname /etc/xen/scripts/vif-route
> +++ dir=/etc/xen/scripts
> +++ . /etc/xen/scripts/hotplugpath.sh
> ++++ SBINDIR=/usr/sbin
> ++++ BINDIR=/usr/bin
> ++++ LIBEXEC=/usr/lib/xen-/bin
> ++++ LIBDIR=/usr/lib
> ++++ SHAREDIR=/usr/share
> ++++ PRIVATE_BINDIR=/usr/lib/xen-/bin
> ++++ XENFIRMWAREDIR=/usr/lib/xen-/boot
> ++++ XEN_CONFIG_DIR=/etc/xen
> ++++ XEN_SCRIPT_DIR=/etc/xen/scripts
> ++++ XEN_LOCK_DIR=/var/lock
> +++ . /etc/xen/scripts/logging.sh
> +++ . /etc/xen/scripts/xen-script-common.sh
> ++++ set -e
> +++ . /etc/xen/scripts/locking.sh
> ++++ LOCK_SLEEPTIME=1
> ++++ LOCK_SPINNING_RETRIES=5
> ++++ LOCK_RETRIES=100
> ++++ LOCK_BASEDIR=/var/run/xen-hotplug
> +++ exec
> ++ dirname /etc/xen/scripts/vif-route
> + dir=/etc/xen/scripts
> + . /etc/xen/scripts/vif-common.sh
> +++ dirname /etc/xen/scripts/vif-route
> ++ dir=/etc/xen/scripts
> ++ . /etc/xen/scripts/xen-hotplug-common.sh
> ++++ dirname /etc/xen/scripts/vif-route
> +++ dir=/etc/xen/scripts
> +++ . /etc/xen/scripts/hotplugpath.sh
> ++++ SBINDIR=/usr/sbin
> ++++ BINDIR=/usr/bin
> ++++ LIBEXEC=/usr/lib/xen-/bin
> ++++ LIBDIR=/usr/lib
> ++++ SHAREDIR=/usr/share
> ++++ PRIVATE_BINDIR=/usr/lib/xen-/bin
> ++++ XENFIRMWAREDIR=/usr/lib/xen-/boot
> ++++ XEN_CONFIG_DIR=/etc/xen
> ++++ XEN_SCRIPT_DIR=/etc/xen/scripts
> ++++ XEN_LOCK_DIR=/var/lock
> +++ . /etc/xen/scripts/logging.sh
> +++ . /etc/xen/scripts/xen-script-common.sh
> ++++ set -e
> +++ . /etc/xen/scripts/locking.sh
> ++++ LOCK_SLEEPTIME=1
> ++++ LOCK_SPINNING_RETRIES=5
> ++++ LOCK_RETRIES=100
> ++++ LOCK_BASEDIR=/var/run/xen-hotplug
> +++ exec
> 
> What do you see here? See you the Problem? I am not.

me neither, but then this log doesn't seem to contain much "meat" i.e.
it doesn't appear like the script is actually doing anything. I expect
it is really and we simply haven't captured the right bits.

You might want to test out my suggested exec runes in a test script,
perhaps I got the syntax wrong.

Or just add your own "echo foo > file" tests to the script to try and
track it down that way.

Ian.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (MingW32)
Comment: Using gpg4o v3.1.32.3098 - http://www.gpg4o.de/
Charset: utf-8

iQGcBAEBAgAGBQJR3PefAAoJEB1lYcD99gJyJ5IMAIKiCEyYMKVzxY1fc8ut0YBr
NH+XAcR1aaOTorubsCaId1/c8O1M7XYXwk8hnWFwB5drhuKav/tGX6oqYjjRbXZG
Hew/dVZd1Ht+JidJvKYpn65hNRWuElfj+Iuduc44kK8b/SdmXG3H6yl8aUVwBCnB
5wYY96U7vPpjWru8kySAOFACKA0YVOFIPwPphDNLtJVBzpk9KHOCaxoL44li0SYR
/uopvYE5igGtTV8IdzVLAbjd62oqmE3RWYZfB2+lhitD0/Wiz9M6fnglUe7Y3A0v
ccDPa2nsSgVNjJ5KsNF/6e9M97N/pgCK2tVO4xQRZgCQYwWbGVNRfh2mfdyIlgFe
n9l5LkIlv1EsJwrHg/EwsVk2Sr+D7UV+wjGUc31dFtzGOVnTgxPoob+Rx4JHSnpg
DnP0szy+9lmnOZCsmZgr+abil+Jk4pusDlhOWrzMo3mSAZ6j+V27LzpPFQda9NUP
NNGgwaHqg6laoBK8LCqXAi2i9qD2cMreGLip7UEY/Q==
=Tw+I
-----END PGP SIGNATURE-----

Attachment: FDF60272.asc
Description: Binary data

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.