Score:0

How to add two interfaces to KVM VM acting like a loopback

fk flag

I have KVM machine with network interface (say eth0) attached to virbr0, I use it to ssh into the vm.

I would like to add two more ethernet interfaces (say eth1 and eth2) and "bridge it on the other side" (meaning on the host), so for the VM it looks like two ethernet cards connected with a wire.

I tried adding two more networks with virsh:

<network>
    <name>network0</name>   # and same for network1
    <forward mode='bridge'/>
    <bridge name='br0'/>
</network>

with bridge (on host):

ip link add name br0 type bridge
ip link set dev br0 up

but it seems to not pass the traffic (on vm):

ip addr add 10.0.0.1/24 dev eth1
ip link set dev eth1 up
ping -I eth1 10.0.0.2

and:

ip link set dev eth2 up
tcpdump -i eth2

Gives no output. What am I missing?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.