KVM kann SSH vom Host aus durchführen, nicht von anderen Computern

KVM kann SSH vom Host aus durchführen, nicht von anderen Computern

Ich habe KVM/Quemu auf einem Server eingerichtet. Ich bin der Anleitung gefolgt und es hat mit einer Ausnahme funktioniert. Ich kann nur über den Server, auf dem KVM läuft, per SSH auf die VMs zugreifen. Wenn ich meinen Laptop verwende, geht das nicht. Ich muss zuerst per SSH auf den Server zugreifen und dann auf die VMs.

SERVER Ubuntu 18.04 Server

Hier ist /etc/network/interfaces auf dem Server.

Quelle /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# primary network interface
#auto eth0
#iface eth0 inet manual
#       address 192.168.1.100
#       netmask 255.255.255.0
#       dns-nameservers 8.8.8.8


#bridge
auto br0
iface br0 inet static
        address 192.168.1.100
        netmask 255.255.224.0
        gateway 192.168.1.1
        dns-nameserver 192.168.100.1 8.8.8.8
        bridge_ports eth0
        bridge_stp n
        bridge_fd 0
        bridge_maxwait 0



br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500                                                            
        inet 192.168.1.100  netmask 255.255.224.0  broadcast 192.168.31.255                                          
        ether 0e:37:a0:d5:da:e5  txqueuelen 1000  (Ethernet)                                                         
        RX packets 0  bytes 0 (0.0 B)                                                                                
        RX errors 0  dropped 0  overruns 0  frame 0                                                                  
        TX packets 0  bytes 0 (0.0 B)                                                                                
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0                                                   

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500                                                                
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255                                               
        ether 02:42:ac:48:67:60  txqueuelen 0  (Ethernet)                                                            
        RX packets 0  bytes 0 (0.0 B)                                                                                
        RX errors 0  dropped 0  overruns 0  frame 0                                                                  
        TX packets 0  bytes 0 (0.0 B)                                                                                
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0                                                   

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500                                                           
        inet 192.168.1.7  netmask 255.255.255.0  broadcast 192.168.1.255                                             
        ether 78:2b:cb:03:27:5c  txqueuelen 1000  (Ethernet)                                                         
        RX packets 209192  bytes 21456278 (21.4 MB)                                                                  
        RX errors 0  dropped 1400  overruns 0  frame 0                                                               
        TX packets 1220945  bytes 1689016362 (1.6 GB)                                                                
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0                                                   

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536                                                                         
        inet 127.0.0.1  netmask 255.0.0.0                                                                            
        loop  txqueuelen 1000  (Local Loopback)                                                                      
        RX packets 350787  bytes 5953177436 (5.9 GB)                                                                 
        RX errors 0  dropped 0  overruns 0  frame 0                                                                  
        TX packets 350787  bytes 5953177436 (5.9 GB)                                                                 
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0                                                   

virbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500                                                         
        inet 192.168.100.1  netmask 255.255.255.0  broadcast 192.168.100.255                                         
        ether 52:54:00:81:56:35  txqueuelen 1000  (Ethernet)                                                         
        RX packets 4662  bytes 313603 (313.6 KB)                                                                     
        RX errors 0  dropped 41  overruns 0  frame 0                                                                 
        TX packets 2177  bytes 228116 (228.1 KB)                                                                     
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0                                                   

vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500                                                          
        ether fe:54:00:de:c7:b6  txqueuelen 1000  (Ethernet)                                                         
        RX packets 4223  bytes 336843 (336.8 KB)                                                                     
        RX errors 0  dropped 0  overruns 0  frame 0                                                                  
        TX packets 24991  bytes 1402572 (1.4 MB)                                                                     
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0                                                   

Virsh bearbeiten 16

<domain type='qemu'>
  <name>ubuntu18.04</name>
  <uuid>bf380e27-73bf-4633-b69a-4b04cae4d0ab</uuid>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-bionic'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <vmport state='off'/>
  </features>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/md1/vm/images/ubuntu18.04.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
        </controller>
        <controller type='usb' index='0' model='ich9-uhci3'>
          <master startport='4'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
        </controller>
        <controller type='pci' index='0' model='pci-root'/>
        <controller type='ide' index='0'>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
        </controller>
        <controller type='virtio-serial' index='0'>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
        </controller>
        <interface type='bridge'>
          <mac address='52:54:00:de:c7:b6'/>
          <source bridge='br0'/>
          <model type='virtio'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
        </interface>
        <serial type='pty'>
          <target type='isa-serial' port='0'>
            <model name='isa-serial'/>
          </target>
        </serial>
        <console type='pty'>
          <target type='serial' port='0'/>
        </console>
        <channel type='spicevmc'>
          <target type='virtio' name='com.redhat.spice.0'/>
          <address type='virtio-serial' controller='0' bus='0' port='1'/>
        </channel>
        <input type='tablet' bus='usb'>
          <address type='usb' bus='0' port='1'/>
        </input>
        <input type='mouse' bus='ps2'/>
        <input type='keyboard' bus='ps2'/>
        <graphics type='spice' autoport='yes'>
          <listen type='address'/>
        </graphics>
        <sound model='ich6'>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
        </sound>
        <video>
          <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
        </video>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='2'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='3'/>
    </redirdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Nach eno1 verliere ich den SSH-Zugriff. Ich habe versucht, eine beliebige Zeichenfolge außer eno1 zu verwenden, und das gleiche Ergebnis. Beispiel: „bridge_ports mycatisbadass6969“. Ich vermute, dass der Bereich bridge_ports der Übeltäter ist. Irgendwelche Vorschläge?

LAPTOP Ubuntu 18.04-Desktop

Ifconfig des Laptops

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::eb74:44f9:ec1e:5c64  prefixlen 64  scopeid 0x20<link>
        ether ac:22:0b:50:ae:ea  txqueuelen 1000  (Ethernet)
        RX packets 1350919  bytes 1948697230 (1.9 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 328633  bytes 28035898 (28.0 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf7b00000-f7b20000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 6029  bytes 566246 (566.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6029  bytes 566246 (566.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:a3:f6:29  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

/etc/Netzwerk/Schnittstellen

auto lo
iface lo inet loopback

VM Ubuntu18.04-Server

ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.147  netmask 255.255.255.0  broadcast 192.168.100.255
        inet6 fe80::5054:ff:fede:c7b6  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:de:c7:b6  txqueuelen 1000  (Ethernet)
        RX packets 278  bytes 24506 (24.5 KB)
        RX errors 0  dropped 119  overruns 0  frame 0
        TX packets 169  bytes 17083 (17.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 284  bytes 21556 (21.5 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 284  bytes 21556 (21.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ich habe mich verändert

<interface type='network'>
  <source network='default'/>
</interface>

Zu

 <interface type='bridge'>
  <source bridge='br0'/>
</interface>

hat Adapter lo..ens3 Adapter

Außerdem habe ich die Netzwerkschnittstellen tausende Male neu gestartet, während ich mit sudo /etc/inint.d/network restart herumgespielt habe

Bearbeiten... Ich finde, wenn ich das unten ausführe, kann ich den Adapter verwenden. Ich kann immer noch nicht direkt per SSH auf die VM zugreifen

sudo ip addr flush dev br0 
sudo ip addr flush dev eno1

verwandte Informationen