Hotplug scripts include certain bash-isms that are not supported under
some distros' default shell (eg. Ubuntu 6.10's use of dash)
Signed-off-by: Alastair Tse <atse@xensource.com>
If the bridge is already configure, the default route will point
to a xenbr interface and not an eth interface. Handle this case.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
The current code will break if there are multiple scope global routes
since the "ip route list default" command doesn't use "default" as a
filter, and will output multiple devices which breaks the rest of the
script.
Also make the vif/xenbr/eth naming consistent, i.e. if your default
network interface is eth1, you get vif1 and xenbr1.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
default network device available no matter the name. It can still
be configured if you want a specific network device.
Patch by Bill Nottingham <notting@redhat.com>.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
a problem seen with tg3's needing some time for auto-negotiation, and so the
script would fail.
Patch courtesy of someone who's name has been lost to history.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
This is done by defining ifup/down both to 'false' when they're
missing; then instead of attempting to parse the IP params from
the kernel command line, we get them from 'ip' instead. So this
works even with (for example) ip=dhcp on the kernel command line.
Also made a few minor syntax changes (in particular, replaced "=="
with "=", and ">&foo" with ">foo 2>foo") so this works with more
limited shells.
Signed-off-by: Ben Thomas <bjthomas3@gmail.com>
it, when using ip on the kernel command line and not using the installed ifup /
ifdown. This stops the script bailing out if there is already an address
attached to that device, which was leaving the device without routing (since
this has already been removed).
Fix the stop action under the same circumstances. No attempt was made to
restore the kernel command line details to the interfaces if the ifdown failed
in that case.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
before issuing the diagnostic about the missing vdev. Having a pdev but no
vdev is a strong indicator that the network-bridge script has run once already,
and so there is nothing to worry about. Having the vdev and no corresponding
pdev is still diagnosed.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
to 8. These interfaces are very cheap, so there's no problem having a few
spare. Anyone with more than 8 NICs can still use the kernel command line or
the module parameter line to pass a larger limit to this module.
Detail the kernel command line parameter for nloopbacks in the diagnostic in
network-bridge.
Closes bug #381.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
all the "two bridges don't work" bugs that have been reported (bug #381).
Consideration will be given to raising the default limit -- this is just a
diagnostic of the problem.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
hotplug ones. Added evalVariables and findCommand functions to that, which we
use to clarify the handling of variables being passed in as command line
variables.
Make vif-bridge able to find the bridge for itself if only one bridge is in
use. This means that it is not necessary to specify a bridge in many
configurations. Allow the bridge to be specified on the command line, meaning
that a default may be provided in the xend-config.sxp if desired.
Added xenstore_read_default to xen-hotplug-common.sh, which reads from the
store but uses a given default if the path in the store is not present. This
is used by vif-bridge to allow the store details (i.e. those given to xm create)
to override the default value given in the xend-config.sxp.
Remove vif-bridge setting -- the value can be specified on the vif-script
command line if necessary.
Added examples for network-nat/vif-nat.
Added lots of big comments.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
this aren't beautiful, but this gets the distro-specific code out of the body
of the network-bridge script and into a common place, while still preserving
the existing code behaviour.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
code into vif-common.sh.
Fix the antispoofing in network-bridge to allow forwarding from physical
device to bridge, and vif0.0 to eth0.
Change the interface between netback driver and vif hotplugging scripts. The
mac address and bridge details are read from the store directly by the script,
so that the kernel driver does not need to get involved.
Remove an awful lot of cruft from vif-bridge. Move the iptables handling into
vif-common.sh, and fix it so that the new vif can get past the antispoofing
entries. Merge vif-nat and vif-route into this structure too.
Use ip instead of ifconfig to get necessary details.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
This is Kurt Garloff's reworked network-bridge script:
* we got rid of ifconfig
* it works for netdev != eth0
* arp on and off are symmetric as are ifdown and ifup
* ifup will be passed the ifcfg config file name if needed
(the ifup may otherwise figure that the veth0 hardware is
NOT the same as the original ${netdev} and not use the same
config -- this happens on SUSE. Charles Coffing tracked this
one down.)
Plus Kurt's avoid-dash patch:
the network setup scripts on SUSE have trouble with the bridge
name xen-br0; they don't expect the '-'.
Arguably this should be fixed.
But I assume there's more scripts out there which may not like it,
so I suggest the following patch to rename xen-br0 to xenbr0.
Plus Charles Duffy's patch to support multiple bridges:
The attached patch allows the network-bridge script to be used to
generate multiple bridges corresponding to different physical
interfaces. It adds a new parameter, "vifnum", used to refer both to
the loopback interface to be used and to set defaults regarding the
physical interface and bridge name.
Thus, if one wishes to start xenbr0 on eth0 and xenbr1 on eth1, one
need only call:
network-bridge start ## vifnum is 0 by default
network-bridge start vifnum=1
...well, that and set loopback.nloopbacks=2 in the Dom0 kernel
parameters.
Plus renaming of virtnum to vifnum in Charles' patch, as requested by Ian Pratt.
Plus a fix to DevController to allocate vif IDs starting from 0 (i.e. vif2.0
is now domain 2's first vif, as opposed to vif2.1 in the recent past).
Plus tidying up inside network-bridge using some helper variables.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
the which in the if with a combination of ! and || after the set -e but I think
it's cleaner to just do it before the set -e.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
system, I often invoked 'network-bridge stop' with total failure. Attached
is an updated version that works.
Signed-off-by: Andrew Theurer <habanero@us.ibm.com>
Although Li Ge has had problems with this script he had trouble with the previous too. I think this new one should work for more people, particularly those using DHCP on their primary dom0 interface.
Debugging is currently enabled ("sh -x") so a log of the script's execution is output to /var/log/xend.log
Signed-off-by: ian@xensource.com
--HG--
rename : tools/examples/network => tools/examples/network-bridge