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
Yohann D'Anello
re6stnet
Commits
a6bb0d25
Commit
a6bb0d25
authored
Aug 10, 2021
by
Yohann D'Anello
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better IP cleanup
Signed-off-by:
Yohann D'ANELLO
<
ynerant@crans.org
>
parent
251ae411
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
re6st/cli/node.py
re6st/cli/node.py
+7
-0
re6st/tunnel.py
re6st/tunnel.py
+7
-4
No files found.
re6st/cli/node.py
View file @
a6bb0d25
...
...
@@ -366,9 +366,16 @@ def main():
ip
(
'addr'
,
my_ip
+
'/%s'
%
len
(
subnet
),
'dev'
,
config
.
main_interface
)
# TODO Clean up the cleanup
ip
(
'rule'
,
'from'
,
'all'
,
'lookup'
,
'34072'
)
ip
(
'route'
,
'table'
,
'34072'
,
'local'
,
my_ip
,
'dev'
,
config
.
main_interface
)
subprocess
.
check_call
((
'ip'
,
'-6'
,
'route'
,
'del'
,
'table'
,
'local'
,
my_ip
))
cleanup
.
append
(
lambda
:
subprocess
.
call
((
'ip'
,
'-6'
,
'route'
,
'flush'
,
'table'
,
'34071'
)))
cleanup
.
append
(
lambda
:
subprocess
.
call
((
'ip'
,
'-6'
,
'route'
,
'flush'
,
'table'
,
'34072'
)))
def
clean_monitoring_addresses
():
for
address
in
tunnel_manager
.
_neighbour_monitoring_addresses
.
values
():
subprocess
.
check_call
((
'ip'
,
'-6'
,
'address'
,
'del'
,
address
,
'dev'
,
'lo'
))
cleanup
.
append
(
clean_monitoring_addresses
)
ip
(
'rule'
,
'from'
,
my_subnet
,
'to'
,
my_subnet
,
'iif'
,
config
.
main_interface
,
'lookup'
,
'34071'
)
if_rt
=
[
'ip'
,
'-6'
,
'route'
,
'del'
,
'fe80::/64'
,
'dev'
,
config
.
main_interface
]
...
...
re6st/tunnel.py
View file @
a6bb0d25
...
...
@@ -715,10 +715,13 @@ class BaseTunnelManager(object):
# Add route in kernel
# FIXME Replace lo by main inteface name
subprocess
.
check_call
((
'ip'
,
'-6'
,
'address'
,
'add'
,
address
,
'dev'
,
'lo'
))
subprocess
.
check_call
((
'ip'
,
'-6'
,
'route'
,
'del'
,
address
,
'dev'
,
'lo'
,
'table'
,
'main'
))
subprocess
.
check_call
((
'ip'
,
'-6'
,
'route'
,
'add'
,
my_address
,
'from'
,
address
,
'via'
,
nexthop
,
'dev'
,
iface
,
'src'
,
address
,
'table'
,
'34071'
))
subprocess
.
check_output
((
'ip'
,
'-6'
,
'address'
,
'add'
,
address
,
'dev'
,
'lo'
),
stderr
=
subprocess
.
STDOUT
)
# Ignore stderr
subprocess
.
check_output
((
'ip'
,
'-6'
,
'route'
,
'del'
,
address
,
'dev'
,
'lo'
,
'table'
,
'main'
),
stderr
=
subprocess
.
STDOUT
)
subprocess
.
check_output
((
'ip'
,
'-6'
,
'route'
,
'add'
,
my_address
,
'from'
,
address
,
'via'
,
nexthop
,
'dev'
,
iface
,
'src'
,
address
,
'table'
,
'34071'
),
stderr
=
subprocess
.
STDOUT
)
def
_updateCountry
(
self
,
address
):
def
update
():
...
...
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