summaryrefslogtreecommitdiff
path: root/src/conf_mode/interface-ethernet.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-23 07:59:45 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-23 07:59:45 +0200
commite635223f3dbf244e528cdfe6ae867006143052a7 (patch)
tree13a2adbfde57f64d72ceaec17e8333cb3063a0dd /src/conf_mode/interface-ethernet.py
parentb6c8ba61582d38c72b13c549e2a0699db7d553fd (diff)
downloadvyos-1x-e635223f3dbf244e528cdfe6ae867006143052a7.tar.gz
vyos-1x-e635223f3dbf244e528cdfe6ae867006143052a7.zip
ethernet: T1637: bugfix DHCP - interface must be up prior starting DHCP client
It is not possible to enable DHCP client on an interface that is down. Thus the code which enables the interface must be placed in front of assigning all interface addresses, static or DHCP. s the commit.
Diffstat (limited to 'src/conf_mode/interface-ethernet.py')
-rwxr-xr-xsrc/conf_mode/interface-ethernet.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/conf_mode/interface-ethernet.py b/src/conf_mode/interface-ethernet.py
index f82105847..5d597fd0a 100755
--- a/src/conf_mode/interface-ethernet.py
+++ b/src/conf_mode/interface-ethernet.py
@@ -316,6 +316,12 @@ def apply(eth):
# Set physical interface speed and duplex
e.set_speed_duplex(eth['speed'], eth['duplex'])
+ # Enable/Disable interface
+ if eth['disable']:
+ e.state = 'down'
+ else:
+ e.state = 'up'
+
# Configure interface address(es)
# - not longer required addresses get removed first
# - newly addresses will be added second
@@ -324,12 +330,6 @@ def apply(eth):
for addr in eth['address']:
e.add_addr(addr)
- # Enable/Disable interface
- if eth['disable']:
- e.state = 'down'
- else:
- e.state = 'up'
-
# remove no longer required service VLAN interfaces (vif-s)
for vif_s in eth['vif_s_remove']:
e.del_vlan(vif_s)