# IP Address Not Allocated To Instance by DHCP

## Problem

* Instance fails to receive IP address from the DHCP server after a reboot.
* Packet capture on the tap device of the instance and the bond0 interface shows the Broadcast Request is leaving the tap device but no packets are seen on the bond0 interface.

{% tabs %}
{% tab title="None" %}

```none
$ sudo tcpdump -nnei tapf6715be8-f9
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tapf6715be8-f9, link-type EN10MB (Ethernet), capture size 262144 bytes
fa:16:3e:24:98:2b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from fa:16:3e:24:98:2b, length 300
fa:16:3e:24:98:2b > 33:33:00:01:00:02, ethertype IPv6 (0x86dd), length 157: fe80::ec0c:f912:fd0a:e575.546 > ff02::1:2.547: dhcp6 solicit
fa:16:3e:24:98:2b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from fa:16:3e:24:98:2b, length 300
```

{% endtab %}
{% endtabs %}

* Packet capture on bond0 interface.

{% tabs %}
{% tab title="None" %}

```none
$ sudo tcpdump -nnei bond0 ether host fa:16:3e:24:98:2b
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on bond0, link-type EN10MB (Ethernet), capture size 262144 bytes
```

{% endtab %}
{% endtabs %}

## Environment

* Platform9 Managed OpenStack - v3.6.0 and Higher

## Cause

There is no physical interface connected to the Bridge br-vlan.

{% tabs %}
{% tab title="None" %}

```none
$ sudo ovs-vsctl show
2ddf08e3-0a83-4ab7-ba2d-fa91b9bdaa64
    Manager "ptcp:6640:127.0.0.1"
        is_connected: true
    Bridge br-vlan
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        Port br-vlan
            Interface br-vlan
                type: internal
        Port phy-br-vlan
            Interface phy-br-vlan
                type: patch
                options: {peer=int-br-vlan}
```

{% endtab %}
{% endtabs %}

## Resolution

1. Add the interface (bond 0) to the bridge (br-vlan).

{% tabs %}
{% tab title="None" %}

```none
$ sudo ovs-vsctl add-port br-vlan bond0
```

{% endtab %}
{% endtabs %}

2. After adding the interface, force the instance to renew the IP address from DHCP.

{% tabs %}
{% tab title="None" %}

```none
$ ipconfig /renew
```

{% endtab %}
{% endtabs %}

3. Following is the packet capture of the instance on the tap device and we can see that the DORA process for DHCP completed successfully.

{% tabs %}
{% tab title="None" %}

```none
$ sudo tcpdump -nnei tapf6715be8-f9
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tapf6715be8-f9, link-type EN10MB (Ethernet), capture size 262144 bytes 02:26:38.049123 fa:16:3e:24:98:2b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from fa:16:3e:24:98:2b, length 300
fa:16:3e:4e:b7:41 > fa:16:3e:24:98:2b, ethertype IPv4 (0x0800), length 391: 172.16.232.1.67 > 172.16.232.28.68: BOOTP/DHCP, Reply, length 349
fa:16:3e:0d:c2:71 > fa:16:3e:24:98:2b, ethertype IPv4 (0x0800), length 391: 172.16.232.0.67 > 172.16.232.28.68: BOOTP/DHCP, Reply, length 349
fa:16:3e:8c:f5:01 > fa:16:3e:24:98:2b, ethertype IPv4 (0x0800), length 391: 172.16.232.2.67 > 172.16.232.28.68: BOOTP/DHCP, Reply, length 349
fa:16:3e:24:98:2b > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 369: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from fa:16:3e:24:98:2b, length 327
fa:16:3e:0d:c2:71 > fa:16:3e:24:98:2b, ethertype IPv4 (0x0800), length 465: 172.16.232.0.67 > 172.16.232.28.68: BOOTP/DHCP, Reply, length 423
```

{% endtab %}
{% endtabs %}
