0

I have a Debian [H] host server with one network interface, configured like this (/etc/network/interfaces):

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address xxx.yyy.zzz.77
    netmask 255.255.255.224
    broadcast xxx.yyy.zzz.95
    gateway xxx.yyy.zzz.65
    post-up iptables-restore < /etc/iptables.up.rules

I've just installed qemu with Debian client [C] installation and I want to assign second IP address to this virtual machine. I've requested also additional MAC address from provider because I want this virtual machine to be visible from outside indepdendently.

How can I do that?

[H] - IP xxx.yyy.zzz.77 (as is)
[C] (installed on [H] using qemu) - IP xxx.yyy.zzz.66 (additional)

1 Answers1

1

Switch to using a bridge device and make sure the qemu instance is connected to that. You can find a guide to doing that on the Debian wiki: https://wiki.debian.org/BridgeNetworkConnections

The bridge device will act like a virtual bridge and it would thus seem to your VM that it's connecting to the actual network.

Tim Stoop
  • 588
  • 5
  • 20
  • Ok, but should I add secondary (.77) IP address to the host? Or should I only create bridge on host with existing IP (.66) and configure qemu installation with additional IP (.77) to use host as gateway? – Andrzej Pindor Feb 20 '15 at 14:19
  • 1
    Only the host address on the bridge, make sure you connect the NIC of the qemu instance to the bridge device and configure the secondary IP address in qemu on the connected interface. – Tim Stoop Feb 20 '15 at 14:28