Bug 1388918 - OVN: Gateway IP should not be assigned by DHCP
Summary: OVN: Gateway IP should not be assigned by DHCP
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openvswitch
Version: 7.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Russell Bryant
QA Contact: qding
URL:
Whiteboard:
Depends On:
Blocks: 1411730
TreeView+ depends on / blocked
 
Reported: 2016-10-26 13:02 UTC by Marcin Mirecki
Modified: 2017-08-07 12:42 UTC (History)
11 users (show)

Fixed In Version: openvswitch-2.7.0-8.git20170530.el7fdb
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-12 15:33:38 UTC
Target Upstream Version:


Attachments (Terms of Use)
exclude_ips.log (13.50 KB, text/plain)
2017-06-06 09:58 UTC, qding
no flags Details

Description Marcin Mirecki 2016-10-26 13:02:34 UTC
DHCP should consider the gateway IP as unavailable when calculating the pool of availalbe IPs.

When using DHCP in OVS, one of the parameters required to create a DHCP_Options record is the Default Gateway. 
The IP of the default gateway is then randomly assigned by DHCP to a port. This should not be the case. The gateway is usually a static IP assigned to a specific port. If the gateway is randomly assigned, all the traffic outside of current subnet will also be randomly routed to this port.

Comment 5 Numan Siddique 2017-04-17 16:38:18 UTC
The upstream commit to support this feature of excluding ips from the subnet is now merged.

https://github.com/openvswitch/ovs/commit/161ea2c87172b9dca21450311decefb297b44bb8

Comment 8 qding 2017-06-06 09:58:10 UTC
Created attachment 1285323 [details]
exclude_ips.log

Comment 12 qding 2017-06-07 02:11:04 UTC
Verified with openvswitch-2.7.0-8.git20170530.el7fdb. Log is as below.

ovn-nbctl set Logical_switch sw0 other_config:exclude_ips="172.16.1.244 172.16.1.247..172.16.1.249 172.16.1.250"

[root@dell-per730-26 images]# rpm -q openvswitch
openvswitch-2.7.0-8.git20170530.el7fdb.x86_64
[root@dell-per730-26 images]# rpm -qa | grep ovn
kernel-kernel-networking-openvswitch-ovn-1.0-51.noarch
openvswitch-ovn-common-2.7.0-8.git20170530.el7fdb.x86_64
openvswitch-ovn-host-2.7.0-8.git20170530.el7fdb.x86_64
openvswitch-ovn-central-2.7.0-8.git20170530.el7fdb.x86_64
[root@dell-per730-26 images]# 
[root@dell-per730-26 images]# bash bz1388918.sh 
openvswitch-2.7.0-8.git20170530.el7fdb.x86_64
clear OVS, OVN, veth and netns
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
    link/ether f4:8e:38:c4:6e:48 brd ff:ff:ff:ff:ff:ff
3: em2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
    link/ether f4:8e:38:c4:6e:49 brd ff:ff:ff:ff:ff:ff
4: em3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
    link/ether f4:8e:38:c4:6e:4a brd ff:ff:ff:ff:ff:ff
5: em4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
    link/ether f4:8e:38:c4:6e:4b brd ff:ff:ff:ff:ff:ff
6: p7p1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
    link/ether a0:36:9f:ab:36:14 brd ff:ff:ff:ff:ff:ff
7: p6p1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 6805ca38699c state DOWN mode DEFAULT qlen 1000
    link/ether 68:05:ca:38:69:9c brd ff:ff:ff:ff:ff:ff
8: p7p2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
    link/ether a0:36:9f:ab:36:16 brd ff:ff:ff:ff:ff:ff
9: p6p2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 6805ca38699d state DOWN mode DEFAULT qlen 1000
    link/ether 68:05:ca:38:69:9d brd ff:ff:ff:ff:ff:ff
10: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
    link/ether 76:4b:09:4e:48:f0 brd ff:ff:ff:ff:ff:ff
11: br-int: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
    link/ether 8e:b0:95:35:59:40 brd ff:ff:ff:ff:ff:ff

start openvswitch, and ovn services
Chassis "c4b336b4-0e81-41e4-acab-0745c7f1ff83"
    hostname: "dell-per730-26.rhts.eng.pek2.redhat.com"
    Encap geneve
        ip: "127.0.0.1"
        options: {csum="true"}

create logical switch and logical switch port
0996d61f-6e55-4b79-93e2-4cd51b764a5a
server_mac=00:aa:bb:00:00:00
router=172.16.1.254
server_id=172.16.1.254
lease_time=3600
"172.16.1.244 172.16.1.247..172.16.1.249 172.16.1.250"

create guests
    switch 51f95365-70e9-45d0-bee5-128a5a2f75e7 (sw0)
        port sp11
            addresses: ["00:de:ad:11:22:11 dynamic"]
        port sp10
            addresses: ["00:de:ad:11:22:10 dynamic"]
        port sp3
            addresses: ["00:de:ad:11:22:03 dynamic"]
        port sp5
            addresses: ["00:de:ad:11:22:05 dynamic"]
        port sp2
            addresses: ["00:de:ad:11:22:02 dynamic"]
        port sp1
            addresses: ["00:de:ad:11:22:01 dynamic"]
        port sp15
            addresses: ["00:de:ad:11:22:15 dynamic"]
        port sp4
            addresses: ["00:de:ad:11:22:04 dynamic"]
        port sp0
            addresses: ["00:de:ad:11:22:00 172.16.1.252"]
        port sp6
            addresses: ["00:de:ad:11:22:06 dynamic"]
        port sp9
            addresses: ["00:de:ad:11:22:09 dynamic"]
        port sp14
            addresses: ["00:de:ad:11:22:14 dynamic"]
        port sp12
            addresses: ["00:de:ad:11:22:12 dynamic"]
        port sp13
            addresses: ["00:de:ad:11:22:13 dynamic"]
        port sp8
            addresses: ["00:de:ad:11:22:08 dynamic"]
        port sp7
            addresses: ["00:de:ad:11:22:07 dynamic"]

=== dhclient for veth0@netns0

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth0/00:de:ad:11:22:00
Sending on   LPF/veth0/00:de:ad:11:22:00
Sending on   Socket/fallback
DHCPDISCOVER on veth0 to 255.255.255.255 port 67 interval 5 (xid=0xbf8338a)
DHCPREQUEST on veth0 to 255.255.255.255 port 67 (xid=0xbf8338a)
DHCPOFFER from 172.16.1.254
DHCPACK from 172.16.1.254 (xid=0xbf8338a)
bound to 172.16.1.252 -- renewal in 1708 seconds.

=== dhclient for veth1@netns1

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth1/00:de:ad:11:22:01
Sending on   LPF/veth1/00:de:ad:11:22:01
Sending on   Socket/fallback
DHCPDISCOVER on veth1 to 255.255.255.255 port 67 interval 3 (xid=0x1bbb1073)
DHCPREQUEST on veth1 to 255.255.255.255 port 67 (xid=0x1bbb1073)
DHCPOFFER from 172.16.1.254
DHCPACK from 172.16.1.254 (xid=0x1bbb1073)
bound to 172.16.1.242 -- renewal in 1441 seconds.

=== dhclient for veth2@netns2

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth2/00:de:ad:11:22:02
Sending on   LPF/veth2/00:de:ad:11:22:02
Sending on   Socket/fallback
DHCPDISCOVER on veth2 to 255.255.255.255 port 67 interval 3 (xid=0x2c175005)
DHCPREQUEST on veth2 to 255.255.255.255 port 67 (xid=0x2c175005)
DHCPOFFER from 172.16.1.254
DHCPACK from 172.16.1.254 (xid=0x2c175005)
bound to 172.16.1.243 -- renewal in 1463 seconds.

=== dhclient for veth3@netns3

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth3/00:de:ad:11:22:03
Sending on   LPF/veth3/00:de:ad:11:22:03
Sending on   Socket/fallback
DHCPDISCOVER on veth3 to 255.255.255.255 port 67 interval 7 (xid=0x3a328cbd)
DHCPREQUEST on veth3 to 255.255.255.255 port 67 (xid=0x3a328cbd)
DHCPOFFER from 172.16.1.254
DHCPACK from 172.16.1.254 (xid=0x3a328cbd)
bound to 172.16.1.245 -- renewal in 1596 seconds.

=== dhclient for veth4@netns4

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth4/00:de:ad:11:22:04
Sending on   LPF/veth4/00:de:ad:11:22:04
Sending on   Socket/fallback
DHCPDISCOVER on veth4 to 255.255.255.255 port 67 interval 8 (xid=0x71ef937b)
DHCPREQUEST on veth4 to 255.255.255.255 port 67 (xid=0x71ef937b)
DHCPOFFER from 172.16.1.254
DHCPACK from 172.16.1.254 (xid=0x71ef937b)
bound to 172.16.1.246 -- renewal in 1602 seconds.

=== dhclient for veth5@netns5

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth5/00:de:ad:11:22:05
Sending on   LPF/veth5/00:de:ad:11:22:05
Sending on   Socket/fallback
DHCPDISCOVER on veth5 to 255.255.255.255 port 67 interval 7 (xid=0x312f1ffd)
DHCPREQUEST on veth5 to 255.255.255.255 port 67 (xid=0x312f1ffd)
DHCPOFFER from 172.16.1.254
DHCPACK from 172.16.1.254 (xid=0x312f1ffd)
bound to 172.16.1.251 -- renewal in 1552 seconds.

=== dhclient for veth6@netns6

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth6/00:de:ad:11:22:06
Sending on   LPF/veth6/00:de:ad:11:22:06
Sending on   Socket/fallback
DHCPDISCOVER on veth6 to 255.255.255.255 port 67 interval 6 (xid=0x230ea362)
DHCPREQUEST on veth6 to 255.255.255.255 port 67 (xid=0x230ea362)
DHCPOFFER from 172.16.1.254
DHCPACK from 172.16.1.254 (xid=0x230ea362)
bound to 172.16.1.253 -- renewal in 1375 seconds.

=== dhclient for veth7@netns7

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth7/00:de:ad:11:22:07
Sending on   LPF/veth7/00:de:ad:11:22:07
Sending on   Socket/fallback
DHCPDISCOVER on veth7 to 255.255.255.255 port 67 interval 4 (xid=0x4328d8af)
DHCPREQUEST on veth7 to 255.255.255.255 port 67 (xid=0x4328d8af)
DHCPOFFER from 172.16.1.254
DHCPACK from 172.16.1.254 (xid=0x4328d8af)
bound to 172.16.1.254 -- renewal in 1639 seconds.

=== dhclient for veth8@netns8

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth8/00:de:ad:11:22:08
Sending on   LPF/veth8/00:de:ad:11:22:08
Sending on   Socket/fallback
DHCPDISCOVER on veth8 to 255.255.255.255 port 67 interval 8 (xid=0x611b077b)
DHCPDISCOVER on veth8 to 255.255.255.255 port 67 interval 18 (xid=0x611b077b)
DHCPDISCOVER on veth8 to 255.255.255.255 port 67 interval 7 (xid=0x611b077b)
DHCPDISCOVER on veth8 to 255.255.255.255 port 67 interval 14 (xid=0x611b077b)
DHCPDISCOVER on veth8 to 255.255.255.255 port 67 interval 14 (xid=0x611b077b)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

=== dhclient for veth9@netns9

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth9/00:de:ad:11:22:09
Sending on   LPF/veth9/00:de:ad:11:22:09
Sending on   Socket/fallback
DHCPDISCOVER on veth9 to 255.255.255.255 port 67 interval 3 (xid=0x43c12afa)
DHCPDISCOVER on veth9 to 255.255.255.255 port 67 interval 7 (xid=0x43c12afa)
DHCPDISCOVER on veth9 to 255.255.255.255 port 67 interval 13 (xid=0x43c12afa)
DHCPDISCOVER on veth9 to 255.255.255.255 port 67 interval 8 (xid=0x43c12afa)
DHCPDISCOVER on veth9 to 255.255.255.255 port 67 interval 14 (xid=0x43c12afa)
DHCPDISCOVER on veth9 to 255.255.255.255 port 67 interval 10 (xid=0x43c12afa)
DHCPDISCOVER on veth9 to 255.255.255.255 port 67 interval 6 (xid=0x43c12afa)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

=== dhclient for veth10@netns10

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth10/00:de:ad:11:22:10
Sending on   LPF/veth10/00:de:ad:11:22:10
Sending on   Socket/fallback
DHCPDISCOVER on veth10 to 255.255.255.255 port 67 interval 5 (xid=0x5db3ea61)
DHCPDISCOVER on veth10 to 255.255.255.255 port 67 interval 7 (xid=0x5db3ea61)
DHCPDISCOVER on veth10 to 255.255.255.255 port 67 interval 16 (xid=0x5db3ea61)
DHCPDISCOVER on veth10 to 255.255.255.255 port 67 interval 17 (xid=0x5db3ea61)
DHCPDISCOVER on veth10 to 255.255.255.255 port 67 interval 16 (xid=0x5db3ea61)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

=== dhclient for veth11@netns11

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth11/00:de:ad:11:22:11
Sending on   LPF/veth11/00:de:ad:11:22:11
Sending on   Socket/fallback
DHCPDISCOVER on veth11 to 255.255.255.255 port 67 interval 5 (xid=0x25e1eb7a)
DHCPDISCOVER on veth11 to 255.255.255.255 port 67 interval 12 (xid=0x25e1eb7a)
DHCPDISCOVER on veth11 to 255.255.255.255 port 67 interval 15 (xid=0x25e1eb7a)
DHCPDISCOVER on veth11 to 255.255.255.255 port 67 interval 16 (xid=0x25e1eb7a)
DHCPDISCOVER on veth11 to 255.255.255.255 port 67 interval 13 (xid=0x25e1eb7a)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

=== dhclient for veth12@netns12

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth12/00:de:ad:11:22:12
Sending on   LPF/veth12/00:de:ad:11:22:12
Sending on   Socket/fallback
DHCPDISCOVER on veth12 to 255.255.255.255 port 67 interval 4 (xid=0x67e7714e)
DHCPDISCOVER on veth12 to 255.255.255.255 port 67 interval 9 (xid=0x67e7714e)
DHCPDISCOVER on veth12 to 255.255.255.255 port 67 interval 13 (xid=0x67e7714e)
DHCPDISCOVER on veth12 to 255.255.255.255 port 67 interval 20 (xid=0x67e7714e)
DHCPDISCOVER on veth12 to 255.255.255.255 port 67 interval 12 (xid=0x67e7714e)
DHCPDISCOVER on veth12 to 255.255.255.255 port 67 interval 3 (xid=0x67e7714e)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

=== dhclient for veth13@netns13

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth13/00:de:ad:11:22:13
Sending on   LPF/veth13/00:de:ad:11:22:13
Sending on   Socket/fallback
DHCPDISCOVER on veth13 to 255.255.255.255 port 67 interval 3 (xid=0x4bdcf859)
DHCPDISCOVER on veth13 to 255.255.255.255 port 67 interval 3 (xid=0x4bdcf859)
DHCPDISCOVER on veth13 to 255.255.255.255 port 67 interval 4 (xid=0x4bdcf859)
DHCPDISCOVER on veth13 to 255.255.255.255 port 67 interval 6 (xid=0x4bdcf859)
DHCPDISCOVER on veth13 to 255.255.255.255 port 67 interval 10 (xid=0x4bdcf859)
DHCPDISCOVER on veth13 to 255.255.255.255 port 67 interval 11 (xid=0x4bdcf859)
DHCPDISCOVER on veth13 to 255.255.255.255 port 67 interval 17 (xid=0x4bdcf859)
DHCPDISCOVER on veth13 to 255.255.255.255 port 67 interval 7 (xid=0x4bdcf859)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

=== dhclient for veth14@netns14

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth14/00:de:ad:11:22:14
Sending on   LPF/veth14/00:de:ad:11:22:14
Sending on   Socket/fallback
DHCPDISCOVER on veth14 to 255.255.255.255 port 67 interval 3 (xid=0x2dd896ab)
DHCPDISCOVER on veth14 to 255.255.255.255 port 67 interval 7 (xid=0x2dd896ab)
DHCPDISCOVER on veth14 to 255.255.255.255 port 67 interval 16 (xid=0x2dd896ab)
DHCPDISCOVER on veth14 to 255.255.255.255 port 67 interval 12 (xid=0x2dd896ab)
DHCPDISCOVER on veth14 to 255.255.255.255 port 67 interval 13 (xid=0x2dd896ab)
DHCPDISCOVER on veth14 to 255.255.255.255 port 67 interval 10 (xid=0x2dd896ab)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

=== dhclient for veth15@netns15

Internet Systems Consortium DHCP Client 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/veth15/00:de:ad:11:22:15
Sending on   LPF/veth15/00:de:ad:11:22:15
Sending on   Socket/fallback
DHCPDISCOVER on veth15 to 255.255.255.255 port 67 interval 5 (xid=0xfbcdc67)
DHCPDISCOVER on veth15 to 255.255.255.255 port 67 interval 12 (xid=0xfbcdc67)
DHCPDISCOVER on veth15 to 255.255.255.255 port 67 interval 12 (xid=0xfbcdc67)
DHCPDISCOVER on veth15 to 255.255.255.255 port 67 interval 11 (xid=0xfbcdc67)
DHCPDISCOVER on veth15 to 255.255.255.255 port 67 interval 14 (xid=0xfbcdc67)
DHCPDISCOVER on veth15 to 255.255.255.255 port 67 interval 7 (xid=0xfbcdc67)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
[root@dell-per730-26 images]#


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