diff options
Diffstat (limited to 'src/lib/connections')
-rw-r--r-- | src/lib/connections/tunnel | 7 | ||||
-rw-r--r-- | src/lib/connections/tuntap | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/lib/connections/tunnel b/src/lib/connections/tunnel index a14f96e..ab62cc7 100644 --- a/src/lib/connections/tunnel +++ b/src/lib/connections/tunnel @@ -8,13 +8,10 @@ tunnel_up() { if is_interface "$Interface"; then report_error "Interface '$Interface' already exists" return 1 - else - ip tunnel add "$Interface" mode "$Mode" remote "$Remote" fi - if [[ -n "$Local" ]]; then - ip tunnel change "$Interface" local "$Local" - fi + ip tunnel add "$Interface" mode "$Mode" remote "$Remote" \ + ${Local+local "$Local"} bring_interface_up "$Interface" ip_set diff --git a/src/lib/connections/tuntap b/src/lib/connections/tuntap index 149c842..2c00839 100644 --- a/src/lib/connections/tuntap +++ b/src/lib/connections/tuntap @@ -8,10 +8,11 @@ tuntap_up() { if is_interface "$Interface"; then report_error "Interface '$Interface' already exists" return 1 - else - ip tuntap add dev "$Interface" mode "$Mode" \ - ${User:+user "$User"} ${Group:+group "$Group"} fi + + ip tuntap add dev "$Interface" mode "$Mode" \ + ${User:+user "$User"} ${Group:+group "$Group"} + bring_interface_up "$Interface" IP=${IP-no} ip_set } |