diff options
| author | Daniil Baturin <daniil@baturin.org> | 2019-07-23 07:25:31 -0400 |
|---|---|---|
| committer | Daniil Baturin <daniil@baturin.org> | 2019-07-23 07:25:31 -0400 |
| commit | 2e3ce45a0218a626434891ba3db16d977fbf8f0e (patch) | |
| tree | 24ecc077759c0dfc8bc557915cb5002d2fae0385 /scripts/vyatta-interfaces.pl | |
| parent | 0beae43d41a6bd8e1997c7a0013fb9263d7774f9 (diff) | |
| parent | 995b5071d15f0a5a9d8c5f261f188e5252a966a4 (diff) | |
| download | vyatta-cfg-system-2e3ce45a0218a626434891ba3db16d977fbf8f0e.tar.gz vyatta-cfg-system-2e3ce45a0218a626434891ba3db16d977fbf8f0e.zip | |
Merge branch 'current' into equuleus
Diffstat (limited to 'scripts/vyatta-interfaces.pl')
| -rwxr-xr-x | scripts/vyatta-interfaces.pl | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 808015fd..f6fa717a 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -157,16 +157,41 @@ sub get_mtu { return $intf->mtu(); } +sub get_dhcp_client_id { + my $name = shift; + my $intf = new Vyatta::Interface($name); + my $config = new Vyatta::Config; + $config->setLevel($intf->path()); + return $config->returnValue("dhcp-options client-id"); +} + +sub get_dhcp_hostname { + my $name = shift; + my $intf = new Vyatta::Interface($name); + my $config = new Vyatta::Config; + $config->setLevel($intf->path()); + return $config->returnValue("dhcp-options host-name"); +} + sub dhcp_update_config { my ($conf_file, $intf) = @_; my $output = dhcp_conf_header(); - my $hostname = get_hostname(); + my $hostname = get_dhcp_hostname($intf); + if (!defined($hostname)) { + $hostname = get_hostname(); + } $output .= "interface \"$intf\" {\n"; if (defined($hostname)) { $output .= "\tsend host-name \"$hostname\";\n"; } + + my $client_id = get_dhcp_client_id($intf); + if (defined($client_id)) { + $output .= "\tsend dhcp-client-identifier \"$client_id\";\n"; + } + $output .= "\trequest subnet-mask, broadcast-address, routers, domain-name-servers"; my $domainname = is_domain_name_set(); if (!defined($domainname)) { |
