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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
zhifan huang
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:
registry.screen('../re6stnet @registry/re6stnet.conf --ip 10.0.0.2 -v%u' % VERBOSE,
'../re6st-registry @registry/re6st-registry.conf -v%u'
' --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)
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))
...
...
re6stnet
View file @
752cfeea
...
...
@@ -32,6 +32,9 @@ def getConfig():
_
(
'-i'
,
'--interface'
,
action
=
'append'
,
dest
=
'iface_list'
,
default
=
[],
help
=
"Extra interface for LAN discovery. Highly recommanded if there"
" 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
_
(
'-B'
,
dest
=
'babel_args'
,
metavar
=
'ARG'
,
action
=
'append'
,
default
=
[],
...
...
@@ -183,25 +186,29 @@ def main():
if
config
.
client
:
cleanup
.
append
(
plib
.
client
(
're6stnet'
,
config
.
client
,
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
),
*
config
.
openvpn_args
).
kill
)
elif
server_tunnels
:
required
(
'dh'
)
for
iface
,
(
port
,
proto
)
in
server_tunnels
.
iteritems
():
cleanup
.
append
(
plib
.
server
(
iface
,
my_ip
if
proto
==
pp
[
0
][
1
]
else
None
,
config
.
max_clients
,
config
.
dh
,
write_pipe
,
port
,
proto
,
config
.
encrypt
,
*
config
.
openvpn_args
).
kill
)
elif
config
.
iface_list
:
cleanup
.
append
(
plib
.
server
(
iface
,
None
if
config
.
main_interface
or
proto
!=
pp
[
0
][
1
]
else
my_ip
,
config
.
max_clients
,
config
.
dh
,
write_pipe
,
port
,
proto
,
config
.
encrypt
,
*
config
.
openvpn_args
).
kill
)
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
,
'dev'
,
config
.
iface_list
[
0
]
]
'dev'
,
config
.
main_interface
]
call
(
ip_args
)
ip_args
[
2
]
=
'del'
cleanup
.
append
(
lambda
:
call
(
ip_args
))
else
:
sys
.
exit
(
"--client or --interface required"
" when --max-clients is 0"
)
# main loop
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