Changeset 95


Ignore:
Timestamp:
Aug 26, 2007, 6:58:22 PM (17 years ago)
Author:
hartmans
svk:copy_cache_prev:
93
Message:
  • Add qemu-ifup script that depends on the device model script and invokes vif-sipbroute. As a consequence, we don't really support bridged hvms any more. It's not clear how to get enough information out of qemu to do this.
  • Call arpspoof with 18.181.0.1's address. This is unfortunate in two ways. First, if we renumber we'll need to update the script. Second, it is possible that someone on 18.181 besides the router may have an address cached. Unfortunately, it doesn't work right if we don't send the spoofed arp directly to the router.
Location:
trunk/packages/sipb-xen-dom0/sipb-xen-dom0
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-dom0/sipb-xen-dom0/debian/changelog

    r89 r95  
     1sipb-xen-dom0 (2.2) unstable; urgency=low
     2
     3  * Add qemu-ifup script that depends on the device model script and
     4    invokes vif-sipbroute.    As a consequence, we don't really support
     5    bridged hvms any more.  It's not clear how to get enough information
     6    out of qemu to do this.
     7  * Call arpspoof with 18.181.0.1's address.  This is unfortunate in two
     8    ways.  First, if we renumber we'll need to update the script.  Second,
     9    it is possible that someone on 18.181 besides the router may have an
     10    address cached.  Unfortunately, it doesn't work right if we don't
     11    send the spoofed arp directly to the router.
     12
     13 -- Sam Hartman <hartmans@debian.org>  Sun, 26 Aug 2007 18:57:17 -0400
     14
    115sipb-xen-dom0 (2.1) unstable; urgency=low
    216
  • trunk/packages/sipb-xen-dom0/sipb-xen-dom0/files/etc/xen/scripts/vif-sipbroute

    r87 r95  
    11#!/bin/bash
     2
    23
    34
     
    2526# Note that the v6 support is kind of broken because there's not really a way to populate the v6 prefix
    2627# This script will set up proxy arp  for any ip addresses that are being routed
     28# type read to determine if the device is ioemu
    2729
    2830#============================================================================
     
    3234
    3335main_ip=$(dom0_ip)
     36dev=${dev:-${vif}}
    3437
    3538case "$command" in
    3639    online)
    37         ifconfig ${vif} ${main_ip} netmask 255.255.255.255 up
    38         echo 1 >/proc/sys/net/ipv4/conf/${vif}/proxy_arp
    39         echo 1 >/proc/sys/net/ipv4/conf/${vif}/rp_filter
     40        ifconfig ${dev} ${main_ip} netmask 255.255.255.255 up
     41        echo 1 >/proc/sys/net/ipv4/conf/${dev}/proxy_arp
     42        echo 1 >/proc/sys/net/ipv4/conf/${dev}/rp_filter
    4043        ipcmd='add'
    4144        cmdprefix=''
     
    5356v6prefix=${v6prefix:-}
    5457v6prefix=$(xenstore_read_default "$XENBUS_PATH/v6prefix" "$v6prefix")
    55 
    56 if [ "${ip}" ] ; then
     58vif_type=$(xenstore_read_default "$XENBUS_PATH/type" "viffront")
     59if [  ${vif_type} != "ioemu"  -o  x${qemu_online} = xyes ] ; then
     60    if [ "${ip}" ] ; then
    5761    # If we've been given a list of IP addresses, then add routes from dom0 to
    5862    # the guest using those addresses.
    59     for addr in ${ip} ; do
    60       ${cmdprefix} ip route ${ipcmd} ${addr} dev ${vif} src ${main_ip}
    61       arpspoof -i eth0 ${addr}&
    62       sleep 5
    63       kill %arpspoof
    64     done
     63        for addr in ${ip} ; do
     64            ${cmdprefix} ip route ${ipcmd} ${addr} dev ${dev} src ${main_ip}
     65            arpspoof -i eth0 -t 18.181.0.1 ${addr}&
     66            sleep 5
     67            kill %arpspoof
     68        done
     69    fi
     70
     71    if [ x${v6prefix} != x ] ; then
     72        sed -e "s/@interface@/${dev}/" -e "s+@prefix@+${v6prefix}+" /etc/xen/radvd.conf.template >/var/run/radvd.conf.${vif}
     73        ${cmdprefix} ip -6 addr  ${ipcmd}  fe80::/64 scope link  dev ${dev}
     74        if [ $1 = online ] ; then
     75            radvd  -u radvd -C /var/run/radvd.conf.${vif} -p /var/run/radvd/radvd.pid.${vif}
     76        fi
     77        ${cmdprefix} ip -6 route ${ipcmd} ${v6prefix} dev ${dev}
     78    fi
    6579fi
    66 
    67 if [ x${v6prefix} != x ] ; then
    68     sed -e "s/@interface@/${vif}/" -e "s+@prefix@+${v6prefix}+" /etc/xen/radvd.conf.template >/var/run/radvd.conf.${vif}
    69     ${cmdprefix} ip -6 addr  ${ipcmd}  fe80::/64 scope link  dev ${vif}
    70     if [ $1 = online ] ; then
    71         radvd  -u radvd -C /var/run/radvd.conf.${vif} -p /var/run/radvd/radvd.pid.${vif}
    72     fi
    73     ${cmdprefix} ip -6 route ${ipcmd} ${v6prefix} dev ${vif}
    74     fi
    7580
    7681handle_iptable
Note: See TracChangeset for help on using the changeset viewer.