Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tun
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
tun
Commits
e66e88c6
Commit
e66e88c6
authored
Dec 16, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix chnrouter
parent
4a0ebff3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
ansible/scripts/utility.sh.j2
ansible/scripts/utility.sh.j2
+1
-1
lists/route_helper.py
lists/route_helper.py
+4
-4
No files found.
ansible/scripts/utility.sh.j2
View file @
e66e88c6
...
@@ -44,5 +44,5 @@ interface_switch_chnroute() {
...
@@ -44,5 +44,5 @@ interface_switch_chnroute() {
IPSET=$2
IPSET=$2
MARK=$3
MARK=$3
ipset create "$IPSET" hash:net maxelem 1000000 || true
ipset create "$IPSET" hash:net maxelem 1000000 || true
iptables -t mangle "$OPTION" NEXTGEN_SWITCH -m mark --mark 0 -m set --match-set "$IPSET" src -m set --match-set chnroute
_reverse
dst -j CONNMARK --set-xmark "$MARK"
iptables -t mangle "$OPTION" NEXTGEN_SWITCH -m mark --mark 0 -m set --match-set "$IPSET" src -m set --match-set chnroute
r
dst -j CONNMARK --set-xmark "$MARK"
}
}
lists/route_helper.py
View file @
e66e88c6
...
@@ -18,10 +18,10 @@ def write_yaml_file(name, data):
...
@@ -18,10 +18,10 @@ def write_yaml_file(name, data):
universe
=
IPSet
([
'0.0.0.0/0'
])
universe
=
IPSet
([
'0.0.0.0/0'
])
special
=
IPSet
([
line
.
strip
()
for
line
in
open
(
'special.txt'
)])
special
=
IPSet
([
line
.
strip
()
for
line
in
open
(
'special.txt'
)])
chnroutes
=
IPSet
([
line
.
strip
()
for
line
in
open
(
'chnroutes.txt'
)
if
not
line
.
startswith
(
'#'
)])
chnroutes
=
IPSet
([
line
.
strip
()
for
line
in
open
(
'chnroutes.txt'
)
if
not
line
.
startswith
(
'#'
)])
result
=
{
'chnroute
_reverse
'
:
[]
}
result
=
{
'chnroute
r
'
:
[]
}
chnroute
_reverse
=
universe
-
special
-
chnroutes
chnroute
r
=
universe
-
special
-
chnroutes
for
route
in
chnroute
_reverse
.
iter_cidrs
():
for
route
in
chnroute
r
.
iter_cidrs
():
result
[
'chnroute
_reverse
'
]
.
append
(
str
(
route
))
result
[
'chnroute
r
'
]
.
append
(
str
(
route
))
write_yaml_file
(
"result.yaml"
,
result
)
write_yaml_file
(
"result.yaml"
,
result
)
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