1

I started using KVM, the network works fine under the bridge mode.

But a wanted my Virtual Machine to have a external IP address, like XEN server where you can create a virtual interface for a VM and define a external IP address for it.

I only found a way using IP Aliases, but it doesn't work very well.

Is there any other way of doing this?

masegaloeh
  • 18,236
  • 10
  • 57
  • 106

2 Answers2

1

Since kvm bridging mode allows guests to use the same physical media as a host uses to access the real network you can just configure your guest to use an external IP address using its standard configuration procedure. Just if it was physically plugged to the external network. IP Aliases etc. is an overkill.

Alex
  • 7,939
  • 6
  • 38
  • 52
1

Ok, I got this working using Ubuntu 10.04 x64. My network has a DHCP server.

Edit interface as following

# vim /etc/network/interfaces

auto lo eth0

auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_fd 0
bridge_stp off

Edit virtual machine using following command

# virsh edit VM_NAME

<interface type='bridge'>
<source bridge='br0'/>
<model type='virtio'/>
</interface>

Restart network service

#/etc/init.d/networking restart

Start the virtual machine. Access the virtual machine console, you can set the IP manually or use DHCP server.

Abhijeet Kasurde
  • 983
  • 9
  • 20