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
64f8c377
Commit
64f8c377
authored
Feb 19, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unfinished
parent
c22977a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
22 deletions
+16
-22
ansible/bird.conf.j2
ansible/bird.conf.j2
+11
-21
ansible/scripts/postup.sh
ansible/scripts/postup.sh
+1
-1
src/inventory.ts
src/inventory.ts
+4
-0
No files found.
ansible/bird.conf.j2
View file @
64f8c377
...
@@ -26,37 +26,25 @@ protocol kernel {
...
@@ -26,37 +26,25 @@ protocol kernel {
ipv6 { export all; };
ipv6 { export all; };
}
}
ipv4 table a;
{% for connection in connections %}
{% if connection.type != "null" and connection.remoteLocalAddress != address %}
ipv4 table {{connection.name}};
protocol static {
protocol static {
ipv4 {
ipv4 {
table
a
;
table
{{connection.name}}
;
};
};
igp table master4;
igp table master4;
route 0.0.0.0/0 recursive
10.199.0.12
;
route 0.0.0.0/0 recursive
{{connection.remoteLocalAddress}}
;
}
}
protocol kernel {
protocol kernel {
ipv4 {
ipv4 {
table
a
;
table
{{connection.name}}
;
export all;
export all;
};
};
kernel table 301;
kernel table {{connection.remoteGatewayMark}};
}
ipv4 table b;
protocol static {
ipv4 {
table b;
};
igp table master4;
route 0.0.0.0/0 recursive 10.199.0.10;
}
protocol kernel {
ipv4 {
table b;
export all;
};
kernel table 302;
}
}
{% endif %}
{% endfor %}
protocol ospf v2 {
protocol ospf v2 {
ipv4 {
ipv4 {
...
@@ -73,6 +61,7 @@ protocol ospf v2 {
...
@@ -73,6 +61,7 @@ protocol ospf v2 {
# hello 5; # Default hello perid 10 is too long
# hello 5; # Default hello perid 10 is too long
# };
# };
{% for connection in connections %}
{% for connection in connections %}
{% if connection.type != "null" and connection.remoteLocalAddress != address %}
interface "{{connection.name}}" {
interface "{{connection.name}}" {
type ptp;
type ptp;
{% if connection.outbound %}
{% if connection.outbound %}
...
@@ -82,6 +71,7 @@ protocol ospf v2 {
...
@@ -82,6 +71,7 @@ protocol ospf v2 {
{% endif %}
{% endif %}
hello 5;
hello 5;
};
};
{% endif %}
{% endfor %}
{% endfor %}
interface "dummy0" {
interface "dummy0" {
stub; # Stub interface, just propagate it
stub; # Stub interface, just propagate it
...
...
ansible/scripts/postup.sh
View file @
64f8c377
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
ip addr add
"
$localPeerAddress
"
peer
"
$remotePeerAddress
"
dev
"
$dev
"
scope
link
ip addr add
"
$localPeerAddress
"
peer
"
$remotePeerAddress
"
dev
"
$dev
"
scope
link
if
[
"
$outbound
"
==
True
]
;
then
if
[
"
$outbound
"
==
True
]
;
then
ip route add default dev
"
$dev
"
table
"
$remoteMark
"
#
ip route add default dev "$dev" table "$remoteMark"
ip rule add fwmark
"
$remoteMark
"
table
"
$remoteMark
"
pref 300
ip rule add fwmark
"
$remoteMark
"
table
"
$remoteMark
"
pref 300
fi
fi
...
...
src/inventory.ts
View file @
64f8c377
...
@@ -80,8 +80,10 @@ class InventoryBuilder {
...
@@ -80,8 +80,10 @@ class InventoryBuilder {
const
localGatewayMark
=
localGatewayName
?
localGateway
.
mark
:
undefined
;
const
localGatewayMark
=
localGatewayName
?
localGateway
.
mark
:
undefined
;
const
remoteGatewayName
=
(
cis
?
params
.
rif
:
params
.
lif
)
||
params
.
if
;
const
remoteGatewayName
=
(
cis
?
params
.
rif
:
params
.
lif
)
||
params
.
if
;
const
remoteGateway
=
remoteGatewayName
?
this
.
gateways
[
remote
.
name
][
remoteGatewayName
]
:
_
.
find
(
this
.
gateways
[
remote
.
name
]);
const
remoteGateway
=
remoteGatewayName
?
this
.
gateways
[
remote
.
name
][
remoteGatewayName
]
:
_
.
find
(
this
.
gateways
[
remote
.
name
]);
const
remoteGatewayMark
=
remoteGatewayMark
?
remoteGateway
.
mark
:
undefined
;
//console.log(remoteGateway.name);
//console.log(remoteGateway.name);
const
remoteAddress
=
remoteGateway
.
address
;
const
remoteAddress
=
remoteGateway
.
address
;
const
remoteLocalAddress
=
remote
.
address
;
const
remoteMark
=
remote
.
mark
;
const
remoteMark
=
remote
.
mark
;
const
localPort
=
primary
?
remote
.
port
:
remote
.
port2
;
const
localPort
=
primary
?
remote
.
port
:
remote
.
port2
;
const
remotePort
=
primary
?
local
.
port
:
local
.
port2
;
const
remotePort
=
primary
?
local
.
port
:
local
.
port2
;
...
@@ -98,8 +100,10 @@ class InventoryBuilder {
...
@@ -98,8 +100,10 @@ class InventoryBuilder {
protocol
,
protocol
,
params
,
params
,
localGatewayMark
,
localGatewayMark
,
remoteGatewayMark
,
remoteMark
,
remoteMark
,
remoteAddress
,
remoteAddress
,
remoteLocalAddress
,
localPort
,
localPort
,
remotePort
,
remotePort
,
wgPublicKey
,
wgPublicKey
,
...
...
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