Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
strongswan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
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
certo
strongswan
Commits
7e6b3f6d
Commit
7e6b3f6d
authored
May 29, 2025
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added configurable DNS for VPN connection
parent
2c30c7a6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
Makefile
Makefile
+6
-0
vpn
vpn
+14
-0
No files found.
Makefile
View file @
7e6b3f6d
...
@@ -67,6 +67,11 @@ case "$${PLUTO_VERB}" in
...
@@ -67,6 +67,11 @@ case "$${PLUTO_VERB}" in
for
net
in
"$${SUBNETS[@]}"
;
do
for
net
in
"$${SUBNETS[@]}"
;
do
ip
route
add
"$net"
dev
"$${VTI_IF}"
2>
/dev/null
ip
route
add
"$net"
dev
"$${VTI_IF}"
2>
/dev/null
done
done
DNS
=
`
/sbin/uci
-q
get vpn.hub.dns
`
if
[[
-n
"$$DNS"
]];
then
DNS_SERVERS
=
$$
(
echo
"
$$
DNS"
|
tr
','
' '
| xargs
)
resolvectl
dns
$${VTI_IF}
$$DNS_SERVERS
fi
sysctl
-w
"net.ipv4.conf.$${VTI_IF}.disable_policy=1"
sysctl
-w
"net.ipv4.conf.$${VTI_IF}.disable_policy=1"
networks
=
`
printf
%s
"
$$
(ip route list proto kernel scope link | awk -F "
" "
{
print
\\
$$
1
}
")"
|
tr
'\\n'
','
`
networks
=
`
printf
%s
"
$$
(ip route list proto kernel scope link | awk -F "
" "
{
print
\\
$$
1
}
")"
|
tr
'\\n'
','
`
if
[
!
-z
"$$networks"
]
;
then
if
[
!
-z
"$$networks"
]
;
then
...
@@ -94,6 +99,7 @@ define VPN_CONFIG
...
@@ -94,6 +99,7 @@ define VPN_CONFIG
config
vpn
'hub'
config
vpn
'hub'
option
address
''
option
address
''
option
subnet
''
option
subnet
''
option
dns
''
config
ca
'issuer'
config
ca
'issuer'
option
uri
''
option
uri
''
...
...
vpn
View file @
7e6b3f6d
...
@@ -18,6 +18,7 @@ entry_execute_method_root_VPN() {
...
@@ -18,6 +18,7 @@ entry_execute_method_root_VPN() {
common_execute_method_param
"
$DMROOT
.VPN.CertificateStatus"
"0"
"vpn_get_certificate_status"
common_execute_method_param
"
$DMROOT
.VPN.CertificateStatus"
"0"
"vpn_get_certificate_status"
common_execute_method_param
"
$DMROOT
.VPN.Hub"
"1"
"vpn_get_hub"
"vpn_set_hub"
common_execute_method_param
"
$DMROOT
.VPN.Hub"
"1"
"vpn_get_hub"
"vpn_set_hub"
common_execute_method_param
"
$DMROOT
.VPN.Subnet"
"1"
"vpn_get_subnet"
"vpn_set_subnet"
common_execute_method_param
"
$DMROOT
.VPN.Subnet"
"1"
"vpn_get_subnet"
"vpn_set_subnet"
common_execute_method_param
"
$DMROOT
.VPN.DNS"
"1"
"vpn_get_DNS"
"vpn_set_DNS"
common_execute_method_param
"
$DMROOT
.VPN.Issuer"
"1"
"vpn_get_issuer_URI"
"vpn_set_issuer_URI"
common_execute_method_param
"
$DMROOT
.VPN.Issuer"
"1"
"vpn_get_issuer_URI"
"vpn_set_issuer_URI"
common_execute_method_param
"
$DMROOT
.VPN.DN"
"1"
"vpn_get_DN"
"vpn_set_DN"
common_execute_method_param
"
$DMROOT
.VPN.DN"
"1"
"vpn_get_DN"
"vpn_set_DN"
return
0
;
return
0
;
...
@@ -157,6 +158,19 @@ vpn_set_subnet() {
...
@@ -157,6 +158,19 @@ vpn_set_subnet() {
fi
fi
}
}
vpn_get_DNS
()
{
echo
`
$UCI_GET
vpn.hub.dns
`
}
vpn_set_DNS
()
{
local
dns
=
`
$UCI_GET
vpn.hub.dns
`
if
[
"
$dns
"
!=
"
$1
"
]
;
then
$UCI_SET
vpn.hub.dns
=
"
$1
"
$UCI_COMMIT
configure_ipsec
fi
}
vpn_get_issuer_URI
()
{
vpn_get_issuer_URI
()
{
echo
`
$UCI_GET
vpn.issuer.uri
`
echo
`
$UCI_GET
vpn.issuer.uri
`
}
}
...
...
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