Update Banyak
This commit is contained in:
@@ -399,16 +399,16 @@
|
||||
|
||||
// Jika data tunnel radius kosong tapi mau bikin tunnel & radius
|
||||
if (empty($server['radius_nas_data']) && $_POST['tunnel'] == 1) {
|
||||
$nasgroup = "server" . $SvId;
|
||||
|
||||
$tunnel = new CreateTunnel();
|
||||
$resultTun = $tunnel->addTunnel($_POST['nmk'] . '_' . $_POST['ids']);
|
||||
$resultTun = $tunnel->addTunnel($_POST['nmk'] . '_' . $_POST['ids'], $nasgroup);
|
||||
$radius_nas_data = $resultTun;
|
||||
|
||||
$decodedResult = json_decode($resultTun);
|
||||
$nasname = $decodedResult->data->{"remote-address"} ?? null;
|
||||
$shortname = strtok($decodedResult->data->{"name"}, '@');
|
||||
$nassecret = $decodedResult->data->{"nas_secret"} ?? null;
|
||||
$nasgroup = "server" . $SvId;
|
||||
|
||||
// Tambahkan NAS ke Radius jika diminta
|
||||
if ($decodedResult->{'status'} == true && !empty($_POST['radius'])) {
|
||||
@@ -672,7 +672,7 @@ add dst-address=172.16.254.242 gateway=172.18.1.100 check-gateway=ping distance=
|
||||
</div>
|
||||
<pre class="bg-light border rounded p-3 mb-2" id="script1-<?= $server['id']; ?>">
|
||||
/interface ovpn-client
|
||||
add name=opvn-manjapro connect-to=tunnel.manjapro.net port=1199 mode=ip protocol=udp user=<?= $apiScript['data']['name']; ?> password=<?= $apiScript['data']['password']; ?> profile=default-encryption add-default-route=no route-nopull-yes disabled=no
|
||||
add name=opvn-manjapro connect-to=tunnel.manjapro.net port=1199 mode=ip protocol=udp user=<?= $apiScript['data']['name']; ?> password=<?= $apiScript['data']['password']; ?> profile=default-encryption add-default-route=no route-nopull=yes disabled=no
|
||||
/ip firewall nat
|
||||
add chain=dstnat dst-address=<?= $apiScript['data']['remote-address']; ?> protocol=tcp dst-port=<?= $apiScript['data']['port-remote']; ?> action=dst-nat to-addresses=172.0.0.1 to-port=80 comment="Remote"
|
||||
/ip service
|
||||
|
||||
Reference in New Issue
Block a user