2 #============================================================================
5 # Script for configuring a vif in routed mode.
6 # The hotplugging system will call this script if it is specified either in
7 # the device configuration given to Xend, or the default Xend configuration
8 # in /etc/xen/xend-config.sxp. If the script is specified in neither of those
9 # places, then vif-bridge is the default.
12 # vif-route (add|remove|online|offline)
15 # vif vif interface name (required).
16 # XENBUS_PATH path to this device's details in the XenStore (required).
18 # Read from the store:
19 # ip list of IP networks for the vif, space-separated (default given in
21 #============================================================================
23 exec 2>>/var/log/xen-hotplug.log
25 case $0 in */*) dir=${0%/*};; *) dir=.;; esac
26 . "$dir/vif-common.sh"
32 ifconfig ${vif} ${main_ip} netmask 255.255.255.255 \
33 broadcast ${main_ip} up
34 ip -f inet6 addr delete dev ${vif} local fe80::fcff:ffff:feff:ffff/64
35 ip -f inet neigh add \
38 lladdr 00:16:3e:7c:aa:7f \
40 arp -i ${vif} -s 172.18.45.66 00:16:3e:7c:aa:7f pub
51 iptables "$iptcmd" INPUT -i "$vif" -j AdtXenIn
52 iptables "$iptcmd" FORWARD -i "$vif" -j AdtXenFwd
55 # If we've been given a list of IP addresses, then add routes from dom0 to
56 # the guest using those addresses.
57 for addr in ${ip} ; do
58 ip r ${ipcmd} ${addr} dev ${vif} src ${main_ip}
62 #S log debug "Successful vif-route $command for $vif."
63 if [ "$command" == "online" ]