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
d19b9e2b
Commit
d19b9e2b
authored
Jul 17, 2012
by
Ulysse Beaugnon
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.erp5.org/repos/vifibnet
Conflicts: vifibnet.py
parents
e25ef3f0
e3464a00
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
34 deletions
+29
-34
openvpn-route-up
openvpn-route-up
+0
-0
openvpn-server-events
openvpn-server-events
+0
-0
openvpn-up-client
openvpn-up-client
+0
-0
openvpn-up-server
openvpn-up-server
+0
-0
openvpn.py
openvpn.py
+27
-5
vifibnet.py
vifibnet.py
+2
-29
No files found.
route-up
→
openvpn-
route-up
View file @
d19b9e2b
File moved
client-connect
→
openvpn-server-events
View file @
d19b9e2b
File moved
up-client
→
openvpn-
up-client
View file @
d19b9e2b
File moved
up-server
→
openvpn-
up-server
View file @
d19b9e2b
File moved
openvpn.py
View file @
d19b9e2b
...
...
@@ -29,9 +29,9 @@ def server(ip, pipe_fd, *args, **kw):
return
openvpn
(
'--tls-server'
,
'--mode'
,
'server'
,
'--up'
,
'up-server %s/%u'
%
(
ip
,
len
(
utils
.
config
.
vifibnet
)),
'--client-connect'
,
'
client-connect
'
+
str
(
pipe_fd
),
'--client-disconnect'
,
'
client-connect
'
+
str
(
pipe_fd
),
'--up'
,
'
openvpn-
up-server %s/%u'
%
(
ip
,
len
(
utils
.
config
.
vifibnet
)),
'--client-connect'
,
'
openvpn-server-events
'
+
str
(
pipe_fd
),
'--client-disconnect'
,
'
openvpn-server-events
'
+
str
(
pipe_fd
),
'--dh'
,
utils
.
config
.
dh
,
'--max-clients'
,
str
(
utils
.
config
.
max_clients
),
*
args
,
**
kw
)
...
...
@@ -41,7 +41,29 @@ def client(serverIp, pipe_fd, *args, **kw):
'--nobind'
,
'--client'
,
'--remote'
,
serverIp
,
'--up'
,
'up-client'
,
'--route-up'
,
'route-up '
+
str
(
pipe_fd
),
'--up'
,
'
openvpn-
up-client'
,
'--route-up'
,
'
openvpn-
route-up '
+
str
(
pipe_fd
),
*
args
,
**
kw
)
def
startBabel
(
**
kw
):
args
=
[
'babeld'
,
'-C'
,
'redistribute local ip %s'
%
(
utils
.
config
.
internal_ip
),
'-C'
,
'redistribute local deny'
,
# Route VIFIB ip adresses
'-C'
,
'in ip %s::/%u'
%
(
utils
.
ipFromBin
(
utils
.
config
.
vifibnet
),
len
(
utils
.
config
.
vifibnet
)),
# Route only addresse in the 'local' network,
# or other entire networks
#'-C', 'in ip %s' % (config.internal_ip),
#'-C', 'in ip ::/0 le %s' % network_mask,
# Don't route other addresses
'-C'
,
'in deny'
,
'-d'
,
str
(
utils
.
config
.
verbose
),
'-s'
,
]
if
utils
.
config
.
babel_state
:
args
+=
'-S'
,
utils
.
config
.
babel_state
args
=
args
+
[
'vifibnet'
]
+
list
(
tunnelmanager
.
free_interface_set
)
if
utils
.
config
.
verbose
>=
5
:
print
args
return
subprocess
.
Popen
(
args
,
**
kw
)
vifibnet.py
View file @
d19b9e2b
#!/usr/bin/env python
import
argparse
,
errno
,
math
,
os
,
select
,
subprocess
,
sys
,
time
import
argparse
,
errno
,
math
,
os
,
select
,
subprocess
,
sys
,
time
,
traceback
from
OpenSSL
import
crypto
import
traceback
import
upnpigd
import
openvpn
import
utils
import
db
import
tunnelmanager
def
startBabel
(
**
kw
):
args
=
[
'babeld'
,
'-C'
,
'redistribute local ip %s'
%
(
utils
.
config
.
internal_ip
),
'-C'
,
'redistribute local deny'
,
# Route VIFIB ip adresses
'-C'
,
'in ip %s::/%u'
%
(
utils
.
ipFromBin
(
utils
.
config
.
vifibnet
),
len
(
utils
.
config
.
vifibnet
)),
# Route only addresse in the 'local' network,
# or other entire networks
#'-C', 'in ip %s' % (config.internal_ip),
#'-C', 'in ip ::/0 le %s' % network_mask,
# Don't route other addresses
'-C'
,
'in deny'
,
'-d'
,
str
(
utils
.
config
.
verbose
),
'-s'
,
]
if
utils
.
config
.
babel_state
:
args
+=
'-S'
,
utils
.
config
.
babel_state
args
=
args
+
[
'vifibnet'
]
+
list
(
tunnelmanager
.
free_interface_set
)
if
utils
.
config
.
verbose
>=
5
:
print
args
return
subprocess
.
Popen
(
args
,
**
kw
)
import
db
,
openvpn
,
upnpigd
,
utils
,
tunnelmanager
def
handle_message
(
msg
):
script_type
,
arg
=
msg
.
split
()
...
...
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