Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 11th August 2012, 13:17
nzimas nzimas is offline
Member
 
Join Date: May 2007
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
 
Exclamation Virtualization With KVM On Ubuntu 12.04 LTS - can't bring up guest network interface

I'm trying to set up a private network for the guests using NAT.
My intention is to shield them from any direct interaction with the outside world.
The host I am working on has only one physical NIC with a public IP assigned to it.
For some reason I haven't managed to sort, the guest interface is not getting an ip from the default DHCP provided by libvirt (ideally I would actually use static IP addresses anyway).

The interface block in the guest's config file currently looks as follows:
Code:
<interface type='network'>
      <mac address='00:16:3e:1a:b3:4a'/>
      <source network='default'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
ifconfig returns:
Quote:
eth2 Link encap:Ethernet HWaddr 00:25:90:77:e4:48
inet addr:178.33.xxx.xxx Bcast:178.33.xxx.xxx Mask:255.255.255.0
inet6 addr: fe80::225:90ff:fe77:e448/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5710 errors:0 dropped:0 overruns:0 frame:0
TX packets:11024 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2315829 (2.3 MB) TX bytes:2450697 (2.4 MB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:35 errors:0 dropped:0 overruns:0 frame:0
TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4674 (4.6 KB) TX bytes:4674 (4.6 KB)

lxcbr0 Link encap:Ethernet HWaddr 56:e8:31:f9:b9:91
inet addr:10.0.3.1 Bcast:10.0.3.255 Mask:255.255.255.0
inet6 addr: fe80::54e8:31ff:fef9:b991/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:318 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:27300 (27.3 KB)

virbr0 Link encap:Ethernet HWaddr fe:16:3e:1a:b3:4a
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1041 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:30012 (30.0 KB) TX bytes:0 (0.0 B)

vnet0 Link encap:Ethernet HWaddr fe:16:3e:1a:b3:4a
inet6 addr: fe80::fc16:3eff:fe1a:b34a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:558 errors:0 dropped:0 overruns:0 frame:0
TX packets:18966 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:23652 (23.6 KB) TX bytes:984594 (984.5 KB)
/etc/network/interfaces is configured as shown:
Code:
auto lo
iface lo inet loopback

auto eth2
iface eth2 inet static
	address 178.33.xxx.xxx
	netmask 255.255.255.0
	network 178.33.xxx.xxx
	broadcast 178.33.xxx.xxx
	gateway 178.33.xxx.xxx
Lastly, ifup doesn't seem to find vnet0, although ifconfig lists it.
Quote:
ifup vnet0
Ignoring unknown interface vnet0=vnet0
Thanks!

[EDIT]
Although the vnetX interfaces still display empty, I manage to access the VMs if a static IP is supplied to vmbuilder. As such:
Code:
vmbuilder kvm ubuntu --suite=precise --flavour=virtual --arch=amd64 --mirror=http://de.archive.ubuntu.com/ubuntu -o --libvirt=qemu:///system --ip=192.168.122.2 --gw=192.168.122.1 --part=vmbuilder.partition --templates=mytemplates --user=administrator --name=Administrator --pass=howtoforge  --addpkg=unattended-upgrades --addpkg=acpid --firstboot=/var/lib/libvirt/images/vm2/boot.sh --mem=4096 --hostname=vm2

Last edited by nzimas; 12th August 2012 at 01:34. Reason: Solved
Reply With Quote
Sponsored Links
Reply

Bookmarks

Tags
kvm, libvirt, nat, network

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu 12.04 "waiting for network configuration" on boot orasis Installation/Configuration 10 25th June 2012 22:19
Problem with Network configuration on UBUNTU Server 12.04 LTS MikeFF Installation/Configuration 6 16th June 2012 11:26
ubuntu 12.04 - kvm network interface empty nzimas HOWTO-Related Questions 2 11th May 2012 23:10
Connection timed out on intermail outgoing mails gouravgarg Server Operation 6 5th March 2010 21:31
Unable to connect to Mysql mbascombe Installation/Configuration 12 10th January 2010 23:46


All times are GMT +2. The time now is 05:02.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.