Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

public function get_mac_vlan($olt, $interface)

{
$ssh = new SSH2('10.62.165.4');
if (!$ssh->login('720335', '07Lenovo')) {
exit("Login Failed");
// return "Gagal Login";
} else {
$ssh->setwindowsize(500,9999);
$ssh->setTimeout(5);
$ssh->read('$');
$ssh->write("telnet {$olt}" . "\n");
$ssh->read('name:');
$ssh->write('720335' . "\n");
$ssh->read('Password:');
$ssh->write('07Lenovo' . "\n");

$ssh->read('#');
$ssh->write('environment inhibit-alarms' . "\n");
$ssh->read('#');
$ssh->write("show vlan bridge-port-fdb {$interface}\n");
$output = $ssh->read('#');
$arr = explode("\r\n", $output);

$ssh->write("exit\n");
$ssh->write("yes\n");

$ssh->read('$');
$ssh->write("logout\n");

$ssh->disconnect();

return $output;
}
}

You might also like