Ubuntu KVM Bridged DHCP가 작동하지 않습니다.

Ubuntu KVM Bridged DHCP가 작동하지 않습니다.

여기 질문과 Google에서 찾을 수 있는 모든 튜토리얼을 살펴봤지만 내 문제를 해결하는 데 아무것도 없는 것 같습니다. 나는 많은 소프트웨어(Unifi, Unifi Video, UNMS, Bluecherry, Apache2)가 있는 Ubuntu 16.04 서버를 가지고 있습니다. 14.04(mFi)만 지원하는 소프트웨어가 필요합니다. 그래서 16.04에서만 업데이트되는 소프트웨어와 16.04에서 작동하지 않지만 전기 요금 문제로 인해 PC 1대에 설치해야 하는 소프트웨어가 있습니다. KVM을 실행하는 16.04가 있고 VM을 잘 설치할 수 있습니다. 또한 내 라우터에서 DHCP를 수신하는 br0이 생성되었습니다. 라우터에서 DHCP를 얻으려면 14.04 VM이 필요합니다. 호스트에서 ifconfig는 다음과 같습니다:

br0       Link encap:Ethernet  HWaddr 00:1c:c0:38:c5:42
      inet addr:10.11.11.254  Bcast:10.11.11.255  Mask:255.255.255.0
      inet6 addr: fe80::21c:c0ff:fe38:c542/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:77330 errors:0 dropped:0 overruns:0 frame:0
      TX packets:48141 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:97552697 (97.5 MB)  TX bytes:31018242 (31.0 MB)

br-441049093d8f Link encap:Ethernet  HWaddr 02:42:29:9b:ba:1c
      inet addr:172.18.0.1  Bcast:172.18.255.255  Mask:255.255.0.0
      inet6 addr: fe80::42:29ff:fe9b:ba1c/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:3 errors:0 dropped:0 overruns:0 frame:0
      TX packets:180 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:84 (84.0 B)  TX bytes:8560 (8.5 KB)

br-f26207b68430 Link encap:Ethernet  HWaddr 02:42:62:fb:8a:5e
      inet addr:172.19.0.1  Bcast:172.19.255.255  Mask:255.255.0.0
      inet6 addr: fe80::42:62ff:fefb:8a5e/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:55749 errors:0 dropped:0 overruns:0 frame:0
      TX packets:47179 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:7779523 (7.7 MB)  TX bytes:26110547 (26.1 MB)

docker0   Link encap:Ethernet  HWaddr 02:42:1e:8a:a7:a3
      inet addr:172.17.0.1  Bcast:172.17.255.255  Mask:255.255.0.0
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 00:1c:c0:38:c5:42
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:14320804 errors:0 dropped:88 overruns:0 frame:0
      TX packets:9161214 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:18267999423 (18.2 GB)  TX bytes:4224704433 (4.2 GB)
      Interrupt:20 Memory:e8200000-e8220000

lo        Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:455114 errors:0 dropped:0 overruns:0 frame:0
      TX packets:455114 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1
      RX bytes:323006260 (323.0 MB)  TX bytes:323006260 (323.0 MB)

veth6087736 Link encap:Ethernet  HWaddr 92:6b:9e:30:3f:3f
      inet6 addr: fe80::906b:9eff:fe30:3f3f/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:2323 errors:0 dropped:0 overruns:0 frame:0
      TX packets:4719 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:631966 (631.9 KB)  TX bytes:451342 (451.3 KB)

veth0be9933 Link encap:Ethernet  HWaddr f6:4b:44:26:95:31
      inet6 addr: fe80::f44b:44ff:fe26:9531/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:22962 errors:0 dropped:0 overruns:0 frame:0
      TX packets:23170 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:1511612 (1.5 MB)  TX bytes:6634025 (6.6 MB)

veth4721a38 Link encap:Ethernet  HWaddr a6:30:ad:6b:99:c9
      inet6 addr: fe80::a430:adff:fe6b:99c9/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:51401 errors:0 dropped:0 overruns:0 frame:0
      TX packets:48796 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:23393519 (23.3 MB)  TX bytes:22044039 (22.0 MB)

veth4bfc810 Link encap:Ethernet  HWaddr 96:a8:06:b1:01:21
      inet6 addr: fe80::94a8:6ff:feb1:121/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:35421 errors:0 dropped:0 overruns:0 frame:0
      TX packets:38362 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:38357384 (38.3 MB)  TX bytes:27451189 (27.4 MB)

veth670940c Link encap:Ethernet  HWaddr ba:ee:fa:d6:a2:3f
      inet6 addr: fe80::b8ee:faff:fed6:a23f/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:53627 errors:0 dropped:0 overruns:0 frame:0
      TX packets:44489 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:38465696 (38.4 MB)  TX bytes:49446336 (49.4 MB)

vethd484c2b Link encap:Ethernet  HWaddr 36:53:04:68:c2:d1
      inet6 addr: fe80::3453:4ff:fe68:c2d1/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:26617 errors:0 dropped:0 overruns:0 frame:0
      TX packets:20841 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:4291112 (4.2 MB)  TX bytes:18090223 (18.0 MB)

vethda042e9 Link encap:Ethernet  HWaddr 36:6b:69:35:34:34
      inet6 addr: fe80::346b:69ff:fe35:3434/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:6563 errors:0 dropped:0 overruns:0 frame:0
      TX packets:11108 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:10448286 (10.4 MB)  TX bytes:10590365 (10.5 MB)

vnet0     Link encap:Ethernet  HWaddr fe:54:00:88:62:21
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:71 errors:0 dropped:0 overruns:0 frame:0
      TX packets:586 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:11162 (11.1 KB)  TX bytes:53777 (53.7 KB)

프로그램 중 하나에 도커 소프트웨어가 설치되어 있지만 다른 것들은 끝없는 시도에서 나온 것이라고 확신합니다.

내 호스트 등/네트워크/인터페이스는 현재 다음과 같습니다(다시 한 번 끝없는 시도를 통해).

# 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 manual

# bridge interface for kvm
auto br0
iface br0 inet dhcp
    bridge_ports eth0 vnet1 vnet0 vethda042e9 vethd484c2b veth670940c veth4bfc810 veth4721a38 veth0be9933 veth6087736
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 0

이것이 실제로 작동할까요, 아니면 모든 것을 esxi에 다시 설치하려고 합니까? VMware는 이를 수행합니다. 버추얼박스는 이런 일을 합니다. 이더넷과 VM 사이에 L2 브리지를 만들 수 없는 이유는 무엇입니까? 아마도 Windows Hypervisor를 사용하여 이 작업을 수행할 수도 있을 것입니다.

방화벽이 비활성화되었습니다. 모든 것을 설치하기 전에 DHCP에서 실패하면 시간이 완전히 낭비되었기 때문에 VM에서 아무것도 가져오지 마십시오. 터미널을 통해 설치를 시도했습니다. Virtual Network Manager를 설치하기 위해 다른 Desktop Ubuntu를 설정하고 약 9번 설치합니다.

예, libvirt를 사용하고 있습니다. 원래 br0에 추가된 유일한 인터페이스는 eth0이었지만 여전히 DHCP가 없습니다. 나는 그것이 효과가 있기를 바라면서 다른 것들을 추가하기 시작했지만 아니요.

다음은 XML입니다.

<domain type='kvm' id='11'>
  <name>mFi</name>
  <uuid>096832a0-76bf-488c-88dd-f0bcae02046c</uuid>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-xenial'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>core2duo</model>
  </cpu>
  <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>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/mFi.img'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <boot order='1'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' 
function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/boot/ubuntu-14.04.5-server-amd64.iso'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' 
function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' 
function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' 
function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' 
function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' 
function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:88:62:21'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <boot order='3'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' 
function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <sound model='ich6'>
      <alias name='sound0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' 
function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
    </video>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir1'/>
    </redirdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' 
function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='apparmor' relabel='yes'>
    <label>libvirt-096832a0-76bf-488c-88dd-f0bcae02046c</label>
    <imagelabel>libvirt-096832a0-76bf-488c-88dd-f0bcae02046c</imagelabel>
  </seclabel>
</domain>

구성을 편집하려고 하면 다음과 같이 표시됩니다.

  <interface type='bridge'>
      <mac address='52:54:00:88:62:21'/>
      <source bridge='br0'/>
      <model type='rtl8139'/>
      <boot order='3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' 
function='0x0'/>
    </interface>

심지어 덤프에 알리스와 타겟이 표시되었다고 생각했습니다. 그들은 꺼내려고 여기에 있는 것이 아닙니다. 댓글로 이런 짓을 하게 놔두지 않겠습니다.

호스트는 다음이 아닙니다.

# 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 manual

# bridge interface for kvm
auto br0
iface br0 inet dhcp
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 0

게스트 네트워크 구성이 무슨 뜻인지 모르겠습니다. 방금 확인한 내용이 아닌가요?

답변1

VM의 네트워크 인터페이스 구성을 살펴보겠습니다.

    <interface type='bridge'>
      <mac address='52:54:00:88:62:21'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <boot order='3'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' 
function='0x0'/>
    </interface>

첫째, <target>기존 브리지에 연결할 때 선택 사항입니다. 일반적으로 전혀 지정해서는 안됩니다. 이 줄을 제거하겠습니다.

둘째, 을(를) 정의했지만 속성 <alias>name잘못되었습니다. 모든 별칭 이름은 리터럴 문자열로 시작해야 합니다 ua-. 이 옵션은 libvirt 3.9.0 이전에는 존재하지 않았습니다. 이것도 선택사항이므로 그냥 삭제하셔도 됩니다.

를 사용하여 VM을 편집합니다 virsh edit vmname. 편집할 때 VM이 실행 중이었다면 설정을 적용하려면 VM을 중지했다가 다시 시작해야 합니다.

그 외에도 네트워크에 VM이 연결되지 않으면 게스트 구성이나 로컬 물리적 네트워크(예: 업스트림 스위치)에 문제가 있을 가능성이 높습니다.

관련 정보