Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
netzwerk kvm
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Fri Sep 02, 2011 10:12 pm    Post subject: netzwerk kvm Reply with quote

pc1
brctl addbr br0
ifconfig br0 192.168.0.254 netmask 255.255.255.0 up
tunctl -b -u root -t qtap0
brctl addif br0 qtap0
ifconfig qtap0 up 0.0.0.0 promisc
route add -host 192.168.0.200 dev br0
qemu-kvm test.qemu -m 512 -net nic,model=rtl8139 -net tap,ifname=qtap0,script=no

virtuelleskvmding
ifconfig eth0 192.168.0.200 netmask 255.255.255.0 up
route add default gw 192.168.0.254

wenn ich das so mache koennen sich beide maschienen gegenseitig anpingen
ich komme dann aber nicht mehr von pc1 ins internet (router -> 192.168.0.254)
und vom virtuellemkvmding komme ich auch nicht ins internet
iptables habe ich auf beiden maschienen ausgeschaltet
hat jemmand eine idee wo der fehler bei der configuration liegen koennte?!
Back to top
View user's profile Send private message
ixo
Guru
Guru


Joined: 09 Jul 2005
Posts: 375

PostPosted: Sat Sep 03, 2011 8:16 am    Post subject: Reply with quote

Hallo,

ich habe das gerade unter Ubuntu zum Laufen bekommen (Workstation = ubuntu, Server = gentoo).

Der Rechner hat eine Netzwerkkarte (eth0) und bekommt vom Server per DHCP IP Adresse und routing.

Es sieht folgendermaßen aus:

- br0 an eth0 gehängt, dazu Konfigurationsdateien geändert, damit beim Booten direkt br0 genommen wird
(Ethernetadresse des ubuntu hosts ist an br0, nicht mehr an eth0)

- virtuelles KVM Dingsbums als bridged an br0 konfiguriert


Resultat:

Host hat IP Adresse an br0
Virtuelles KVM Dingsbums hängt ebenfalls an br0 im selben Segment wie Host, (ip Adresse und Routing kommt vom gentoo Server)
Alle können miteinander herumpingen etc.

Die Config Datei auf dem Ubuntu host sieht so aus.
Code:
$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

## The primary network interface
#auto eth0
##iface eth0 inet dhcp

auto br0

# Use old eth0 config for br0, plus bridge stuff
iface br0 inet dhcp
    bridge_ports    eth0
    bridge_stp      off
    bridge_maxwait  0
    bridge_fd       0


Dürfte bei Gentoo etwas anders sein, aber vielleicht hilft's ja. (Unter Gentoo muss ich das auch noch irgendwann zum Laufen bekommen.)

Grüße, ixo

PS: Wozu soll das qtap0 gut sein?
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Mon Sep 05, 2011 8:17 am    Post subject: Reply with quote

Code:
route add default gw 192.168.0.254


Damit wäre deine Bridge das GW, das ist nicht was du willst, wenn du eine Bridge baust.

Außerdem lass mal das ganze tun Geraffel weg und schaue mit ifconfig nach, welches Device dann von der VM erstellt wird und füge das der Bridge hinzu.

Zum Schluss noch eine Demo Gentoo-Config

Code:

bridge_br0="eth0"
config_eth0="null"

config_br0="
        89.238.xxx.xxx/24
        2a00:xxxx:2000:xxxx::2/64
        "

brctl_br0="stp off"

routes_br0="default via 89.238.xxx.1
        default via 2a00:xxxx:2000:xxxx::1"


Bei mir erledigt die libvirt das hinzufügen der Devices zur Bridge, nur so als Info. Das Gateway in der VM ist das gleiche wie für den Host.

Der Host wäre das Gateway, wenn man ein Routing-Setup machen würde, dann ohne Bridge.

Bye
Py
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Fri Sep 16, 2011 12:44 pm    Post subject: Reply with quote

vconfig add eth0 1
ifconfig eth0.1 192.168.1.1
hab ich gemacht, und in der vm hab ich die ip 192.168.1.2 vergeben
wie muss ich qemu-kvm aufrufen damit in der vm das eth0.1 benutzt wird?

Code:
libvirtd
14:43:07.932: 20677: info : libvirt version: 0.9.3
14:43:07.932: 20677: error : virSysinfoRead:441 : Interner Fehler Failed to find path for dmidecode binary
14:43:08.088: 20677: error : virExecWithHook:321 : Cannot find 'ip' in path: Datei oder Verzeichnis nicht gefunden

wie soll das funktionieren mit libvirtd?

und wie komme ich in die kvm konsole?
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Fri Sep 16, 2011 3:01 pm    Post subject: Reply with quote

Was willst du den jetzt schon wieder mit vconfig?

Überlege erstmal was du genau willst und gebe dann nochmal Bescheid...
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Tue Sep 20, 2011 10:19 am    Post subject: Reply with quote

geht das nicht ueber vconfig?
bei vmware frueher hatte ich vmnet1 bis ... am host, und ich habe ueber iptables geroutet
wie funktioniert das bei qemu-kvm? was genau muss ich tun um es genauso zumachen?
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Wed Sep 21, 2011 6:45 am    Post subject: Reply with quote

wie funktioniert das mit kvm und dem netzwerk?
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Wed Sep 21, 2011 8:09 am    Post subject: Reply with quote

Musst du gucken in Dokumentation oder hier:

http://qemu-buch.de/

Bye
Py
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Wed Sep 21, 2011 8:15 am    Post subject: Reply with quote

hab ich die letzten tage schon gemacht
aber ein buch hilft mir da nicht viel weiter ... ich glaube was ich brauche ist wer der mir sagt die das funktionieren soll mit dem netzwerk bei kvm
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Wed Sep 21, 2011 8:22 am    Post subject: Reply with quote

Da sind die kompletten Befehle aufgeführt... mit der jeweiligen Erklärung der Netzwerkmodi...

Hast du überhaupt mal reingeguckt?

Py
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Sat Sep 24, 2011 7:09 pm    Post subject: Reply with quote

na klar, da hab ich mich schon durchgelesen
ich kriege es aber einfach nicht zum laufen, egal welchen netzwerk modi ich ausprobiere

koennt ihr mir bitte ein config geben mit der ich am host eine neue netzwerkkarte habe ueber die die virtuelle maschiene ins netzkommt das ich dann ueber iptables route
bitte, das waere super...
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Wed Sep 28, 2011 9:18 am    Post subject: Reply with quote

huhu?
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Thu Sep 29, 2011 6:26 am    Post subject: Reply with quote

Hi,

pieter_parker wrote:
huhu?


Ehrlich, dass ist bald ein bissle frech gegenüber den Leuten die dir hier helfen. Und für faule, die google nicht richtig bemühen können:

http://lmgtfy.com/?q=kvm+networking+gentoo

Da findet man dann folgende nützliche Links:

https://forums.gentoo.org/viewtopic-t-712629-start-0.html
http://www.samshome.net/?p=21&page=1

MfG. Stefan
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Thu Sep 29, 2011 1:03 pm    Post subject: Reply with quote

Code:
/etc/conf.d/net

     brctl_br0=( "setfd 9" "sethello 2" "setmaxage 12" "stp off" )
    bridge_br0="eth0"

    config_eth0=( "192.168.0.1 netmask 255.255.255.0 brd 192.168.0.255" )
    routes_eth0=( "default via 192.168.0.254" )
    dns_servers=( "217.0.43.1" )

     config_br0=( "192.168.1.1 netmask 255.255.255.0 brd 192.168.1.255" )
      depend_br0() { need net.eth0 }



mit /etc/init.d/net.br0 start
hab ich zwar ein br0 bei ifconfig, aber kein internet mehr
und wenn ich
kvm -cdrom /home/pieter/Downloads/install-x86-minimal-20110927.iso -boot d -vnc 192.168.0.1:0 -net nic,vlan=0,macaddr=00:00:00:00:00:00 -net tap,vlan=0
mache wie bei dem englischen howto angegeben ist
sagt er mir
/etc/qemu-ifup: could not launch network script
qemu-system-x86_64: -net tap,vlan=0: Device 'tap' could not be initialized
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Thu Sep 29, 2011 2:22 pm    Post subject: Reply with quote

Vergleich mal deine Config mit meiner weiter oben *hint* eth0 *hint* vielleicht fällt dir was auf....

mac und vlan solltest bei dem KVM-Aufruf weglassen, das mit dem -net tap ist afaik auch überlfüssig.

Du solltest dich aber nochmal mit den Grundlagen beschäftigen, was ist eine Bridge? Was tut Sie? Wie tut Sie es?

Was für ein Setup möchte ich (du) eigentlich?

Bye
Py
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Fri Sep 30, 2011 7:53 am    Post subject: Reply with quote

py-ro, du hast bei dir
config_eth0="null"
ich hab bei mir
config_eth0=( "192.168.0.1 netmask 255.255.255.0 brd 192.168.0.255" )
warum hast du bei dir "null" stehen?

ich will ein setup wo der host der router ist, wie heisst das setup?

tun ist fuer ip zustaendig waerend tap nur mit ethernet zu tun hat
ich denke ich brauche ethernet, also tap, weil wozu soll nur ip gut sein?

ich will das jede vm ein eigenes dev am router hat das ich ueber iptables dann route
wie heisst das setup?
Back to top
View user's profile Send private message
yuhu
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2006
Posts: 86

PostPosted: Fri Sep 30, 2011 2:53 pm    Post subject: Reply with quote

hallo pieter_parker,

ist das 2. layout vom http://en.gentoo-wiki.com/wiki/KVM#Possible_Network_Layouts das was du willst?
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Fri Sep 30, 2011 5:29 pm    Post subject: Reply with quote

ja, das kommt hin, das ist es.
Back to top
View user's profile Send private message
yuhu
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2006
Posts: 86

PostPosted: Fri Sep 30, 2011 5:54 pm    Post subject: Reply with quote

wenn das so ist, warum passt du die dort abgebildete config nicht an deine Gegebenheiten an?

Using NAT/Masquerading:
File: /etc/conf.d/net

Quote:
bridge_br0="tap0 tap1"
brctl_br0="setfd 0 sethello 0 stp off"
rc_need_br0="net.tap0 net.tap1"
#
# host system is a static address at 192.168.1.12 with dns server at 34 and a router at 33
#
config_eth0="192.168.1.12/24"
routes_eth0="default via 192.168.1.33"
dns_domain_eth0="example.com"
dns_servers_eth0="192.168.1.34"
dns_search_eth0="example.com"

config_br0="192.168.100.254/24"

config_tap0="null"
tuntap_tap0="tap"
tunctl_tap0="-u joeuser"
mac_tap0="00:00:00:00:00:00"

config_tap1="null"
tuntap_tap1="tap"
tunctl_tap1="-u joeuser"
mac_tap1="00:00:00:00:00:01"
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Sun Oct 02, 2011 6:19 pm    Post subject: Reply with quote

mit
Code:
bridge_br0="tap0 tap1"
brctl_br0="setfd 0 sethello 0 stp off"
rc_need_br0="net.tap0 net.tap1"

config_eth0=( "192.168.0.1 netmask 255.255.255.0 brd 192.168.0.255" )
routes_eth0=( "default via 192.168.0.254" )
dns_servers_eth0=( "217.0.43.1" )

config_br0=( "192.168.1.1 netmask 255.255.255.0 brd 192.168.1.255" )

config_tap0="null"
tuntap_tap0="tap"
#tunctl_tap0="-u joeuser"
#mac_tap0="00:00:00:00:00:00"

config_tap1="null"
tuntap_tap1="tap"
#tunctl_tap1="-u joeuser"
#mac_tap1="00:00:00:00:00:01"

und
kvm -hda /home/pieter/temp/hda1.img -cdrom /home/pieter/Downloads/install-x86-minimal-20110927.iso -boot d -net nic,macaddr=00:00:00:00:00:00 -net tap,ifname=tap0,script=no,downscript=no -vnc 192.168.0.1:0
funktioniert es
die vm ist per tap0 verbunden, und das wiederrum ist auf br0 gebrueckt? warum?
gibt es eine loesung das man die vm direkt mit br0 verbindet
und die naechste vm mit br1 usw verbindet?
muss ich jetzt wirklich
br0 mit tap0 bruecken
br1 mit tap1 bruecken usw
ich will das jede vm fuer sich ist und keinen kontakt mit anderen vm hat, ausser ich route es
welche loesungen gibt es noch?
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1734
Location: Velbert

PostPosted: Sun Oct 02, 2011 9:01 pm    Post subject: Reply with quote

Mitdenken, dann einfach die Bridges weglassen und nur die tap-Devices benutzen, das meinte ich mit verstehen was du tust.

Py
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Mon Oct 03, 2011 5:46 pm    Post subject: Reply with quote

eh ok, warum sagt das niemand gleich das das so funktioniert

wenn ich z.b. die gentoo minimal install disc boote, schaltet sich beim booten die aufloesung im vnc fenster um und ich werde rausgeschmissen, kann mich aber wieder verbinden und hab dann das vnc fenster in der neuen aufloesung
kann man dieses rausgeschmissen werden und aufloesung wechseln irgendwie im laufendem vnc fenster mit machen?
gibts fuer vnc ne besondere option dafuer? habe tightvnc mit vncviewer benutzt

was genau macht diese tunctl_tap0 option?

wenn ich eine vm starte, und darain z.b. windows installiere, und dann mit meinem maus curos vom kde in das vnc fenster gehe wird er zu einem kreis
der kreis ist abweichend von der maus im vnc fenster
der cursour im vnc fenster bewegt sich mit einer anderen geschindigkeit wie meine maus
wie kriege ich die beiden in einklang
klar, mit rdesktop ist das problem geloest, aber wie kriege ich es per vnc in einklang?
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Tue Oct 04, 2011 9:04 am    Post subject: Reply with quote

pieter_parker wrote:
eh ok, warum sagt das niemand gleich das das so funktioniert

wenn ich z.b. die gentoo minimal install disc boote, schaltet sich beim booten die aufloesung im vnc fenster um und ich werde rausgeschmissen, kann mich aber wieder verbinden und hab dann das vnc fenster in der neuen aufloesung
kann man dieses rausgeschmissen werden und aufloesung wechseln irgendwie im laufendem vnc fenster mit machen?
gibts fuer vnc ne besondere option dafuer? habe tightvnc mit vncviewer benutzt

was genau macht diese tunctl_tap0 option?

wenn ich eine vm starte, und darain z.b. windows installiere, und dann mit meinem maus curos vom kde in das vnc fenster gehe wird er zu einem kreis
der kreis ist abweichend von der maus im vnc fenster
der cursour im vnc fenster bewegt sich mit einer anderen geschindigkeit wie meine maus
wie kriege ich die beiden in einklang
klar, mit rdesktop ist das problem geloest, aber wie kriege ich es per vnc in einklang?


schonmal was von libvirt und virt-manager gehört?

MfG. Stefan
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Tue Oct 04, 2011 9:30 am    Post subject: Reply with quote

schon, aber das muss doch auch alles ohne gehen
Back to top
View user's profile Send private message
pieter_parker
Veteran
Veteran


Joined: 07 Aug 2006
Posts: 1488
Location: 127.0.0.1

PostPosted: Tue Oct 04, 2011 11:48 am    Post subject: Reply with quote

wie verbinde ich mich in eine vm wo eine graifsche oberflaeche laeuft?
auch ueber vnc oder gab es da vom xserver aus nicht eine funktion fuer?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum