1 |
# ip link |
2 |
3: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> |
3 |
5: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> |
4 |
6: tap1: <BROADCAST,MULTICAST,UP,LOWER_UP> |
5 |
7: br0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> |
6 |
|
7 |
Assign what was the host machine's IP to br0. The guests on tap0 and |
8 |
tap1 should have IP addresses different from this, configured within |
9 |
the guest. |
10 |
|
11 |
# ip route |
12 |
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.2 |
13 |
|
14 |
Now, the config that (mostly) generates the above: |
15 |
|
16 |
config_tap0="null" |
17 |
tuntap_tap0="tap" |
18 |
tunctl_tap0="-u kvm" |
19 |
|
20 |
config_tap1="null" |
21 |
tuntap_tap1="tap" |
22 |
tunctl_tap1="-u kvm" |
23 |
|
24 |
config_enp2s0="null" |
25 |
routes_enp2s0="null" |
26 |
|
27 |
config_br0="192.168.1.2 netmask 255.255.255.0 brd 192.168.1.255" |
28 |
routes_br0="default via 192.168.1.1" |
29 |
bridge_br0="enp2s0 tap0 tap1" |
30 |
rc_net_br0_need="net.tap0 net.tap1 net.enp2s0" |
31 |
|
32 |
The -u option allows users in the kvm group to manipulate the device, |
33 |
if you want to bring it up and down on guest start and stop. |
34 |
|
35 |
Unfortunately I don't think this produces VM interfaces that are |
36 |
visible outside of the subnet. I made some live changes a while ago |
37 |
(and need to figure out what they were - probably routing stuff). In |
38 |
any case, you should be able to create the tap devices and bridge them |
39 |
without losing connectivity. From there you can get the guests visible |
40 |
from the outside. |