3

I have a host machine running centos 6.2 and it has 2 VM's using libvirt. I had it all working, but then I had a power outage and now the host has connectivity, but the VM's cant get an IP when they come up and have no network connectivity. I am trying to use a bridged network adaptor for them to connect.

ifconfig looks like this:

em1       Link encap:Ethernet  HWaddr 84:2B:2B:58:4C:AD  
          inet addr:192.168.1.38  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::862b:2bff:fe58:4cad/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:328369 errors:0 dropped:2 overruns:0 frame:0
          TX packets:228167 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:38114989 (36.3 MiB)  TX bytes:267087066 (254.7 MiB)

em2       Link encap:Ethernet  HWaddr 84:2B:2B:58:4C:AE  
          inet6 addr: fe80::862b:2bff:fe58:4cae/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:227338 errors:0 dropped:1178 overruns:0 frame:0
          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:29134179 (27.7 MiB)  TX bytes:2731 (2.6 KiB)

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:65536  Metric:1
          RX packets:193026 errors:0 dropped:0 overruns:0 frame:0
          TX packets:193026 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:262903768 (250.7 MiB)  TX bytes:262903768 (250.7 MiB)

vif1.0    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF  
          inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:29 errors:0 dropped:0 overruns:0 frame:0
          TX packets:275 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32 
          RX bytes:5774 (5.6 KiB)  TX bytes:78680 (76.8 KiB)

vif2.0    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF  
          inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20 errors:0 dropped:0 overruns:0 frame:0
          TX packets:158 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32 
          RX bytes:3662 (3.5 KiB)  TX bytes:41564 (40.5 KiB)

virbr0    Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF  
          inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:49 errors:0 dropped:0 overruns:0 frame:0
          TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:9436 (9.2 KiB)  TX bytes:11432 (11.1 KiB)

em1 is my main wired conneciton and virbr0 is the bridged connection.

[root@localhost network-scripts]# ip route

default via 192.168.1.1 dev em1  proto static 
192.168.1.0/24 dev em1  proto kernel  scope link  src 192.168.1.38  metric 1 

[root@localhost network-scripts]# brctl show

bridge name bridge id       STP enabled interfaces
virbr0      8000.feffffffffff   no      vif1.0
                                        vif2.0

When I try to ping via my bridge it fails:

    ping -Ivirbr0 192.168.1.1
    PING 192.168.1.1 (192.168.1.1) from 192.168.1.38 virbr0: 56(84) bytes of data.
    From 192.168.1.38 icmp_seq=1 Destination Host Unreachable

When I restart my network, I get this error:

service network restart
Shutting down interface virbr0:                            [FAILED]
Shutting down interface em1:  Device state: 3 (disconnected)
                                                           [  OK  ]
Shutting down interface em2:                               [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface Wired_connection_1:  Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/61
state: activated
Connection activated
                                                           [  OK  ]
Bringing up interface em1:  Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/64
state: activated
Connection activated
                                                           [  OK  ]
Bringing up interface virbr0:  
Determining IP information for virbr0...PING 192.168.1.1 (192.168.1.1) from 192.168.1.38 virbr0: 56(84) bytes of data.

--- 192.168.1.1 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3005ms
pipe 4
 failed.
                                                           [FAILED]

Previously with this server, I had this problem - centos server with virtual machines parent cant connect out but vms work fine and was able to fix it with help, but maybe some of the fixes I did caused problems after the reboot.

Any suggestions?

Joelio
  • 177
  • 2
  • 14
  • before the reboot there were routes for my bridge, but they are gone now, maybe that is my problem, but I dont know how to add them back or why they are missing: (this is what they used to be) 169.254.0.0/16 dev virbr0 scope link metric 1004 192.168.1.0/24 dev virbr0 proto kernel scope link src 192.168.1.38 – Joelio Jul 08 '17 at 18:19

1 Answers1

1

It seems you have NetworkManager managing your connection. On RHEL6, NetworkManager should be disabled when running bridged connection with libvirt. Try disabling it and rebooting your system.

If you can not disable it system-wide, you can edit the network interface files under /etc/sysconfig/network-scripts/ and insert the line

NM_CONTROLLED=no

in both the physical and bridge interfaces

shodanshok
  • 44,038
  • 6
  • 98
  • 162