Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
Context Sensitive Group
freedombone
Commits
10da38da
Commit
10da38da
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
vpn on tcp
parent
63df10c2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-app-vpn
+8
-2
8 additions, 2 deletions
src/freedombone-app-vpn
src/freedombone-utils-firewall
+2
-4
2 additions, 4 deletions
src/freedombone-utils-firewall
with
10 additions
and
6 deletions
src/freedombone-app-vpn
+
8
−
2
View file @
10da38da
...
...
@@ -122,7 +122,7 @@ function restore_remote_vpn {
function
remove_vpn
{
systemctl stop openvpn
apt-get
-yq
remove
--purge
fastd openvpn easy-rsa
apt-get
-yq
remove
--purge
fastd openvpn easy-rsa
stunnel4
if
[
-d
/etc/openvpn
]
;
then
rm
-rf
/etc/openvpn
fi
...
...
@@ -206,6 +206,9 @@ function create_user_vpn_key {
sed
-i
's|key client.key|;key client.key|g'
$user_vpn_cert_file
sed
-i
's|tls-auth ta.key|;tls-auth ta.key|g'
$user_vpn_cert_file
sed
-i
's|;proto tcp|proto tcp|g'
$user_vpn_cert_file
sed
-i
's|proto udp|;proto udp|g'
$user_vpn_cert_file
echo
'<ca>'
>>
$user_vpn_cert_file
cat
/etc/openvpn/ca.crt
>>
$user_vpn_cert_file
echo
'</ca>'
>>
$user_vpn_cert_file
...
...
@@ -239,7 +242,7 @@ function remove_user_vpn {
}
function
install_vpn
{
apt-get
-yq
install
fastd openvpn easy-rsa
apt-get
-yq
install
fastd openvpn easy-rsa
stunnel4
if
[
!
-f
/usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz
]
;
then
echo
$'Example openvpn server config not found'
...
...
@@ -257,6 +260,9 @@ function install_vpn {
sed
-i
's|;group no.*|group vpn|g'
/etc/openvpn/server.conf
sed
-i
's|;max-clients.*|max-clients 2|g'
/etc/openvpn/server.conf
sed
-i
's|;proto tcp|proto tcp|g'
/etc/openvpn/server.conf
sed
-i
's|proto udp|;proto udp|g'
/etc/openvpn/server.conf
echo
1
>
/proc/sys/net/ipv4/ip_forward
sed
-i
's|# net.ipv4.ip_forward|net.ipv4.ip_forward|g'
/etc/sysctl.conf
sed
-i
's|#net.ipv4.ip_forward|net.ipv4.ip_forward|g'
/etc/sysctl.conf
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-firewall
+
2
−
4
View file @
10da38da
...
...
@@ -111,8 +111,7 @@ function enable_ipv6 {
}
function
firewall_disable_vpn
{
iptables
-D
INPUT
-i
${
FIREWALL_EIFACE
}
-m
state
--state
NEW
-p
udp
--dport
1194
-j
ACCEPT
iptables
-D
INPUT
-p
tcp
--dport
1194
-j
ACCEPT
iptables
-D
INPUT
-i
${
FIREWALL_EIFACE
}
-m
state
--state
NEW
-p
tcp
--dport
1194
-j
ACCEPT
iptables
-D
INPUT
-i
tun+
-j
ACCEPT
iptables
-D
FORWARD
-i
tun+
-j
ACCEPT
iptables
-D
FORWARD
-i
tun+
-o
${
FIREWALL_EIFACE
}
-m
state
--state
RELATED,ESTABLISHED
-j
ACCEPT
...
...
@@ -125,8 +124,7 @@ function firewall_disable_vpn {
}
function
firewall_enable_vpn
{
iptables
-A
INPUT
-i
${
FIREWALL_EIFACE
}
-m
state
--state
NEW
-p
udp
--dport
1194
-j
ACCEPT
iptables
-A
INPUT
-p
tcp
--dport
1194
-j
ACCEPT
iptables
-A
INPUT
-i
${
FIREWALL_EIFACE
}
-m
state
--state
NEW
-p
tcp
--dport
1194
-j
ACCEPT
iptables
-A
INPUT
-i
tun+
-j
ACCEPT
iptables
-A
FORWARD
-i
tun+
-j
ACCEPT
iptables
-A
FORWARD
-i
tun+
-o
${
FIREWALL_EIFACE
}
-m
state
--state
RELATED,ESTABLISHED
-j
ACCEPT
...
...
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