Changeset 2299


Ignore:
Timestamp:
11/26/19 16:21:33 (5 years ago)
Author:
nanardon
Message:

Ensure dhcp host are unique

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/Changes

    r2131 r2299  
    115.2.25 
     2    - Ensure host declaration in DHCP config are unique 
    23 
    345.2.24 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildnet.pm

    r2186 r2299  
    645645    my $output = ''; 
    646646 
     647    my $ZoneId = sprintf('%04x', $outzone->get_attributes('ikey')); 
     648 
    647649    my @net; 
    648650    if ($outzone->get_attributes('net')) { 
     
    715717                    my $fmac = $mac; 
    716718                    $fmac =~ s/://g; 
    717                     $output .= sprintf("host %s-%s%s {\n", $nethost, lc($fmac), $label); 
     719                    $output .= sprintf("host %s-%s-%s%s {\n", $nethost, lc($fmac), $ZoneId, $label); 
    718720                    $output .= sprintf("    hardware ethernet %s;\n", $mac); 
    719721                    if ($obj->get_attributes('netLocked')) { 
     
    800802 
    801803                    if ($ipv4) { 
    802                         $output .= sprintf("host %s-%s {\n", $nethost, lc($fmac)); 
     804                        $output .= sprintf("host %s-%s-%s {\n", $nethost, lc($fmac), $ZoneId); 
    803805                        $output .= sprintf("    hardware ethernet %s;\n", $mac); 
    804806                        $output .= sprintf("    fixed-address 127.0.0.1;\n"); 
     
    806808                    } 
    807809                    if ($ipv6) { 
    808                         $output .= sprintf("host %s-%s {\n", $nethost, lc($fmac)); 
     810                        $output .= sprintf("host %s-%s-%s {\n", $nethost, lc($fmac), $ZoneId); 
    809811                        $output .= sprintf("    hardware ethernet %s;\n", $mac); 
    810812                        $output .= sprintf("    fixed-address6 ::1\n"); 
     
    812814                    } 
    813815                } else { 
    814                     $output .= sprintf("host %s-%s {\n", $nethost, lc($fmac)); 
     816                    $output .= sprintf("host %s-%s-%s {\n", $nethost, lc($fmac), $ZoneId); 
    815817                    $output .= sprintf("    hardware ethernet %s;\n", $mac); 
    816818                    $output .= "}\n\n"; 
Note: See TracChangeset for help on using the changeset viewer.