Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:kernel-2.6.32
xen
bridge-hostonly.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bridge-hostonly.diff of Package xen
Add support for "hostonly" xen bridges. Add support for "hostonly" networking, i.e. create a bridge without a physical network device linked in. The virtual machines can see each other and the host, but can't (directly) talk to the outside. Pass "netdev=none" to the network-bridge script to activate this. I'm using this on a laptop which has different network connections at different times (wired / wireless), so it is inconvinient to add the physical device into the bridge. In case the laptop is offline the virtual network still works just fine. It also avoids the problem that bridging doesn't work with wireless due to being limited to one mac address then. dom0 on that laptop also runs a dhcp server for the virtual network. Guests can talk to the internet via apache configured as http proxy. Another possible approach for guest internet access is NATing the virtual network. Signed-off-by: Gerd Hoffmann <kraxel@suse.de> --- tools/examples/network-bridge | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) Index: xen-3.2.1-testing/tools/examples/network-bridge =================================================================== --- xen-3.2.1-testing.orig/tools/examples/network-bridge +++ xen-3.2.1-testing/tools/examples/network-bridge @@ -305,6 +305,31 @@ op_stop () { for vlan in $vlans ; do ifup $vlan ; done } +op_start_hostonly () { + if [ "${bridge}" = "null" ] ; then + return + fi + if link_exists "${bridge}"; then + return + fi + + create_bridge ${bridge} + setup_bridge_port ${vif0} + add_to_bridge ${bridge} ${vif0} +} + +op_stop_hostonly () { + if [ "${bridge}" = "null" ]; then + return + fi + if ! link_exists "$bridge"; then + return + fi + + brctl delbr ${bridge} +} + + # adds $dev to $bridge but waits for $dev to be in running state first add_to_bridge2() { local bridge=$1 @@ -330,11 +355,19 @@ add_to_bridge2() { case "$command" in start) - op_start + if test "$netdev" = "none"; then + op_start_hostonly + else + op_start + fi ;; stop) - op_stop + if test "$netdev" = "none"; then + op_stop_hostonly + else + op_stop + fi ;; status)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor