Created
December 30, 2015 21:57
-
-
Save jflemer-ndp/8806b38759c6169d71d5 to your computer and use it in GitHub Desktop.
junos legacy dhcp to extended dhcp conversion for static reservations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
$i = "FOO"; | |
$p = "BAR"; | |
while(<>){ | |
if(m/system services dhcp static-binding (\S*) (\S*) (\S*)/){$d{$1}->{$2}=$3} | |
} | |
map { | |
printf("set routing-instances $i access address-assignment pool $p family inet host %s hardware-address %s\n", $d{$_}->{"host-name"}, $_); | |
printf("set routing-instances $i access address-assignment pool $p family inet host %s ip-address %s\n", $d{$_}->{"host-name"}, $d{$_}->{"fixed-address"}); | |
} keys %d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment