방금 아래 답변의 단계를 따랐습니다.
Virt-Manager GUI에서 네트워크 패스스루/브리징을 구성하는 쉬운 방법이 있습니까?
모든 일이 잘 진행되고 있는 것 같습니다. 그러나 가상 머신은 DHCP 서버로부터 IP 주소를 얻지 못합니다.
저는 Manjaro Linux(20.2.1)의 최신 릴리스를 사용하고 있습니다.
나는 Manjaro를 좋아합니다. 빠르고 쉽고 효과적입니다. x86_64, arm 및 arm64 아키텍처에서 사용하고 있습니다.
다음은 내 구성입니다. 실제 네트워크 카드는 enp0s31f6이고 기본 브리지는 br0입니다.
marco@wks ~]$ ip a l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
link/ether 4c:ed:fb:cc:08:3d brd ff:ff:ff:ff:ff:ff
4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:6c:06:9b:b6 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:6cff:fe06:9bb6/64 scope link
valid_lft forever preferred_lft forever
6: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 52:54:00:60:81:e4 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
7: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:60:81:e4 brd ff:ff:ff:ff:ff:ff
8: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 52:f3:20:28:27:65 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.111/24 brd 192.168.1.255 scope global noprefixroute br0
valid_lft forever preferred_lft forever
10: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master virbr0 state UNKNOWN group default qlen 1000
link/ether fe:54:00:ec:3c:d9 brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc54:ff:feec:3cd9/64 scope link
valid_lft forever preferred_lft forever
52: veth5807e61@if51: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
link/ether ce:3f:52:3e:e4:2e brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::cc3f:52ff:fe3e:e42e/64 scope link
valid_lft forever preferred_lft forever
[marco@wks ~]$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP mode DEFAULT group default qlen 1000
link/ether 4c:ed:fb:cc:08:3d brd ff:ff:ff:ff:ff:ff
4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
link/ether 02:42:6c:06:9b:b6 brd ff:ff:ff:ff:ff:ff
6: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 52:54:00:60:81:e4 brd ff:ff:ff:ff:ff:ff
7: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN mode DEFAULT group default qlen 1000
link/ether 52:54:00:60:81:e4 brd ff:ff:ff:ff:ff:ff
8: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 52:f3:20:28:27:65 brd ff:ff:ff:ff:ff:ff
10: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master virbr0 state UNKNOWN mode DEFAULT group default qlen 1000
link/ether fe:54:00:ec:3c:d9 brd ff:ff:ff:ff:ff:ff
52: veth5807e61@if51: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default
link/ether ce:3f:52:3e:e4:2e brd ff:ff:ff:ff:ff:ff link-netnsid 0
[marco@wks ~]$ bridge link
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 100
7: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 master virbr0 state disabled priority 32 cost 100
10: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master virbr0 state forwarding priority 32 cost 100
52: veth5807e61@if51: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master docker0 state forwarding priority 32 cost 2
[marco@wks ~]$ ip route
default via 192.168.1.1 dev br0 proto static metric 20425
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.111 metric 425
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
[marco@wks ~]$ sudo virsh net-list --all
[sudo] password for marco:
Name State Autostart Persistent
--------------------------------------------
br0 active yes yes
default active yes yes
[marco@wks ~]$ sudo virsh net-dumpxml br0
<network>
<name>br0</name>
<uuid>b3875e6c-2858-4e0a-be9a-f98e83cc5b70</uuid>
<forward mode='bridge'/>
<bridge name='br0'/>
</network>
실제 네트워크 주소는 192.168.1.0/24입니다.
이 문제를 어떻게 해결하나요?
편집 1
[marco@wks tianshou]$ sudo virsh domiflist jobs2021
Interface Type Source Model MAC
-----------------------------------------------------------
- bridge br0 virtio 52:54:00:48:89:a9
구성에 누락된 단계가 있습니까?
답변1
오늘은 이 일을 할 시간이 좀 있어요. 다음 네트워크 172.18.0.0/24를 고려하면 다음 명령으로 문제가 해결되었습니다.
iptables -t nat -A POSTROUTING -s 172.18.0.0/24 -d 172.18.0.0/24 -j ACCEPT
iptables -A FORWARD -i br0 -o br0 -j ACCEPT
다들 감사 해요.