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
752cfeea
Commit
752cfeea
authored
Sep 07, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re6stnet: new --main-interface option
parent
8858e886
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
+18
-11
demo/demo
demo/demo
+1
-1
re6stnet
re6stnet
+17
-10
No files found.
demo/demo
View file @
752cfeea
...
@@ -149,7 +149,7 @@ if 1:
...
@@ -149,7 +149,7 @@ if 1:
registry.screen('../re6stnet @registry/re6stnet.conf --ip 10.0.0.2 -v%u' % VERBOSE,
registry.screen('../re6stnet @registry/re6stnet.conf --ip 10.0.0.2 -v%u' % VERBOSE,
'../re6st-registry @registry/re6st-registry.conf -v%u'
'../re6st-registry @registry/re6st-registry.conf -v%u'
' --mailhost %s' % (VERBOSE, os.path.abspath('mbox')))
' --mailhost %s' % (VERBOSE, os.path.abspath('mbox')))
machine1.screen('../re6stnet @m1/re6stnet.conf -v%u
' % VERBOSE
)
machine1.screen('../re6stnet @m1/re6stnet.conf -v%u
-I%s' % (VERBOSE, m1_if_0.name)
)
machine2.screen('../re6stnet @m2/re6stnet.conf -v%u' % VERBOSE)
machine2.screen('../re6stnet @m2/re6stnet.conf -v%u' % VERBOSE)
machine3.screen('../re6stnet @m3/re6stnet.conf -v%u -i%s' % (VERBOSE, m3_if_0.name))
machine3.screen('../re6stnet @m3/re6stnet.conf -v%u -i%s' % (VERBOSE, m3_if_0.name))
machine4.screen('../re6stnet @m4/re6stnet.conf -v%u -i%s' % (VERBOSE, m4_if_0.name))
machine4.screen('../re6stnet @m4/re6stnet.conf -v%u -i%s' % (VERBOSE, m4_if_0.name))
...
...
re6stnet
View file @
752cfeea
...
@@ -32,6 +32,9 @@ def getConfig():
...
@@ -32,6 +32,9 @@ def getConfig():
_
(
'-i'
,
'--interface'
,
action
=
'append'
,
dest
=
'iface_list'
,
default
=
[],
_
(
'-i'
,
'--interface'
,
action
=
'append'
,
dest
=
'iface_list'
,
default
=
[],
help
=
"Extra interface for LAN discovery. Highly recommanded if there"
help
=
"Extra interface for LAN discovery. Highly recommanded if there"
" are other re6st node on the same network segment."
)
" are other re6st node on the same network segment."
)
_
(
'-I'
,
'--main-interface'
,
metavar
=
'IFACE'
,
help
=
"Set re6stnet IP on given interface. Any interface not used for"
" tunnelling can be chosen. (default: first OpenVPN interface)"
)
_
=
parser
.
add_argument_group
(
'routing'
).
add_argument
_
=
parser
.
add_argument_group
(
'routing'
).
add_argument
_
(
'-B'
,
dest
=
'babel_args'
,
metavar
=
'ARG'
,
action
=
'append'
,
default
=
[],
_
(
'-B'
,
dest
=
'babel_args'
,
metavar
=
'ARG'
,
action
=
'append'
,
default
=
[],
...
@@ -183,25 +186,29 @@ def main():
...
@@ -183,25 +186,29 @@ def main():
if
config
.
client
:
if
config
.
client
:
cleanup
.
append
(
plib
.
client
(
're6stnet'
,
config
.
client
,
cleanup
.
append
(
plib
.
client
(
're6stnet'
,
config
.
client
,
config
.
encrypt
,
config
.
encrypt
,
'--up'
,
plib
.
ovpn_server
+
' '
+
my_ip
,
'--up'
,
'%s %s'
%
(
plib
.
ovpn_server
,
None
if
config
.
main_interface
else
my_ip
),
'--ping-restart'
,
str
(
4
*
config
.
hello
),
'--ping-restart'
,
str
(
4
*
config
.
hello
),
*
config
.
openvpn_args
).
kill
)
*
config
.
openvpn_args
).
kill
)
elif
server_tunnels
:
elif
server_tunnels
:
required
(
'dh'
)
required
(
'dh'
)
for
iface
,
(
port
,
proto
)
in
server_tunnels
.
iteritems
():
for
iface
,
(
port
,
proto
)
in
server_tunnels
.
iteritems
():
cleanup
.
append
(
plib
.
server
(
iface
,
cleanup
.
append
(
plib
.
server
(
iface
,
None
my_ip
if
proto
==
pp
[
0
][
1
]
else
None
,
if
config
.
main_interface
or
proto
!=
pp
[
0
][
1
]
config
.
max_clients
,
config
.
dh
,
write_pipe
,
port
,
else
my_ip
,
config
.
max_clients
,
config
.
dh
,
write_pipe
,
proto
,
config
.
encrypt
,
*
config
.
openvpn_args
).
kill
)
port
,
proto
,
config
.
encrypt
,
*
config
.
openvpn_args
).
kill
)
elif
config
.
iface_list
:
elif
config
.
iface_list
and
not
config
.
main_interface
:
config
.
main_interface
=
config
.
iface_list
[
0
]
else
:
sys
.
exit
(
"--client, --interface or --main-interface required"
" when --max-clients is 0"
)
if
config
.
main_interface
:
ip_args
=
[
'ip'
,
'addr'
,
'add'
,
my_ip
,
ip_args
=
[
'ip'
,
'addr'
,
'add'
,
my_ip
,
'dev'
,
config
.
iface_list
[
0
]
]
'dev'
,
config
.
main_interface
]
call
(
ip_args
)
call
(
ip_args
)
ip_args
[
2
]
=
'del'
ip_args
[
2
]
=
'del'
cleanup
.
append
(
lambda
:
call
(
ip_args
))
cleanup
.
append
(
lambda
:
call
(
ip_args
))
else
:
sys
.
exit
(
"--client or --interface required"
" when --max-clients is 0"
)
# main loop
# main loop
if
tunnel_manager
is
None
:
if
tunnel_manager
is
None
:
...
...
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