Bug 511244 - libvirt should error if virtual network uses same address range as host
Summary: libvirt should error if virtual network uses same address range as host
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt
Version: 5.4
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-14 12:32 UTC by Mark Xie
Modified: 2013-06-18 13:17 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-18 13:17:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Mark Xie 2009-07-14 12:32:00 UTC
Description of problem:
When adding a new network by virt-manager, there will be a warning when an unsuitable network specified, but it will failed to give out warning sometimes.
This maybe not a bug, but an advice of feature improvement, I'm not very sure.

Version-Release number of selected component (if applicable):
virt-manager-0.6.1-6.el5

How reproducible:
100%

Steps to Reproduce:
1. Launch virt-manager
2. Open "Host Details" window by "Edit --> Host Details", go to page of "Virtual Networks"
3. Add a new network follow the wizard, specify the same Network of the host machine on page of "Choosing an IPv4 address space". For example, the host network is "10.66.70.0/24", then specify "10.66.70.0/24" here.

Actual results:
There is none warning at step 3, but in fact, the guest should not have a same network with the host when using NAT.


Expected results:
It will be better if the background of the input field change color to remind end users.


Additional info:

Comment 1 Cole Robinson 2009-10-19 15:22:34 UTC
Not entirely sure how easy this will be. Need to investigate.

Comment 2 Daniel Berrangé 2009-10-19 15:29:05 UTC
This check should probably be done in the libvirt layer, I'd say it should refuse to start any virtual network which has an IP range that clashes with any current host interface.  Obviously this won't help if the host interface gets a clashing IP addr after the virtual network starts, but that's not so immediately critical as breaking existing host networking.

Comment 6 RHEL Program Management 2010-08-09 18:30:08 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 7 RHEL Program Management 2010-08-20 10:07:08 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 8 Cole Robinson 2011-03-10 15:41:10 UTC
Reassigning to libvirt per comment #2

Comment 11 RHEL Program Management 2013-05-01 06:42:57 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 12 Michal Privoznik 2013-06-18 13:17:55 UTC
The patch is pushed upstream for quite a while now:

commit a83fe2c23efad190a1e00e448f607fe032650fd6
Author:     Cole Robinson <crobinso>
AuthorDate: Thu May 20 19:31:16 2010 -0400
Commit:     Cole Robinson <crobinso>
CommitDate: Thu May 27 18:02:53 2010 -0400

    network: bridge: Don't start network if it collides with host routing
    
    Fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=235961
    
    If using the default virtual network, an easy way to lose guest network
    connectivity is to install libvirt inside the VM. The autostarted
    default network inside the guest collides with host virtual network
    routing. This is a long standing issue that has caused users quite a
    bit of pain and confusion.
    
    On network startup, parse /proc/net/route and compare the requested
    IP+netmask against host routing destinations: if any matches are found,
    refuse to start the network.
    
    v2: Drop sscanf, fix a comment typo, comment that function could use
        libnl instead of /proc
    
    v3: Consider route netmask. Compare binary data rather than convert to
        string.
    
    v4: Return to using sscanf, drop inet functions in favor of virSocket,
        parsing safety checks. Don't make parse failures fatal, in case
        expected format changes.
    
    v5: Try and continue if we receive unexpected. Delimit parsed lines to
        prevent scanning past newline

v0.8.1-199-ga83fe2c

It's part of 0.8.2 release which is part of RHEL-5.10. Hence I'm closing this one as CURRENTRELEASE.


Note You need to log in before you can comment on or make changes to this bug.