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
Joanne Hugé
re6stnet
Commits
ac0f161b
Commit
ac0f161b
authored
Sep 09, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefer routing via interfaces specified by -i option
parent
e7abbba0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
re6st/plib.py
re6st/plib.py
+8
-6
re6stnet
re6stnet
+3
-3
No files found.
re6st/plib.py
View file @
ac0f161b
...
@@ -53,8 +53,8 @@ def client(iface, server_address, encrypt, *args, **kw):
...
@@ -53,8 +53,8 @@ def client(iface, server_address, encrypt, *args, **kw):
def
router
(
network
,
subnet
,
subnet_size
,
hello_interval
,
log_path
,
state_path
,
def
router
(
network
,
subnet
,
subnet_size
,
hello_interval
,
log_path
,
state_path
,
pidfile
,
*
args
,
**
kw
):
pidfile
,
tunnel_interfaces
,
*
args
,
**
kw
):
args
=
[
'babeld'
,
cmd
=
[
'babeld'
,
'-C'
,
'redistribute local ip %s/%s le %s'
%
(
subnet
,
subnet_size
,
subnet_size
),
'-C'
,
'redistribute local ip %s/%s le %s'
%
(
subnet
,
subnet_size
,
subnet_size
),
'-C'
,
'redistribute local deny'
,
'-C'
,
'redistribute local deny'
,
'-C'
,
'redistribute ip %s/%s le %s'
%
(
subnet
,
subnet_size
,
subnet_size
),
'-C'
,
'redistribute ip %s/%s le %s'
%
(
subnet
,
subnet_size
,
subnet_size
),
...
@@ -74,13 +74,15 @@ def router(network, subnet, subnet_size, hello_interval, log_path, state_path,
...
@@ -74,13 +74,15 @@ def router(network, subnet, subnet_size, hello_interval, log_path, state_path,
'-L'
,
log_path
,
'-L'
,
log_path
,
'-S'
,
state_path
,
'-S'
,
state_path
,
'-I'
,
pidfile
,
'-I'
,
pidfile
,
'-s'
,
'-s'
]
]
+
list
(
args
)
for
iface
in
tunnel_interfaces
:
cmd
+=
'-C'
,
'interface %s rxcost 512'
%
iface
cmd
+=
args
# WKRD: babeld fails to start if pidfile already exists
# WKRD: babeld fails to start if pidfile already exists
try
:
try
:
os
.
remove
(
pidfile
)
os
.
remove
(
pidfile
)
except
OSError
,
e
:
except
OSError
,
e
:
if
e
.
errno
!=
errno
.
ENOENT
:
if
e
.
errno
!=
errno
.
ENOENT
:
raise
raise
logging
.
info
(
'%r'
,
args
)
logging
.
info
(
'%r'
,
cmd
)
return
subprocess
.
Popen
(
args
,
**
kw
)
return
subprocess
.
Popen
(
cmd
,
**
kw
)
re6stnet
View file @
ac0f161b
...
@@ -145,7 +145,6 @@ def main():
...
@@ -145,7 +145,6 @@ def main():
ip_changed
=
None
ip_changed
=
None
for
x
in
pp
:
for
x
in
pp
:
server_tunnels
.
setdefault
(
're6stnet-'
+
x
[
1
],
x
)
server_tunnels
.
setdefault
(
're6stnet-'
+
x
[
1
],
x
)
config
.
babel_args
+=
server_tunnels
def
call
(
*
args
,
**
kw
):
def
call
(
*
args
,
**
kw
):
r
=
subprocess
.
call
(
*
args
,
**
kw
)
r
=
subprocess
.
call
(
*
args
,
**
kw
)
...
@@ -160,6 +159,7 @@ def main():
...
@@ -160,6 +159,7 @@ def main():
my_ip
=
'%s/%s'
%
(
utils
.
ipFromBin
(
subnet
,
'1'
),
len
(
subnet
))
my_ip
=
'%s/%s'
%
(
utils
.
ipFromBin
(
subnet
,
'1'
),
len
(
subnet
))
# Init db and tunnels
# Init db and tunnels
tunnel_interfaces
=
server_tunnels
.
keys
()
timeout
=
4
*
config
.
hello
timeout
=
4
*
config
.
hello
if
config
.
client_count
and
not
config
.
client
:
if
config
.
client_count
and
not
config
.
client
:
required
(
'registry'
)
required
(
'registry'
)
...
@@ -171,7 +171,7 @@ def main():
...
@@ -171,7 +171,7 @@ def main():
config
.
openvpn_args
,
timeout
,
config
.
tunnel_refresh
,
config
.
openvpn_args
,
timeout
,
config
.
tunnel_refresh
,
config
.
client_count
,
config
.
iface_list
,
network
,
prefix
,
config
.
client_count
,
config
.
iface_list
,
network
,
prefix
,
address
,
ip_changed
,
config
.
encrypt
)
address
,
ip_changed
,
config
.
encrypt
)
config
.
babel_arg
s
+=
tunnel_manager
.
free_interface_set
tunnel_interface
s
+=
tunnel_manager
.
free_interface_set
else
:
else
:
tunnel_manager
=
write_pipe
=
None
tunnel_manager
=
write_pipe
=
None
...
@@ -179,7 +179,7 @@ def main():
...
@@ -179,7 +179,7 @@ def main():
router
=
plib
.
router
(
network
,
utils
.
ipFromBin
(
subnet
),
len
(
subnet
),
router
=
plib
.
router
(
network
,
utils
.
ipFromBin
(
subnet
),
len
(
subnet
),
config
.
hello
,
os
.
path
.
join
(
config
.
log
,
'babeld.log'
),
config
.
hello
,
os
.
path
.
join
(
config
.
log
,
'babeld.log'
),
os
.
path
.
join
(
config
.
state
,
'babeld.state'
),
os
.
path
.
join
(
config
.
state
,
'babeld.state'
),
config
.
babel_pidfile
,
*
config
.
babel_args
)
config
.
babel_pidfile
,
tunnel_interfaces
,
*
config
.
babel_args
)
try
:
try
:
cleanup
=
[]
cleanup
=
[]
...
...
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