Hi,

On 23.01.2018 15:37, Zihan Yang wrote:
> 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.

Unless you've set up a DHCP server in one of the guest, both guests can
not configure an IP address automatically on these interfaces, so it's
normal that you don't get an IP address here. The "user" (SLIRP) network
interface can use the built-in DHCP server from QEMU, but there is no
such feature for the "socket" interfaces.

So you either have got to set static IP addresses here, or you've got to
configure a DHCP server in one of the guests, as far as I can see.

 HTH,
  Thomas

Reply via email to