роутинг для openconnect
This commit is contained in:
@@ -25,3 +25,4 @@ override.php
|
||||
docker-compose.override.yml
|
||||
backup.json
|
||||
app/webapp/override/
|
||||
.rest
|
||||
|
||||
+27
@@ -3137,6 +3137,9 @@ DNS-over-HTTPS with IP:
|
||||
$this->setPacConf($c);
|
||||
$page = floor(count($c['subnets']) / $this->limit);
|
||||
}
|
||||
if (!empty($openconnect)) {
|
||||
$this->ocservRoute();
|
||||
}
|
||||
$this->subnet($wgpage, $page, $openconnect);
|
||||
}
|
||||
|
||||
@@ -3145,9 +3148,33 @@ DNS-over-HTTPS with IP:
|
||||
$c = $this->getPacConf();
|
||||
unset($c['subnets'][$k]);
|
||||
$this->setPacConf($c);
|
||||
if (!empty($openconnect)) {
|
||||
$this->ocservRoute();
|
||||
}
|
||||
$this->subnet($wgpage, $page, $openconnect);
|
||||
}
|
||||
|
||||
public function ocservRoute()
|
||||
{
|
||||
$p = $this->getPacConf();
|
||||
$c = file_get_contents('/config/ocserv.conf');
|
||||
$t = preg_replace('~^route[^\n]+~sm', '', $c);
|
||||
if (!empty($p['subnets'])) {
|
||||
foreach ($p['subnets'] as $v) {
|
||||
if (preg_match('~^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/\d{1,2}~', $v)) {
|
||||
$t .= "route = $v";
|
||||
$flag = true;
|
||||
}
|
||||
}
|
||||
if (empty($flag)) {
|
||||
$t .= 'route = default';
|
||||
}
|
||||
} else {
|
||||
$t .= 'route = default';
|
||||
}
|
||||
$this->restartOcserv($t);
|
||||
}
|
||||
|
||||
public function calc()
|
||||
{
|
||||
$r = $this->send(
|
||||
|
||||
+1
-1
@@ -505,7 +505,7 @@ ipv4-netmask = 255.255.255.0
|
||||
|
||||
# Whether to tunnel all DNS queries via the VPN. This is the default
|
||||
# when a default route is set.
|
||||
#tunnel-all-dns = true
|
||||
tunnel-all-dns = true
|
||||
|
||||
# The advertised DNS server. Use multiple lines for
|
||||
# multiple servers.
|
||||
|
||||
Reference in New Issue
Block a user