summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index cc63482de..24a718e73 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -1139,6 +1139,14 @@ class EthernetIf(VLANIf):
.format(self.get_driver_name()))
return
+ # Get current speed and duplex settings:
+ cmd = '/sbin/ethtool {0}'.format(self._ifname)
+ tmp = self._cmd(cmd)
+
+ if re.search("\tAuto-negotiation: on", tmp):
+ if speed == 'auto' or duplex == 'auto':
+ # bail out early as nothing is to change
+ return
cmd = '/sbin/ethtool -s {}'.format(self._ifname)
if speed == 'auto' or duplex == 'auto':