Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Freifunk Luebeck
wiki
Commits
0613e599
Unverified
Commit
0613e599
authored
4 years ago
by
Paul
Browse files
Options
Downloads
Patches
Plain Diff
add setup script for fastd vpn
parent
fb4f95af
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
static/fastd-setup.sh
+51
-0
51 additions, 0 deletions
static/fastd-setup.sh
with
51 additions
and
0 deletions
static/fastd-setup.sh
0 → 100755
+
51
−
0
View file @
0613e599
#!/bin/bash
DEST
=
"./ffhl"
SECRET
=
$(
fastd
--generate-key
|
awk
'/Secret/ {print $2 }'
)
# generate a random address and hope its not already used
IPADDRESS
=
"10.130.
$((
16
+
$RANDOM
%
15
))
.
$((
1
+
$RANDOM
%
254
))
"
mkdir
-p
$DEST
cat
-
>
$DEST
/fastd.conf
<<
EOF
log to syslog level debug;
interface "ffhl";
secret "
$SECRET
";
mode tap;
secure handshakes yes;
method "salsa2012+umac";
mtu 1500;
peer limit 1;
on up "./fastd-up";
include peers from "peers";
EOF
# setup remote peer
mkdir
-p
$DEST
/peers
cat
-
>
$DEST
/peers/vpn_gw
<<
EOF
key "812e7282ebf33f5203cb120a820acf731482cae694b8c08ece3f81faec6cd725";
remote "pablo.0x000.net" port 9999;
EOF
# ip setup script
cat
-
>
$DEST
/fastd-up
<<
EOF
#!/bin/sh
ip address add
${
IPADDRESS
}
/16 dev
\$
INTERFACE
ip link set
\$
INTERFACE up
EOF
chmod
a+x
$DEST
/fastd-up
echo
"=========================================================="
echo
"!!!!! send this key to someone !!!!!"
echo
"run 'fastd --show-key -c
$DEST
/fastd.conf' to see it again"
echo
"you also want to move
$DEST
to /etc/fastd/"
echo
" sudo mv
$DEST
to /etc/fastd/"
echo
fastd
--show-key
-c
$DEST
/fastd.conf
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment