- Timestamp:
- Aug 26, 2007, 6:58:22 PM (17 years ago)
- svk:copy_cache_prev:
- 93
- Location:
- trunk/packages/sipb-xen-dom0/sipb-xen-dom0/files/etc/xen/scripts
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-dom0/sipb-xen-dom0/files/etc/xen/scripts/vif-sipbroute
r87 r95 1 1 #!/bin/bash 2 2 3 3 4 … … 25 26 # Note that the v6 support is kind of broken because there's not really a way to populate the v6 prefix 26 27 # 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 27 29 28 30 #============================================================================ … … 32 34 33 35 main_ip=$(dom0_ip) 36 dev=${dev:-${vif}} 34 37 35 38 case "$command" in 36 39 online) 37 ifconfig ${ vif} ${main_ip} netmask 255.255.255.255 up38 echo 1 >/proc/sys/net/ipv4/conf/${ vif}/proxy_arp39 echo 1 >/proc/sys/net/ipv4/conf/${ vif}/rp_filter40 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 40 43 ipcmd='add' 41 44 cmdprefix='' … … 53 56 v6prefix=${v6prefix:-} 54 57 v6prefix=$(xenstore_read_default "$XENBUS_PATH/v6prefix" "$v6prefix") 55 56 if [ "${ip}" ] ; then 58 vif_type=$(xenstore_read_default "$XENBUS_PATH/type" "viffront") 59 if [ ${vif_type} != "ioemu" -o x${qemu_online} = xyes ] ; then 60 if [ "${ip}" ] ; then 57 61 # If we've been given a list of IP addresses, then add routes from dom0 to 58 62 # 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 65 79 fi 66 67 if [ x${v6prefix} != x ] ; then68 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 ] ; then71 radvd -u radvd -C /var/run/radvd.conf.${vif} -p /var/run/radvd/radvd.pid.${vif}72 fi73 ${cmdprefix} ip -6 route ${ipcmd} ${v6prefix} dev ${vif}74 fi75 80 76 81 handle_iptable
Note: See TracChangeset
for help on using the changeset viewer.