Skip to content

Virtual Router DHCP is not properly configured #262

@baby-gnu

Description

@baby-gnu

Problem

The DNS and default route are not announced

To reproduce

  1. Configure 2 networks A and B,
  2. Start a virtual router
    1. plug first interface to network A
    2. plug second interface to network B
    3. enable DHCPv4
    4. set DHCP on interface eth1
    5. enable DNS
    6. set DNS on interface eth1
    7. start the router

DHCPv4 configuration

/etc/one-appliance/service.d/VRouter/DHCP4v2/coredhcp-onelease/onelease-config.yml
---
eth1:
  server4:
    listen:
    - "%eth1"
    plugins:
    - lease_time: 3600s
    - server_id: 10.4.2.100
    - mtu: 1500
    - netmask: 255.0.0.0
    - onelease: leases-eth1.sqlite3 10.0.0.2 10.255.255.254 3600s --excluded-ips 10.4.2.100
        --mac2ip --mac2ip-prefix 02:00

Proposal

When DHCP is enabled:

Workaround

Set ONEAPP_VNF_DHCP4_GATEWAY and ONEAPP_VNF_DHCP4_DNS manually after the router is started which result in the following configuration

/etc/one-appliance/service.d/VRouter/DHCP4v2/coredhcp-onelease/onelease-config.yml
---
eth1:
  server4:
    listen:
    - "%eth1"
    plugins:
    - lease_time: 3600s
    - server_id: 10.4.2.100
    - dns: 10.4.2.100
    - mtu: 1500
    - router: 10.4.2.100
    - netmask: 255.0.0.0
    - onelease: leases-eth1.sqlite3 10.0.0.2 10.255.255.254 3600s --excluded-ips 10.4.2.100
        --mac2ip --mac2ip-prefix 02:00
Diff between default and modified configuration
--- /etc/one-appliance/service.d/VRouter/DHCP4v2/coredhcp-onelease/onelease-config.yml.orig
+++ /etc/one-appliance/service.d/VRouter/DHCP4v2/coredhcp-onelease/onelease-config.yml
@@ -6,7 +6,9 @@
     plugins:
     - lease_time: 3600s
     - server_id: 10.4.2.100
+    - dns: 10.4.2.100
     - mtu: 1500
+    - router: 10.4.2.100
     - netmask: 255.0.0.0
     - onelease: leases-eth1.sqlite3 10.0.0.2 10.255.255.254 3600s --excluded-ips 10.4.2.100
         --mac2ip --mac2ip-prefix 02:00

Metadata

Metadata

Assignees

Labels

communityIssue created by OpenNebula Community

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions