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
3ad18142
Commit
3ad18142
authored
Dec 11, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wait for a solution..
parent
ac125363
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
8 deletions
+10
-8
ansible/bird.conf.j2
ansible/bird.conf.j2
+2
-2
ansible/protocols/wg/wg.conf.j2
ansible/protocols/wg/wg.conf.j2
+1
-1
ansible/scripts/global-postup.sh.j2
ansible/scripts/global-postup.sh.j2
+1
-1
ansible/scripts/utility.sh.j2
ansible/scripts/utility.sh.j2
+1
-1
src/inventory.ts
src/inventory.ts
+5
-3
No files found.
ansible/bird.conf.j2
View file @
3ad18142
log s
yslog
all;
log s
tderr
all;
router id {{address}};
protocol device {
...
...
@@ -64,7 +64,7 @@ protocol ospf v2 {
{% for connection in connections %}
{% if connection.protocol != "null" and connection.remoteLocalAddress != address %}
interface "{{connection.name}}" {
type ptp;
type pt
m
p;
{% if connection.outbound %}
cost {{connection.metric}};
{% else %}
...
...
ansible/protocols/wg/wg.conf.j2
View file @
3ad18142
...
...
@@ -19,4 +19,4 @@ Endpoint = {{conn.remoteAddress}}:{{conn.remotePort}}
PersistentKeepalive = 1
{% endif %}
# forced change
# forced change
12.11 2
ansible/scripts/global-postup.sh.j2
View file @
3ad18142
...
...
@@ -15,7 +15,7 @@ ip rule add pref 81 to {{subnet}} lookup main || true
# chain for wg origin
iptables
-t
mangle
-N
NEXTGEN_ORIGIN
iptables
-t
mangle
-A
PREROUTING
!
-p
ospf
-m
set
!
--match-set
mycard src
-j
NEXTGEN_ORIGIN
iptables
-t
mangle
-A
PREROUTING
!
-
d
224.0.0.0/3
!
-
p
ospf
-m
set
!
--match-set
mycard src
-j
NEXTGEN_ORIGIN
# switch rules
{{
ansible_user_dir
}}
/nextgen-network/scripts/switch-rules-up.sh
...
...
ansible/scripts/utility.sh.j2
View file @
3ad18142
...
...
@@ -27,7 +27,7 @@ interface_origin() {
OPTION=$1
INTERFACE=$2
MARK=$3
iptables -t mangle "$OPTION" NEXTGEN_ORIGIN ! -p ospf -i "$INTERFACE" -m set ! --match-set mycard src -j CONNMARK --set-xmark "$MARK"
iptables -t mangle "$OPTION" NEXTGEN_ORIGIN ! -p ospf -i "$INTERFACE"
! -d 224.0.0.0/3
-m set ! --match-set mycard src -j CONNMARK --set-xmark "$MARK"
restore_mark_origin "$OPTION" "$MARK"
}
...
...
src/inventory.ts
View file @
3ad18142
...
...
@@ -37,7 +37,7 @@ class InventoryBuilder {
host
.
wgPublickey
=
await
this
.
wgPublickey
(
host
.
wgPrivateKey
);
}
// console.log(Object.values(this.hosts));
const
hosts
=
Object
.
fromEntries
(
Object
.
values
(
this
.
hosts
).
map
(
h
=>
[
h
.
host
,
this
.
host_vars
(
h
)]));
const
hosts
=
Object
.
fromEntries
(
Object
.
values
(
this
.
hosts
).
map
(
h
=>
[
h
.
name
,
this
.
host_vars
(
h
)]));
// console.log(hosts);
const
vars
=
await
this
.
loadUtilities
();
const
result
=
YAML
.
stringify
({
wg
:
{
hosts
,
vars
}
});
...
...
@@ -115,8 +115,10 @@ class InventoryBuilder {
}
return
{
ansible_ssh_host
:
host
.
host
,
ansible_ssh_user
:
host
.
user
,
ansible_python_interpreter
:
"
python3
"
,
ansible_ssh_port
:
host
.
sshPort
||
22
,
ansible_python_interpreter
:
host
.
python
||
"
python3
"
,
address
:
host
.
address
,
isCN
:
host
.
location
.
startsWith
(
"
CN
"
),
key
:
host
.
wgPrivateKey
,
...
...
@@ -143,7 +145,7 @@ class InventoryBuilder {
const
localGatewayName
=
(
cis
?
params
.
lif
:
params
.
rif
)
||
params
.
if
;
const
localGateway
=
localGatewayName
?
this
.
gateways
[
local
.
name
][
localGatewayName
]
:
_
.
find
(
this
.
gateways
[
local
.
name
]);
//console.log(local.name, paramsString, params, localGatewayName, localGateway.name)
const
localGatewayMark
=
localGateway
.
selectionMark
;
const
localGatewayMark
=
localGateway
Name
?
localGateway
.
selectionMark
:
""
;
const
remoteGatewayName
=
(
cis
?
params
.
rif
:
params
.
lif
)
||
params
.
if
;
const
remoteGateway
=
remoteGatewayName
?
this
.
gateways
[
remote
.
name
][
remoteGatewayName
]
:
_
.
find
(
this
.
gateways
[
remote
.
name
]);
//const remoteGatewayMark = remoteGatewayName ? remoteGateway.mark : undefined;
...
...
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