From 0837656285fb42a851f756af645e3d2666a5546a Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 19 Feb 2013 20:10:45 +0000 Subject: add support for MACADDR and ETHTOOL_OPTS (Oden Eriksson, mga#8811) --- lib/network/connection.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/network/connection.pm') diff --git a/lib/network/connection.pm b/lib/network/connection.pm index c0c39a9..c92eb87 100644 --- a/lib/network/connection.pm +++ b/lib/network/connection.pm @@ -148,6 +148,9 @@ sub load_interface_settings { $self->{control}{userctl} = $self->get_ifcfg_bool('USERCTL'); $self->{control}{metric} = $self->{ifcfg}{METRIC}; $self->{control}{mtu} = $self->{ifcfg}{MTU}; + $self->{control}{macaddr} = $self->{ifcfg}{MACADDR}; + $self->{control}{hwaddr} = $self->{ifcfg}{HWADDR}; + $self->{control}{ethtool_opts} = $self->{ifcfg}{ETHTOOL_OPTS}; $self->{control}{accounting} = $self->get_ifcfg_bool('ACCOUNTING'); $self->{control}{nm_controlled} = $self->get_ifcfg_bool('NM_CONTROLLED'); $self->{control}{uuid} = $self->{ifcfg}{UUID}; @@ -250,6 +253,12 @@ sub get_control_settings { { label => N("Metric"), val => \$self->{control}{metric}, advanced => 1 }, { label => N("MTU"), val => \$self->{control}{mtu}, advanced => 1, help => N("Maximum size of network message (MTU). If unsure, left blank.") }, + { label => N("MACADDR"), val => \$self->{control}{macaddr}, advanced => 1, + help => N("Use a fake MAC address. If unset, uses HWADDR or default.") }, + { label => N("HWADDR"), val => \$self->{control}{hwaddr}, advanced => 1, + help => N("Set the MAC address. If unset, uses default.") }, + { label => N("ETHTOOL_OPTS"), val => \$self->{control}{ethtool_opts}, advanced => 1, + help => N("Use ethtool to pass options to the NIC. eg. \"autoneg off wol g\"") }, ]; } @@ -263,6 +272,9 @@ sub build_ifcfg_settings { USERCTL => bool2yesno($self->{control}{userctl}), METRIC => $self->{control}{metric}, MTU => $self->{control}{mtu}, + MACADDR => $self->{control}{macaddr}, + HWADDR => $self->{control}{hwaddr}, + ETHTOOL_OPTS => $self->{control}{ethtool_opts}, UUID => $self->{control}{uuid}, NAME => $self->{control}{name}, LAST_CONNECT => $self->{control}{last_connect}, -- cgit v1.2.1