summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-24 21:01:42 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-24 21:53:26 +0200
commit3aed7f2dad9326ae094edc94b996db4fce2e0b18 (patch)
treedfea63740a365e5cd8993dea5fa274a632c5ba99 /src
parentf95659216b0816f53bdf5cb8ccc02afff970dd53 (diff)
downloadvyos-1x-3aed7f2dad9326ae094edc94b996db4fce2e0b18.tar.gz
vyos-1x-3aed7f2dad9326ae094edc94b996db4fce2e0b18.zip
openvpn: T1548: setup interface alias
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interface-openvpn.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/conf_mode/interface-openvpn.py b/src/conf_mode/interface-openvpn.py
index fa01f7fc5..57d565749 100755
--- a/src/conf_mode/interface-openvpn.py
+++ b/src/conf_mode/interface-openvpn.py
@@ -29,8 +29,9 @@ from pwd import getpwnam
from subprocess import Popen, PIPE
from time import sleep
-from vyos.config import Config
from vyos import ConfigError
+from vyos.config import Config
+from vyos.ifconfig import Interface
from vyos.validate import is_addr_assigned
user = 'openvpn'
@@ -899,6 +900,13 @@ def apply(openvpn):
# execute assembled command
subprocess_cmd(cmd)
+
+ # better late then sorry ... but we can only set interface alias after
+ # OpenVPN has been launched and created the interface
+ while openvpn['intf'] not in interfaces():
+ sleep(0.250) # 250ms
+ Interface(openvpn['intf']).set_alias(openvpn['description'])
+
return None