HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Virtualization With KVM On Ubuntu 12.04 LTS - can't bring up guest network interface (http://www.howtoforge.com/forums/showthread.php?t=58234)

nzimas 11th August 2012 12:17

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


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

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