Two IP addresses one network interface and virtualization
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)
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.