Code: Select all
<?php
//config
//Enter your mikrotik router IP, Username and password here
$serverip="192.168.1.1";
$username="admin";
$password="123456";
//***********************
require('api.php');
$address = $_SERVER['REMOTE_ADDR'];
$usercomment = $_SERVER['QUERY_STRING'];
$API = new routeros_api();
$API->debug = false;
if ($API->connect($serverip, $username,$password)) {
$API->comm("/ip/socks/access/add", array(
"src-address" => "$address",
"comment" => "{$usercomment}",
"action" => "allow",
));
I am using this API code for add IP in SOCKS.
How can change this code for Remove or Disable exmaple IP 3.3.3.3 ?