Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
re6stnet
Commits
8cba4e19
Commit
8cba4e19
authored
Jul 04, 2012
by
Guillaume Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-added openvpn-args
parent
cb4cb822
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
main.py
main.py
+9
-8
openvpn.py
openvpn.py
+14
-7
No files found.
main.py
View file @
8cba4e19
...
...
@@ -5,7 +5,6 @@ import openvpn
VIFIB_NET
=
"2001:db8:42::/48"
# TODO : How do we get our vifib ip ?
def
babel
(
network_ip
,
network_mask
,
verbose_level
):
...
...
@@ -31,14 +30,17 @@ def getConfig():
global
config
parser
=
argparse
.
ArgumentParser
(
description
=
'Resilient virtual private network application'
)
_
=
parser
.
add_argument
_
(
'--dh'
,
required
=
True
,
help
=
'Path to dh file'
)
_
(
'--babel-state'
,
help
=
'Path to babeld state-
file'
)
_
(
'--
verbose'
,
'-v'
,
default
=
'0'
,
help
=
'Defines the verbose level'
)
_
(
'--ca'
,
required
=
True
,
help
=
'Path to the certificate authority
'
)
_
(
'--
key'
,
required
=
True
,
help
=
'Path to the rsa_key'
)
_
(
'--cert'
,
required
=
True
,
help
=
'Pah to the certificate
'
)
_
(
'--dh'
,
required
=
True
,
help
=
'Path to dh
file'
)
_
(
'--
babel-state'
,
help
=
'Path to babeld state-file
'
)
_
(
'--
verbose'
,
'-v'
,
default
=
'0'
,
help
=
'Defines the verbose level
'
)
# Temporary args
_
(
'--ip'
,
required
=
True
,
help
=
'IPv6 of the server'
)
# Openvpn options
_
(
'openvpn_args'
,
nargs
=
argparse
.
REMAINDER
,
help
=
"Common OpenVPN options (e.g. certificates)"
)
config
=
parser
.
parse_args
()
...
...
@@ -48,7 +50,6 @@ def main():
serverProcess
=
openvpn
.
server
(
config
,
config
.
ip
)
else
:
client1Process
=
openvpn
.
client
(
config
,
'10.1.4.2'
)
if
__name__
==
"__main__"
:
main
()
...
...
openvpn.py
View file @
8cba4e19
import
subprocess
def
openvpn
(
config
,
*
args
):
def
openvpn
(
config
,
*
args
):
args
=
[
'openvpn'
,
'--dev'
,
'tap'
,
'--ca'
,
config
.
ca
,
...
...
@@ -12,8 +12,15 @@ def openvpn(config, *args):
'--user'
,
'nobody'
,
'--group'
,
'nogroup'
,
'--verb'
,
config
.
verbose
]
+
list
(
args
)
return
subprocess
.
Popen
(
args
)
]
+
list
(
args
)
+
config
.
openvpn_args
#stdin = kw.pop('stdin', None)
#stdout = kw.pop('stdout', None)
#stderr = kw.pop('stderr', None)
#for i in kw.iteritems():
# args.append('--%s=%s' % i)
return
subprocess
.
Popen
(
args
#stdin=stdin, stdout=stdout, stderr=stderr,
)
# TODO : set iface up when creating a server/client
# ! check working directory before launching up script ?
...
...
@@ -29,8 +36,8 @@ def server(config, ip):
def
client
(
config
,
serverIp
):
return
openvpn
(
config
,
'--nobind'
,
'--tls-client'
,
'--remote'
,
serverIp
,
'--up'
,
'up-client'
)
'--nobind'
,
'--tls-client'
,
'--remote'
,
serverIp
,
'--up'
,
'up-client'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment