Commit Graph
20 Commits
Author SHA1 Message Date
emellor@leeni.uk.xensource.com 946f9a1879 Added link_exists function, for neatness. Check for the existence of the pdev
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>
2005-11-15 15:54:51 +01:00
kaf24@firebug.cl.cam.ac.uk ea475aded3 nloopbacks default is now 8. So vifnum of greater than 7 requires
an adjustment to nloopbacks. Warning comment updated.

Signed-off-by: Nivedita Singhvi (niv@us.ibm.com)
2005-11-11 10:46:36 +01:00
kaf24@firebug.cl.cam.ac.uk b976b8510a Updates comments in network-bridge, removes dead code, minor typo fixes.
Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>
2005-11-10 11:53:51 +01:00
emellor@leeni.uk.xensource.com 7aa98216f5 Increase the static constant default number of loopback interfaces, nloopbacks,
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>
2005-11-08 15:15:02 +01:00
emellor@leeni.uk.xensource.com ab6494f226 Fix misnamed call to legacy_mask_to_prefix. Thanks to Tim Moreton for finding
this.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-07 12:36:44 +01:00
emellor@leeni.uk.xensource.com 3d511563c0 Diagnostic for hitting the nloopbacks limit. This is presumably the cause of
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>
2005-11-07 12:36:35 +01:00
emellor@leeni.uk.xensource.com af374bc7d2 Added xen-script-common.sh, for functions common to all scripts, not just the
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>
2005-10-30 13:33:17 +01:00
emellor@leeni.uk.xensource.com 1033d025c4 Moved SuSE-specific getcfg call into a preiftransfer call. The semantics of
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>
2005-10-25 11:22:47 +01:00
emellor@leeni.uk.xensource.com e5edf96441 Break common network code in xen-network-common.sh, and common vif hotplugging
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>
2005-10-21 12:06:17 +01:00
emellor@leeni.uk.xensource.com e08da109cd Set antispoof default to yes, as this seems safer, and is the current behaviour
in VifCtl.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-10-20 14:06:07 +01:00
emellor@leeni.uk.xensource.com a77149f8e4 New network-bridge script and associated gubbins.
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>
2005-10-19 16:24:54 +01:00
kaf24@firebug.cl.cam.ac.uk 66041d1b9c Gentoo compatible stuff has to be done *before* the set -e. You could also do
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>
2005-10-05 19:15:56 +01:00
kaf24@firebug.cl.cam.ac.uk 5b6b39d3e9 Add Gentoo handling to network-bridge. Based on patches
from Jon Mason and Anthony Liguori.
2005-10-05 14:14:04 +01:00
emellor@ewan d02cb884e0 Disable debugging-level output.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-09-21 15:13:26 +01:00
kaf24@firebug.cl.cam.ac.uk 7d4d9ab1dd During my attempts to get the latest bridge networking model working on my
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>
2005-09-14 16:49:23 +00:00
iap10@freefall.cl.cam.ac.uk 94c199e8fc Make antispoof default to 'no' in network-script as the default in xend is 'no'. Having them different only causes confusion.
Signed-off-by: ian@xensoure.com
2005-08-18 14:17:22 +00:00
iap10@freefall.cl.cam.ac.uk 34ef247301 Another tweak to the network-bridge script.
Signed-off-by: ian@xensource.com
2005-08-17 12:29:34 +00:00
iap10@freefall.cl.cam.ac.uk 8b799c9ee6 Yet another work-around in the network-bridge script
From: Zhai, Edwin [edwin.zhai@intel.com]
Signed-off-by: ian@xensource.com
2005-08-16 20:00:53 +00:00
iap10@firebug.cl.cam.ac.uk 1aa3b010b9 Tweaks to network-bridge script.
Signed-off-by: ian@xensource.com
2005-08-15 21:47:44 +00:00
iap10@freefall.cl.cam.ac.uk 141ec0c639 New 'network-bridge' script that uses ifdown/ifup to configure the interface rather than trying to transfer addresses and routes. (Suggested by Gerd Knorr)
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
2005-08-13 22:02:54 +00:00