Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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.

share|improve this answer
    
If I configure a external ip address on the guest other machines in the network can't see him . –  Fabio H. F. Sep 6 '11 at 17:58
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.