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

I try to configure bridge network for KVM(refer to http://www.linux-kvm.org/page/Networking), and it worked for Guest OS, but I have two problems with my Fedora host OS:

1、I can not access internet on host

2、The bridge configuration lost after reboot, I need to execute "service network restart" again to bring it up

I checked here(http://serverfault.com/questions/168119/kvm-network-bridge-with-public-static-ip-for-both-host-and-guests) for the first problem, it seems not working for me.

Any advice is appreciated!

ifconfig -a

eth0      Link encap:Ethernet  HWaddr 48:5B:39:ED:EB:5A  
          inet6 addr: fe80::4a5b:39ff:feed:eb5a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:231340 errors:0 dropped:0 overruns:0 frame:0
          TX packets:413424 errors:0 dropped:0 overruns:0 carrier:1
          collisions:0 txqueuelen:1000 
          RX bytes:15335606 (14.6 MiB)  TX bytes:114755796 (109.4 MiB)
          Interrupt:44 

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:119307 errors:0 dropped:0 overruns:0 frame:0
          TX packets:119307 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:57151264 (54.5 MiB)  TX bytes:57151264 (54.5 MiB)

sit0      Link encap:IPv6-in-IPv4  
          NOARP  MTU:1480  Metric:1
          RX packets:0 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:0 (0.0 b)  TX bytes:0 (0.0 b)

sw0       Link encap:Ethernet  HWaddr 48:5B:39:ED:EB:5A  
          inet addr:192.168.1.133  Bcast:255.255.255.255  Mask:255.255.255.0
          inet6 addr: fe80::4a5b:39ff:feed:eb5a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:229584 errors:0 dropped:0 overruns:0 frame:0
          TX packets:401232 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:11047463 (10.5 MiB)  TX bytes:113891533 (108.6 MiB)

tap0      Link encap:Ethernet  HWaddr F2:86:1A:48:E2:55  
          inet6 addr: fe80::f086:1aff:fe48:e255/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:232 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2744 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:24842 (24.2 KiB)  TX bytes:243899 (238.1 KiB)

virbr0    Link encap:Ethernet  HWaddr 9A:7C:09:6B:85:65  
          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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:5513 (5.3 KiB)
share|improve this question
    
please post the contents of cat /etc/sysconfig/network-scripts/ifcfg-* , brctl show and ps -ef|grep qemu for when the VM is started –  dyasny Nov 5 '11 at 15:14
    
+1 for using IPv6. It's the future, man –  Tom O'Connor Jan 8 '12 at 19:23

3 Answers 3

Your setup seems to be using IPv6 for eth0, is this intentional? If your host only has a single interface (eth0) and you are assigning it to the bridge, then you will also need to assign a virtual address to your host so it too can reach the network.

Post "route -n" here (both from the host and guest), and maybe also use "ping" to see where the packets stop? (assuming they even try to leave..)

Sorry, I don't know why you would need a "network restart" after reboot if "network" is already enabled to start on boot (chkconfig to verify).

share|improve this answer
    
eth0、sw0、tap0 -- all have IPv6 configuration –  isware Dec 13 '10 at 10:11
    
@isware no the output does not matches with what you said. eth0 is showing IPv6 and sw0 shows Ipv4 address. –  Registered User Mar 6 '11 at 21:45

I am giving you my /etc/network/interfaces file where I configured a bridge to use with four VMs on Ubuntu server which also uses KVM (my default lan card is 3rd i.e. 0,1,2,3 so eth2 is used)

auto lo
iface lo inet loopback

# The primary network interface
auto eth2
iface eth2 inet manual

auto br0
iface br0 inet static
        address 192.168.1.17
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.100.255
        gateway 192.168.100.100
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 192.168.103.2
        dns-search mydomain.com
        bridge_ports eth2
        bridge_fd 9
        bridge_hello 2
        bridge_maxage 12
        bridge_stp off

The above is a correct configuration.You might need to check /etc/network/interfaces manual page http://manpages.ubuntu.com/manpages/hardy/man5/interfaces.5.html to understand what the keyword manual in above does.

Post your network interfaces file where you defined bridge then we will be able to help.

I noticed your eth0 and sw0 are having same Mac address. Bridge works on Layer2 that might be source of your problem (some one correct me if I am wrong) and eth0 has IPv6 address where as sw0 has IPv4 address.This is not correct.

share|improve this answer
    
May I correct ? It is normal that eth0 and sw0 have the same mac address. The bridge (sw0) and the physical interface (eth0) which is used for bridge port HAVE the same Mac address. About ipV4 and ipV6 eth0 has no more ipV4 address as it is now member of the sw0 bridge it is this one who "owns" the ipV4 address and they both have ipV6 address that is not used commonly. This shoudln't be the problem. –  user90309 Aug 3 '11 at 6:40
    
eth0 and sw0 and an interface and a bridge on top if it - they SHOULD have the same MAC –  dyasny Apr 16 '12 at 6:24

A common mistake if to miss out

ONBOOT="yes"

from your interface definition, make sure it's defined there.

For the other issues, there's not much we can do without a network config script, so please post yours.

share|improve this answer

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.