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.

Just wondering if it's possible to have virtual networking interfaces that are accessible through the host's interface and IP?

Then I'd like to assign a subdomain to it and have the host direct to the correct guest based on that.

share|improve this question
    
Are you running KVM manually, or are you using libvirt (e.g. virt-manager or virsh?) –  sciurus Jun 30 '11 at 14:51

2 Answers 2

up vote 1 down vote accepted

there are two ways - you can either use libvirt's own iptables implementation, so the VMs are behind a NAT, or you can set up a bridge and use it instead. The bridge will ct as a virtual hub, into which the host and the VMs are plugged. in the first scenario, the VMs will be "behind" the host, since it will be acting as a router to the hosts' virtual network in the second, the VMs will be in the same network as the host (you can add VLANs in of course, to separate them)

share|improve this answer

You want a network bridge, then:

http://www.linux-kvm.org/page/Networking#public_bridge

share|improve this answer
    
Are the IPs assigned to the virtual machines will be internal private addresses and I can reach them through the one physical interface? –  kobrien Jun 29 '11 at 15:29
    
If you scroll up, that scenario is documented as well. –  Rilindo Jun 29 '11 at 15:57
    
They asked that the virtual machines be accessible through the hosts IP. That is not what a bridge would do. –  sciurus Jun 30 '11 at 14:50
    
If you look at the second part of the submitter's request, he also wants to point a subdomain to the VM. You can do that using NATing rules, but it would just be easier to put the VM with its own IP, setup a network bridge (assuming that he has a free IP to use). In either case, both options are documented on the KVM site. –  Rilindo Jun 30 '11 at 16:13

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.