[S] Change in openvpn[master]: options: make `tun` the default for `--dev`
"ordex \(Code Review\) via Openvpn-devel" <[email protected]>
| Newsgroups | gmane.network.openvpn.devel |
|---|---|
| Message-ID | <b112f14f78374d50d3c64a23d4430e318f030695-EmailReplacePatchSet-HTML@gerrit.openvpn.net> |
Attention is currently required from: flichtenheld, ordex, plaisthos.
Hello flichtenheld, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1537?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Code-Review+1 by plaisthos, Code-Review-1 by flichtenheld
Change subject: options: make `tun` the default for `--dev`
......................................................................
options: make `tun` the default for `--dev`
With this change, OpenVPN can be launched without specifying
any --dev option and it will start a `tun` (L3) tunnel with the
interface named `tunX`.
As before, this behaviour can be changed using --dev or --dev-type.
Existing configs won't see any behavioural change as they all
had to contain at least one --dev directive.
Change-Id: I0ca7b5b7ec1a01acaad222c99db137c94c88555a
Signed-off-by: Antonio Quartulli <[email protected]>
---
M doc/man-sections/examples.rst
M doc/man-sections/vpn-network-options.rst
M sample/sample-config-files/client.conf
M sample/sample-config-files/server.conf
M src/openvpn/options.c
5 files changed, 15 insertions(+), 1 deletion(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/37/1537/3
diff --git a/doc/man-sections/examples.rst b/doc/man-sections/examples.rst
index 80ef2df..416e576 100644
--- a/doc/man-sections/examples.rst
+++ b/doc/man-sections/examples.rst
@@ -63,6 +63,10 @@
Example 1: A simple tunnel without security (not recommended)
-------------------------------------------------------------
+Since :code:`tun` is the default device type, ``--dev`` is optional; when it
+is omitted OpenVPN creates a dynamically-named ``tunX`` device. The examples
+below still name the device (``--dev tun1``) explicitly for clarity.
+
On bob::
openvpn --remote alice.example.com --dev tun1 \
diff --git a/doc/man-sections/vpn-network-options.rst b/doc/man-sections/vpn-network-options.rst
index 33ebedb..960c6ad 100644
--- a/doc/man-sections/vpn-network-options.rst
+++ b/doc/man-sections/vpn-network-options.rst
@@ -50,6 +50,10 @@
:code:`null` or an arbitrary name string (:code:`X` can be omitted for
a dynamic device.)
+ If neither ``--dev`` nor ``--dev-type`` is specified, OpenVPN defaults to
+ :code:`tun`, i.e. it creates a dynamically-named :code:`tunX` device and
+ runs a layer-3 tunnel.
+
See examples section below for an example on setting up a TUN device.
You must use either tun devices on both ends of the connection or tap
diff --git a/sample/sample-config-files/client.conf b/sample/sample-config-files/client.conf
index 53b8027..1806b24 100644
--- a/sample/sample-config-files/client.conf
+++ b/sample/sample-config-files/client.conf
@@ -20,6 +20,8 @@
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
+# "tun" is the default device type, so the
+# "dev tun" line below is optional.
;dev tap
dev tun
diff --git a/sample/sample-config-files/server.conf b/sample/sample-config-files/server.conf
index 8943c34..924fb96 100644
--- a/sample/sample-config-files/server.conf
+++ b/sample/sample-config-files/server.conf
@@ -49,6 +49,8 @@
# On most systems, the VPN will not function
# unless you partially or fully disable/open
# the firewall for the TUN/TAP interface.
+# "tun" is the default device type, so the
+# "dev tun" line below is optional.
;dev tap
dev tun
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 87218d4..d4cc158 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -189,7 +189,8 @@
" or --socks-proxy"
" is used).\n"
"--nobind : Do not bind to local address and port.\n"
- "--dev tunX|tapX : tun/tap device (X can be omitted for dynamic device.\n"
+ "--dev tunX|tapX : tun/tap device (X can be omitted for dynamic device).\n"
+ " Defaults to \"tun\" if neither --dev nor --dev-type is given.\n"
"--dev-type dt : Which device type are we using? (dt = tun or tap) Use\n"
" this option only if the tun/tap device used with --dev\n"
" does not begin with \"tun\" or \"tap\".\n"
@@ -801,6 +802,7 @@
gc_init(&o->dns_options.gc);
o->mode = MODE_POINT_TO_POINT;
+ o->dev = "tun";
o->topology = TOP_UNDEF;
o->ce.proto = PROTO_UDP;
o->ce.af = AF_UNSPEC;
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1537?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I0ca7b5b7ec1a01acaad222c99db137c94c88555a
Gerrit-Change-Number: 1537
Gerrit-PatchSet: 3
Gerrit-Owner: ordex <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: cron2 <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
Gerrit-Attention: ordex <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel