This commit is contained in:
iap10@freefall.cl.cam.ac.uk committed 2005-08-13 22:04:22 +00:00
commit a13b3d07c7
2 files changed
+33 -19

No files matched your search

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh -x
#============================================================================
# Default Xen network start/stop script.
# Xend calls a network script when it starts.
@@ -176,26 +176,40 @@ op_start () {
fi
if ifconfig veth0 2>/dev/null | grep -q veth0 ; then
# Propagate MAC address and ARP responsibilities to virtual interface.
mac=`ifconfig ${netdev} | grep HWadd | sed -e 's/.*\(..:..:..:..:..:..\).*/\1/'`
ifconfig veth0 down
ifconfig veth0 hw ether ${mac}
ifconfig veth0 arp up
transfer_addrs ${netdev} veth0
transfer_routes ${netdev} veth0
del_addrs ${netdev}
ifconfig ${netdev} -arp down
ifconfig ${netdev} hw ether fe:ff:ff:ff:ff:ff up
# Bring up second half of virtual device and attach it to the bridge.
ifconfig vif0.0 up
add_to_bridge ${bridge} vif0.0
mac=`ifconfig ${netdev} | grep HWadd | sed -e 's/.*\(..:..:..:..:..:..\).*/\1/'`
if ! ifdown ${netdev} ; then
# if ifup didn't work, see if we have an ip= on cmd line
if egrep 'ip=[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:' /proc/cmdline ;
then
kip=`sed -e 's!.*ip=\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\):.*!\1!' /proc/cmdline`
kmask=`sed -e 's!.*ip=[^:]*:[^:]*:[^:]*:\([^:]*\):.*!\1!' /proc/cmdline`
kgate=`sed -e 's!.*ip=[^:]*:[^:]*:\([^:]*\):.*!\1!' /proc/cmdline`
ifconfig ${netdev} 0.0.0.0 down
fi
fi
ip link set ${netdev} name p${netdev}
ip link set veth0 name eth0
ifconfig p${netdev} -arp down
ifconfig p${netdev} hw ether fe:ff:ff:ff:ff:ff
ifconfig ${netdev} hw ether ${mac}
add_to_bridge ${bridge} vif0.0
add_to_bridge ${bridge} p${netdev}
ip link set vif0.0 up
ip link set p${netdev} up
if ! ifup ${netdev} ; then
if [ ${kip} ] ; then
# use the addresses we grocked from /proc/cmdline
ifconfig ${netdev} ${kip}
[ ${kmask} ] && ifconfig ${netdev} netmask ${kmask}
ifconfig ${netdev} up
[ ${kgate} ] && ip route add default via ${kgate}
fi
fi
else
transfer_addrs ${netdev} ${bridge}
# old style without veth0
transfer_addrs ${netdev} ${bridge}
transfer_routes ${netdev} ${bridge}
fi
# Attach the real interface to the bridge.
add_to_bridge ${bridge} ${netdev}
if [ ${antispoof} == 'yes' ] ; then
antispoofing ${netdev} ${bridge}
+1 -1
View File
@@ -28,7 +28,7 @@
## Use the following if VIF traffic is bridged.
# The script used to start/stop networking for xend.
(network-script network)
(network-script network-bridge)
# The default bridge that virtual interfaces should be connected to.
(vif-bridge xen-br0)
# The default script used to control virtual interfaces.
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.