ia64/xen-unstable
changeset 14817:27eaa7fe92d2
[setup] Fix old style bridge setup.
Also only warn that we ran out of veth interfaces if we have any at all.
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
Also only warn that we ran out of veth interfaces if we have any at all.
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author | Christian Limpach <Christian.Limpach@xensource.com> |
---|---|
date | Wed Apr 11 19:04:10 2007 +0100 (2007-04-11) |
parents | 46a592e2b7ea |
children | d56692b16296 |
files | tools/examples/network-bridge |
line diff
1.1 --- a/tools/examples/network-bridge Wed Apr 11 22:24:30 2007 +0100 1.2 +++ b/tools/examples/network-bridge Wed Apr 11 19:04:10 2007 +0100 1.3 @@ -183,12 +183,12 @@ op_start () { 1.4 return 1.5 fi 1.6 1.7 - if ! link_exists "$vdev"; then 1.8 - if link_exists "$pdev"; then 1.9 - # The device is already up. 1.10 - return 1.11 - else 1.12 - echo " 1.13 + if link_exists "$pdev"; then 1.14 + # The device is already up. 1.15 + return 1.16 + fi 1.17 + if link_exists veth0 && ! link_exists "$vdev"; then 1.18 + echo " 1.19 Link $vdev is missing. 1.20 This may be because you have reached the limit of the number of interfaces 1.21 that the loopback driver supports. If the loopback driver is a module, you 1.22 @@ -196,8 +196,7 @@ may raise this limit by passing it as a 1.23 driver is compiled statically into the kernel, then you may set the parameter 1.24 using netloop.nloopbacks=<N> on the domain 0 kernel command line. 1.25 " >&2 1.26 - exit 1 1.27 - fi 1.28 + exit 1 1.29 fi 1.30 1.31 create_bridge ${bridge} 1.32 @@ -224,9 +223,13 @@ using netloop.nloopbacks=<N> on the doma 1.33 add_to_bridge2 ${bridge} ${pdev} 1.34 do_ifup ${netdev} 1.35 else 1.36 + ip link set ${bridge} arp on 1.37 + ip link set ${bridge} multicast on 1.38 # old style without ${vdev} 1.39 transfer_addrs ${netdev} ${bridge} 1.40 transfer_routes ${netdev} ${bridge} 1.41 + # Attach the real interface to the bridge. 1.42 + add_to_bridge ${bridge} ${netdev} 1.43 fi 1.44 1.45 if [ ${antispoof} = 'yes' ] ; then