qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-discuss] No IP in net interface when using socket netdev


From: Zihan Yang
Subject: [Qemu-discuss] No IP in net interface when using socket netdev
Date: Tue, 23 Jan 2018 22:37:43 +0800

I'm trying to start two VMs V1 and V2, and let them connect through socket.

I'm using the latest qemu source code cloned from git. Here is the
configuration of two VM:
V1: two net cards, one for public Internet using SLIRP, one listening on
port 1234. The start command is:
$ qemu-system-x86_64 -m 1024 -enable-kvm -drive file=test.qcow2 \
             -netdev user,id=realnet0 -device
e1000e,netdev=realnet0,mac=52:54:00:12:34:56
\
             -netdev socket,id=mynet0,listen=:1234 -device
e1000e,netdev=mynet0,mac=52:54:00:12:34:57

V2: only one net card, connecting V1 with socket. The start command is:
$ qemu-system-x86_64 -m 1024 -enable-kvm -drive file=test1.qcow2 \
             -netdev socket,id=mynet1,connect=127.0.0.1:1234 -device
e1000e,netdev=mynet1,mac=52:54:00:12:34:58

However, I find that when I start the V1, there is only only one IP address
for the net card using SLIRP, and there is no address of another net card.
When I start V2, there is no IP address since it has only one net card.

I tried to add some prints in the qemu source code, and find that the
connection from V2 to V1 is indeed accepted, but obviously it is not
transmitted into V1.

I wonder what I missed in the configuration? I've even tried the legacy
'-net' option, which didn't work either.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]