Gentoo Archives: gentoo-user

From: Dan Johansson <Dan.Johansson@×××.nu>
To: gentoo-user@l.g.o
Subject: [gentoo-user] KVM and Networking setup
Date: Sun, 18 Apr 2010 10:49:16
Message-Id: 201004181248.48017.Dan.Johansson@dmj.nu
1 I have been playing with KVM (replacing VMware-Server) and I need to setup my
2 network for the Guests like this:
3 --------------------------------------------8<-------------------------------------------
4 brctl addbr br-eth1
5 brctl addbr br-eth2
6 brctl addbr br-eth3
7
8 brctl setfd br-eth1 0
9 brctl setfd br-eth2 0
10 brctl setfd br-eth3 0
11
12 brctl sethello br-eth1 1
13 brctl sethello br-eth2 1
14 brctl sethello br-eth3 1
15
16 brctl stp br-eth1 off
17 brctl stp br-eth2 off
18 brctl stp br-eth3 off
19
20 brctl addif br-eth1 eth1
21 brctl addif br-eth2 eth2
22 brctl addif br-eth3 eth3
23
24 tunctl -b -t qtap1
25 tunctl -b -t qtap2
26 tunctl -b -t qtap3
27
28 brctl addif br-eth1 qtap1
29 brctl addif br-eth2 qtap2
30 brctl addif br-eth3 qtap3
31
32 ifconfig qtap1 up 0.0.0.0 promisc
33 ifconfig qtap2 up 0.0.0.0 promisc
34 ifconfig qtap3 up 0.0.0.0 promisc
35
36 ifconfig br-eth1 192.168.4.1/24 up
37 ifconfig br-eth2 0.0.0.0 up
38 ifconfig br-eth3 0.0.0.0 up
39 ifconfig eth1 0.0.0.0 up
40 ifconfig eth2 0.0.0.0 up
41 ifconfig eth3 0.0.0.0 up
42 --------------------------------------------8<-------------------------------------------
43
44 Today I do this manually before a start the KVM-Guests, but now I would like
45 to have this (the network setup) done automatically with the normal init
46 scripts. I could put everything in local but then some services on the Host
47 (e.g. Bind) can not "see" all interfaces when started and has to be restarted
48 again after local. What would be the correct syntax for /etc/conf.d/net for
49 this setup (still at baselayout-1).
50
51 Regards,
52 --
53 Dan Johansson, <http://www.dmj.nu>
54 ***************************************************
55 This message is printed on 100% recycled electrons!
56 ***************************************************