wiki:experiences:igraltist:kvm-network
=>  Releases

Current version
Git/Latestdiff: 1.5.6

Latest Snapshots
Produced after each commit or rebase to new upstream version

GIT
RSBAC source code, can be unstable sometimes

=>  Events

No events planned

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:experiences:igraltist:kvm-network [2010/11/10 15:42]
127.0.0.1 (old revision restored)
wiki:experiences:igraltist:kvm-network [2011/02/14 13:17] (current)
127.0.0.1 (old revision restored)
Line 53: Line 53:
  
 Thats all. Thats all.
 +
  
  
Line 88: Line 89:
 The content of the script '/​etc/​kvm/​scripts/​kvm-ifup'​ The content of the script '/​etc/​kvm/​scripts/​kvm-ifup'​
 <code bash> <code bash>
-#!/bin/sh +#!/usr/bin/env python 
-ifconfig="/​sbin/​ifconfig+ 
-brctl="/sbin/brctl" +import sys 
-bridge="​br0"+import os 
 +from subprocess import call 
 + 
 +def add_iface_to_bridge():​ 
 +    try: 
 +        iface sys.argv[1] 
 +        bridge = os.environ["bridge_%s" ​% iface] 
 +        ​cmd ​["​brctl"​, "​addif", ​bridge, iface] 
 +        call(cmd) 
 +        iface_up ​["ip", "​link",​ "​set",​ iface, "​up"​] 
 +        call(iface_up) 
 +    except KeyError, e: 
 +        print str(e)
  
-echo "​Executing /​etc/​kvm/​scripts/​kvm-ifup"​ 
-echo "​Bringing up ${1} for bridged mode..."​ 
-sudo ${ifconfig} ${1} 0.0.0.0 promisc up 
-echo "​Adding ${1} to bridge ${bridge} ..." 
-sudo ${brctl} addif ${bridge} ${1} 
  
-# wait a moment +add_iface_to_bridge()  ​
-sleep 1+
 </​code>​ </​code>​
  
-You can see this is a shell script.\\ 
-The '​${1}'​ is the argument in the '​ifname'​. \\ 
-In the example above it would replace with '​rsbac'​ otherwise if is was not set '​tap0'​.\\ 
-Then its use sudo because my guest starts with unprivileged user '​kvm'​ which have in normal case no rights to do adminstrative 
-tasks.\\ 
-This line 'sudo ${brctl} addif ${bridge} ${1}' add the new create '​tap'​ device to the bridge. 
  
  
Line 123: Line 124:
  
  
-==== 3. Route Bride ====+==== 3. Route Bridge ​====
  
 Now the network part on host machine have to do. Now the network part on host machine have to do.
//
wiki/experiences/igraltist/kvm-network.1289400171.txt.gz · Last modified: 2010/11/10 15:42 by 127.0.0.1

wiki/experiences/igraltist/kvm-network.1289400171.txt.gz · Last modified: 2010/11/10 15:42 by 127.0.0.1
This website is kindly hosted by m-privacy