Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 10th December 2009, 05:00
satimis satimis is offline
Senior Member
 
Join Date: Oct 2006
Posts: 533
Thanks: 4
Thanked 2 Times in 2 Posts
Default KVM Guest - Networking problem

Hi folks,


KVM
Host - Debian 5.0
VM (Guest) - Ubuntu 9.10
One NIC


I ran following command to create the guest (VM).

$ sudo virt-install --connect qemu:///system -n vm30ubuntu910 -r 512 --vcpus=2 -f /home/satimis/VM/vm30ubuntu910.qcow2 -s 12 -c /home/satimis/Desktop/mini_ubuntu9.10.iso --vnc --noautoconsole --os-type linux --accelerate --network=bridge:br0 --hvm


It went through without problem. Guest can contact Internet with following settings on /etc/network/interfaces
Code:
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

The above settings was created automatically during installation.


I tried setting following static IP without success;
Code:
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
        address         192.168.0.30
        netmask         255.255.255.0
        network         192.168.0.0
        broadcast       192.168.0.255
        gateway         192.168.0.1
        bridge_ports    eth0
        bridge_fd       9
        bridge_hello    2
        bridge_maxage   12
        bridge_stp      off

Internet can't be connected.


On guest;

sudo ifconfig eth0 :-
Code:
eth0    Link encap: Ethernet  HWaddr 54:52:00:07:69:c8
    Broadcase multicast  MTU:1500  Metric:1
    RX packets:0 errors:0 dropped:0 ovrruns:0 frame:0
    TX packets:0 errors:0 dropped:0 ovrruns:0 carrier:0   
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B)  TX bytes:0 (0.0.B)
    Interrupt:10

$ netstat -rn :-
Code:
Kernel IP routing table
Destination  Gateway  Genmask  Flags  MSS Window  irtt  Iface

complete ip route from host

$ ip route
Code:
192.168.0.0/24 dev br0  proto kernel  scope link  src 192.168.0.10
192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1
default via 192.168.0.1 dev br0

complete ip route from guest

$ ip route
Code:
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.49
default via 192.168.0.1 dev eth0  metric 100

complete ip link from host

$ ip link
Code:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:0e:a6:f9:a3:5b brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
    link/ether 00:0e:a6:f9:a3:5b brd ff:ff:ff:ff:ff:ff
4: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
    link/ether fa:cc:db:5d:a5:63 brd ff:ff:ff:ff:ff:ff
5: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 500
    link/ether 00:ff:95:46:91:b5 brd ff:ff:ff:ff:ff:ff
6: vnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 500
    link/ether 00:ff:00:13:7d:6d brd ff:ff:ff:ff:ff:ff
7: vnet2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 500
    link/ether 00:ff:e9:57:bf:64 brd ff:ff:ff:ff:ff:ff

complete ip link from guest

$ ip link
Code:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 54:52:00:07:69:c8 brd ff:ff:ff:ff:ff:ff

On host

$ sudo brctl show
Code:
bridge name    bridge id        STP enabled    interfaces
br0        8000.000ea6f9a35b    no        eth0
                            vnet0
                            vnet1
                            vnet2
virbr0        8000.000000000000    yes

Please help. TIA


Edit:

I found out the cause in running following command on VM (Guest)

$ sudo /etc/init.d/networking restart
Code:
 * Reconfiguring network interfaces...                                     
 * if-up.d/mountnfs[eth0]: waiting for interface br0 before doing NFS mounts
SIOCSIFADDR: No such device
br0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
SIOCSIFBRDADDR: No such device
br0: ERROR while getting interface flags: No such device
br0: ERROR while getting interface flags: No such device
Failed to bring up br0.
                                                                   [ OK ]
IIRC I met this problem sometimes ago. I had it fixed later unfortunate I have no recollection. Any advice? Thanks


B.R.
satimis

Last edited by satimis; 10th December 2009 at 14:56.
Reply With Quote
Sponsored Links
  #2  
Old 8th May 2010, 14:05
torusturtle torusturtle is offline
Senior Member
 
Join Date: Apr 2006
Posts: 296
Thanks: 21
Thanked 24 Times in 16 Posts
Send a message via ICQ to torusturtle Send a message via AIM to torusturtle
Default

Check if you have either the file
/etc/iftab

or
/etc/udev/rules.d/70-persistent-net.rules (or similar)

The mac address in the file should be the same as you have configured for the kvm vm.
Reply With Quote
  #3  
Old 8th May 2010, 15:13
satimis satimis is offline
Senior Member
 
Join Date: Oct 2006
Posts: 533
Thanks: 4
Thanked 2 Times in 2 Posts
 
Default

Quote:
Originally Posted by torusturtle View Post
Check if you have either the file
/etc/iftab

or
/etc/udev/rules.d/70-persistent-net.rules (or similar)

The mac address in the file should be the same as you have configured for the kvm vm.
Hi torusturtle,

Thanks for your advice.

I fixed my problem already. IIRC it needs bridge-utils installed on the guest as well.


B.R.
satimis
Reply With Quote
Reply

Bookmarks

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
postfix problems with smtp linkdeb Server Operation 13 15th March 2014 17:58
postfix/trivial-rewrite digitalage HOWTO-Related Questions 19 13th March 2013 19:02
courier-imap rpc problem planet_fox General 2 7th July 2009 15:54
Problem with mail and plugin djmostek Installation/Configuration 10 3rd September 2007 21:12
postfix mysql on fedora core5 igongora Installation/Configuration 7 17th April 2007 04:40


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


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