標準のロビー管理Cisco Wireless LAN Controller 5500/2500の交換

または「Ciscoのインターフェースが気に入らない-自分で作成する」





2500/5500ワイヤレスコントローラーを使用して、企業ネットワーク内のLWAPPファームウェアでCisco Aironetアクセスポイントを管理し、共通のセキュリティポリシー、ゲストアクセスを提供し、標準のコンピュータークライアント(ラップトップ、コンピューター、スマートフォン)とワイヤレスアクセスを備えた専用デバイスの両方をサポートします-マニュアル販売エリア用スキャナー、ワイヤレス監視カメラなど



少し前まで、私はCisco WLCを使用してゲストインターネットアクセスを発行する可能性を整理する任務を負っていました。 アクセスは私たちの「レセプション」によって発行されるべきでした-つまり、インターフェースはITから遠く離れた人々にとってできるだけ便利でシンプルでなければなりません。 ゲストアクセス自体の作成は、ドキュメントのチェックと一時的なバッジの発行とともにプロセスの一部に過ぎないはずで、10秒以内で完了します



Cisco WLCでは、ユーザー認証のために、外部RADIUSサーバー(Cisco ISEまたはWindows NPSの場合がありますが、この場合はこれらのオプションが失われました)を接続するか、コントローラー自体のローカルデータベースを使用できます。 ローカルデータベースの唯一の制限は、データベース内のエントリの最大数:2048です。



私たちのケースでは、これで十分であり、WLC自体の機能を使用することにしました。 ゲストアカウントを作成するために、ロビー管理者に限定された権限を持つ特別な管理アカウントを作成できます(名前が示すとおり-私たちと同様の目的のため)。







標準のロビー管理者に満足しなかった理由


このようなアカウントを作成したので、Lobby Ambassadorツールを使用してゲストユーザーを作成するプロセスを検討することにしました(いわゆる「切り捨てられた」モードが呼び出されます)



ステップ1.ログインする必要があります。すべてが明確であるため、名前とパスワードを入力する必要があります。 原則として、「レセプション」は一日の初めにログインでき、ページを閉じないため、作成の速度には影響しません。

ステップ2. [新規]ボタンをクリックします。



ステップ3.フォームに入力します-ここでは、ユーザー名の指定、パスワードの生成、期間の指定、ネットワーク(ゲスト)の選択が必要です





それから、10秒でそれに会う方法がないことが明らかになりました:





その結果、当社の受付は標準のインターフェースを好まなかった、それは理解できる、Cisco WebベースのアプリケーションのUIは伝統的に噴水ではない...



問題の解決方法


共有したいPHPスクリプトを簡単かつ迅速に積み上げます

特にコードを見たり批判したりしないようにお願いします。PHPを書いたのは人生で2回目です(そして3回目はまったくプログラミングしません)。そのため、スタイルとセキュリティスクリプトの問題は考慮されませんでした:)。

スクリプトソースコード
<?php error_reporting(0); function generatePassword ($length = 8) { // start with a blank password $password = ""; // define possible characters - any character in this string can be // picked for use in the password, so if you want to put vowels back in // or add special characters such as exclamation marks, this is where // you should do it $possible = "2346789bcdfghjkmnpqrtvwxyzBCDFGHJKLMNPQRTVWXYZ"; // we refer to the length of $possible a few times, so let's grab it now $maxlength = strlen($possible); // check for length overflow and truncate if necessary if ($length > $maxlength) { $length = $maxlength; } // set up a counter for how many characters are in the password so far $i = 0; // add random characters to $password until $length is reached while ($i < $length) { // pick a random character from the possible ones $char = substr($possible, mt_rand(0, $maxlength-1), 1); // have we already used this character in $password? if (!strstr($password, $char)) { // no, so it's OK to add it onto the end of whatever we've already got... $password .= $char; // ... and increase the counter by one $i++; } } // done! return $password; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Guest WIFI Access - Add a user</title> <script> function randomPassword(length) { chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; pass = ""; for(x=0;x<length;x++) { i = Math.floor(Math.random() * 62); pass += chars.charAt(i); } return pass; } </script> </head> <body > <div id="test-header" class="accordion_headings" >Guest WIFI Network </div><!--Heading of the accordion ( clicked to show n hide ) --> <!--Prefix of heading (the DIV above this) and content (the DIV below this) to be same... eg. foo-header & foo-content--> <div id="test2-content"><!--DIV which show/hide on click of header--> <p><br /> <? if ($_REQUEST["action"]=="send") { $headers = "MIME-Version: 1.0\n" ; $headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\n"; $headers .= "Sensitivity: Personal\n"; $message= "<table width=466 border=0 cellpadding=0 cellspacing=0 bordercolor=#000000> <tr> <th colspan=2> Office Guest WIFI Access</th> </tr> <tr> <td width=128>Username</td> <td width=332><strong> ".$_REQUEST[User]." </strong></td> </tr> <tr> <td>Password</td> <td><strong> ".$_REQUEST[Pass]." </strong></td> </tr> <tr> <td>Life Time</td> <td><strong> ".$_REQUEST[life]." days <br /> <font size=-2> starting from ".$_REQUEST[Date]." </font></strong> </td> </tr> </table><br> Network Name is A_GUEST<br> <b>By using Office WIFI Guest network you agree to everything listed in our policy document</b>. <br> For any IT related issues call helpdesk"; $status = mail($_REQUEST["email"], "Access to Office WIFI guest network", $message,$headers); echo "<b>Info sent by Email"; } if ($_REQUEST["action"]=="submit") { $adduser="ok"; if (strlen($_REQUEST["User"])<2) { $adduser=""; $_REQUEST["action"]=""; $userermsg.="<br><font color=red>Username too short</font>"; } if (strlen($_REQUEST["Pass"])<2) { $adduser=""; $_REQUEST["action"]=""; $userermsg.="<br><font color=red>Password too short</font>"; } if ($adduser=="ok") { // Adding user $userermsg=""; $post = http_build_query(array( "buttonClicked" => "4", "userpwd" => $_REQUEST["Pass"] , "pwdconfirm" => $_REQUEST["Pass"], "lifetime_days" => $_REQUEST["life"], "lifetime_hours" => "0", "lifetime_mins" => "1", "lifetime_secs" => "1", "apply" => "apply", "description" => "Email:".$_REQUEST["email"]." - ".$_REQUEST["notes"], "GuestWlanID" => "0", "guest_roleselect_checkbox" => "0", "err_flag" => "0", "username" => $_REQUEST["User"] )); $context = stream_context_create(array("http"=>array( "method" => "POST", "header" => "Content-Type: application/x-www-form-urlencoded\r\n" . "Content-Length: ". strlen($post) . "\r\n", "content" => $post, ))); $page = file_get_contents("http://lobbyadmin:lobbypassword@10.24.32.61/screens/aaa/guestuser_create.html", true, $context); $usererr = strpos($page, 'ERROR: User Name', true); // As of PHP 5.3.0 if (intval($usererr)>1) { $_REQUEST["action"]=""; $userermsg.="<br><font color=red>User already exists! Please choose another name</font>"; } if ($userermsg=="") { //User created - give options - printout send by email ?> <script type="text/javascript"> var win=null; function printIt(printThis) { win = window.open(); win.focus(); win.document.open(); win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>'); win.document.write('body, td { font-family: Verdana; font-size: 10pt;} table { margin: 1em; border-collapse: collapse; } td, th { padding: .3em; border: 1px #ccc solid; }'); win.document.write('<'+'/'+'style'+'><'+'/'+'head'+'><'+'body'+'>'); win.document.write(printThis); win.document.write('By using Office WIFI Guest network you agree to everything listed in our policy document. <br> For any IT related issues call (+41)(022)(909) <b>5555</b> <'+'/'+'body'+'><'+'/'+'html'+'>'); win.document.close(); win.print(); win.close(); } </script> </p> <p class="style2">User has been successfully created </p> <table width="466" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000"> <tr> <th colspan="2"> Office Guest WIFI Access</th> </tr> <tr> <td width="128">Username</td> <td width="332"><strong> <?=$_REQUEST["User"]?> </strong></td> </tr> <tr> <td>Password</td> <td><strong> <?=$_REQUEST["Pass"]?> </strong></td> </tr> <tr> <td>Life Time</td> <td><strong> <?=$_REQUEST["life"]?> days <br /> <font size="-2"> starting from <?=date("d/M/YH:i:s")?> </font></strong> </td> </tr> </table> <br /> <a href="#" onclick="printIt(document.getElementById('printme').innerHTML); return false"> Print guest access leaflet </a> <? if (strlen($_REQUEST["email"])>5 ) { ?> <br /> <form action="index.php?action=send" method="post" id=sendemail> <input type=hidden name="Date" value="<?=date("d/M/YH:i:s")?>"/> <input type=hidden name="User" value="<?=$_REQUEST["User"]?>"/> <input type=hidden value="<?=$_REQUEST["Pass"]?>" id="Pass" name="Pass" /> <input type=hidden name="life" id="life" size="5" value="<? if(intval($_REQUEST["life"]==0)) { echo 1; } else { echo $_REQUEST["life"]; } ?>" /> <input type=hidden name="email" id="email" value="<?=$_REQUEST["email"]?>" /><a href=# onclick="document.getElementById('sendemail').submit(); return false;" >Send guest access leaflet by email </a> </form> <? } ?> </p> <p> <style> table { margin: 1em; border-collapse: collapse; } td, th { padding: .3em; border: 1px #ccc solid; } </style> <div id="printme" style="display:none"> <table width="466" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000"> <tr> <th colspan="2"> Office Guest WIFI Access</th> </tr> <tr> <td width="128">Username</td> <td width="332"><strong> <?=$_REQUEST["User"]?> </strong></td> </tr> <tr> <td>Password</td> <td><strong> <?=$_REQUEST["Pass"]?> </strong></td> </tr> <tr> <td>Life Time</td> <td><strong> <?=$_REQUEST["life"]?> days <br /> <font size="-2" > starting from <?=date("d/M/YH:i:s")?> </font></strong></td> </tr> <tr> <td>Network Name <br /> (SSID)</td> <td><strong>A_GUEST</strong></td> </tr> <tr> <td colspan="2"><div align="center">Welcome to WiFi</div></td> </tr> </table> </div> <? } } } if ($_REQUEST["action"]=="") { if ($_REQUEST["Pass"]=="") { $_REQUEST["Pass"]=generatePassword(4); } ?> <form action="index.php" method="post" enctype="multipart/form-data"><?=$userermsg?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right">USERNAME</td> <td align="left"><input name=User value="<?=$_REQUEST["User"]?>"/> <input name="action" type="hidden" id="action" value="submit" /></td> </tr> <tr> <td align="right">PASSWORD</td> <td align="left"><input value="<?=$_REQUEST["Pass"]?>" id=Pass name=Pass /> [<a href=# onclick="document.getElementById('Pass').value=randomPassword(4); return false;">regenerate</a>] </td> </tr> <tr> <td align="right">LIFETIME*</td> <td align="left"> <input name="life" id="life" size="5" value="<? if(intval($_REQUEST["life"]==0)) { echo 1; } else { echo $_REQUEST["life"]; } ?>" /> <a href=# style="text-decoration:none" class="links" onclick="document.getElementById('life').value=parseInt(document.getElementById('life').value)+1; return false;">[+]</a> <a style="text-decoration:none" href=# class="links" onclick="if (parseInt(document.getElementById('life').value)>1){document.getElementById('life').value=parseInt(document.getElementById('life').value)-1; }return false;">[-]</a> <a style="text-decoration:none" href=# class="links" onclick=" document.getElementById('life').value=29;return false;">[month]</a> <a style="text-decoration:none" href=# class="links" onclick=" document.getElementById('life').value=0;return false;">[0]</a> </span></td> </tr> <tr> <td align="right"> </td> <td align="left">* days</td> </tr> <tr> <td align="right"> </td> <td align="left"> <input type="submit" value=Add /> </td> </tr> <tr> <td align="right" valign="top" > </td> <td align="left"> </td> </tr> <tr> <td align="right" valign="top" ><div align="center"></div></td> <td align="right" valign="top" ><div align="left"><strong>Optional information</strong></div></td> </tr> <tr> <td align="right" valign="top"> </td> <td align="left"> </td> </tr> <tr> <td align="right" valign="middle">Email</td> <td align="left"><input name="email" id="email" value="<?=$_REQUEST["email"]?>" /> <br /></td> </tr> <tr> <td align="right" valign="middle">Additional info</td> <td align="left"><input name="notes" type="text" id="notes" value="<?=$_REQUEST["notes"]?>" size="2" /> </td> </tr> <tr> <td align="right" valign="middle"> </td> <td align="left"><a href=# onclick="document.getElementById('notes').value='staff member'; return false;">SM</a> | <a href=# onclick="document.getElementById('notes').value='natcom user'; return false;">NC</a>| <a href=# onclick="document.getElementById('notes').value='consultant'; return false;">cons</a>| <a href=# onclick="document.getElementById('notes').value='field office user'; return false;">FO</a> | <a href=# onclick="document.getElementById('notes').value='partner company'; return false;">partn</a>  </td> </tr> </table> <p align="right"> </p> <p><br /> <br /> </p> </form> <? } ?> </div> </div> <!--End of each accordion item--> <!--Start of each accordion item--> </div> </body> </html>
      
      







操作の原理は非常に単純で、PHPはすべてのフォームフィールドを生成し、WLCにPOSTリクエストを送信します

スクリプトへのアクセスを制限する必要があります(たとえば、htpasswdを使用)。 mod_ntlmでこれを行いましたが、同時にパスワードを入力する必要がなくなりました-統合認証が使用されます

また、curlを使用してhttps経由で接続することもできます。この場合、WebサーバーとWLCは分離された管理VLANを介して相互に接続されているため、これは重要ではありません。



どうした





その結果、受付スタッフを完全に配置したインターフェースができました。

ゲストアカウントを作成するために必要なことは次のとおりです。



1.アドレスに移動します(デスクトップ上のショートカット)

2.ユーザー作成フォームがすぐに開きます(ログインは不要で、パスワードは再生成されます)



3.ユーザー名を入力します(このログインでユーザーが存在するかどうかをAJAXで確認できます-まだ実装していません)

4.基本的に、アクセスは1日に許可されます(デフォルトで設定されます)-リンクを+と-に増やすか、1か月または1週間にすぐに許可します



5.送信して印刷する



10秒以上かかりません!



All Articles