<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BlueJacket With Silent</title>
	<atom:link href="http://phpsrv.nutn.edu.tw/~silent/feed" rel="self" type="application/rss+xml" />
	<link>http://phpsrv.nutn.edu.tw/~silent</link>
	<description>資訊技術手札</description>
	<lastBuildDate>Wed, 21 Sep 2011 09:35:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://phpsrv.nutn.edu.tw/~silent/?pushpress=hub'/>
	<div id='fb-root'></div>
					<script type='text/javascript'>
						window.fbAsyncInit = function()
						{
							FB.init({appId: null, status: true, cookie: true, xfbml: true});
						};
						(function()
						{
							var e = document.createElement('script'); e.async = true;
							e.src = document.location.protocol + '//connect.facebook.net/zh_TW/all.js';
							document.getElementById('fb-root').appendChild(e);
						}());
					</script>	
						<item>
		<title>[Lab] [OS6400] OmniSwitch Loopback Detection</title>
		<link>http://phpsrv.nutn.edu.tw/~silent/archives/271</link>
		<comments>http://phpsrv.nutn.edu.tw/~silent/archives/271#comments</comments>
		<pubDate>Wed, 21 Sep 2011 09:33:47 +0000</pubDate>
		<dc:creator>水手</dc:creator>
				<category><![CDATA[Alcatel-Lucent]]></category>
		<category><![CDATA[OmniSwitch]]></category>

		<guid isPermaLink="false">http://phpsrv.nutn.edu.tw/~silent/?p=271</guid>
		<description><![CDATA[先前提到OS6250-24M的Loopback Detection&#8230; 現在已經可以在OS6400、OS6850&#8230;等型號實現了 &#8230;.. Firmware 為6.4.4.373.R01 設定方式與OS6250-24M相同.. 但有一點需要注意的是&#8230; 他沒有autorecovery-timer可以設定&#8230; 其實在6400以上的設備&#8230;. 有一個指令是violation-recovery 這個功能是設計成共用的方式&#8230; 比方說Netsec(for OS6850以上)、LBD(Loopback Detection)&#8230;. 當功能觸發時， 會把port shutdown &#8230; 但是你會發現&#8230;用admin up的指令會無效 那是因為他把這些異常歸類為violation 所以你如果要手動恢復&#8230;就要下 若是要等自動恢復&#8230; 可以查看恢復的時間]]></description>
			<content:encoded><![CDATA[<p>先前提到OS6250-24M的Loopback Detection&#8230;<br />
現在已經可以在OS6400、OS6850&#8230;等型號實現了 &#8230;..</p>
<p><span id="more-271"></span><br />
Firmware 為6.4.4.373.R01</p>
<p>設定方式與OS6250-24M相同..<br />
但有一點需要注意的是&#8230;<br />
他沒有autorecovery-timer可以設定&#8230;</p>
<p>其實在6400以上的設備&#8230;.<br />
有一個指令是violation-recovery<br />
這個功能是設計成共用的方式&#8230;<br />
比方說Netsec(for OS6850以上)、LBD(Loopback Detection)&#8230;.<br />
當功能觸發時，<br />
會把port shutdown &#8230;</p>
<p>但是你會發現&#8230;用admin up的指令會無效<br />
那是因為他把這些異常歸類為violation</p>
<p>所以你如果要手動恢復&#8230;就要下</p>
<pre class="brush: plain; title: ; notranslate">interface 1/1 clear-violation-all</pre>
<p>若是要等自動恢復&#8230;<br />
可以查看恢復的時間</p>
<pre class="brush: plain; title: ; notranslate">show interfaces violation-recovery</pre>
<p><a href="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2011/09/violation.png"><img class="alignnone size-medium wp-image-273" title="violation" src="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2011/09/violation-300x75.png" alt="" width="300" height="75" /></a></p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://phpsrv.nutn.edu.tw/~silent/archives/271' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' send='true' /></div>]]></content:encoded>
			<wfw:commentRss>http://phpsrv.nutn.edu.tw/~silent/archives/271/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Lab] OmniSwitch DHCP Snooping 解決DHCP私設IP問題</title>
		<link>http://phpsrv.nutn.edu.tw/~silent/archives/244</link>
		<comments>http://phpsrv.nutn.edu.tw/~silent/archives/244#comments</comments>
		<pubDate>Fri, 17 Jun 2011 11:03:18 +0000</pubDate>
		<dc:creator>水手</dc:creator>
				<category><![CDATA[Alcatel-Lucent]]></category>
		<category><![CDATA[OmniSwitch]]></category>

		<guid isPermaLink="false">http://phpsrv.nutn.edu.tw/~silent/?p=244</guid>
		<description><![CDATA[我們時常會使用DHCP來讓user取得IP上網， 就可以免除讓user自己設定(多半都看不懂，還要去現場幫他設&#8230;) 除此之外， 有些會需要作限制流量的需求， 通常user流量爆了， 會偷偷改一個IP &#8230; 然後，又可以開心的使用網路&#8230; OmniSwitch的dhcp snooping有分兩種模式 switch-level 跟 vlan-level&#8230; switch-level顧名思義就是整個switch都啟動dhcp snooping vlan-level就是針對vlan來作dhcp snooping 但是在vlan-level時，他不支援option82&#8230; 所以各取所需囉&#8230; 以下我就用vlan-level來作說明 指令如下 首先&#8230; 第一行是針對vlan 10來啟動dhcp snooping 接下來再啟動binding的功能(後續會說明啟動這個會有什麼效果) 然後針對port 1/1 來作過濾是否為私設IP port 1/10就是你的dhcp server所接的位置囉，要設定成trust，不然server沒有辦法配IP給user binding這個功能會去比對dhcp server上的mac address mapping table 這樣可以讓他判斷，user到底是跟dhcp server要IP&#8230;還是他自己偷偷設IP 以上述的設定來說&#8230; port 1/1的user，他是無法用私設IP上網，switch會drop他的封包 其他屬於vlan 10的port則可以私設IP來上網&#8230; 這樣我們就知道ip-source-filter的功用囉 另外 有時候我們必須私設一個IP給設備使用， 但是剛好在啟動dhcp snooping的vlan裡， 這時我們可以設定一個static的binding&#8230;. 這樣這個設備就可以從port 1/1 私設192.168.10.20來上網囉 要拿掉的話就下 另外有一點很重要的是&#8230; 有時候我們常常會遇到私設IP的人&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>我們時常會使用DHCP來讓user取得IP上網，<br />
就可以免除讓user自己設定(多半都看不懂，還要去現場幫他設&#8230;)</p>
<p>除此之外，<br />
有些會需要作限制流量的需求，<br />
通常user流量爆了，<br />
會偷偷改一個IP &#8230;<br />
然後，又可以開心的使用網路&#8230;</p>
<p><span id="more-244"></span></p>
<p>OmniSwitch的dhcp snooping有分兩種模式<br />
switch-level 跟 vlan-level&#8230;<br />
switch-level顧名思義就是整個switch都啟動dhcp snooping<br />
vlan-level就是針對vlan來作dhcp snooping<br />
但是在vlan-level時，他不支援option82&#8230;<br />
所以各取所需囉&#8230;</p>
<p>以下我就用vlan-level來作說明<br />
指令如下</p>
<pre class="brush: plain; title: ; notranslate">
ip helper dhcp-snooping vlan 10
ip helper dhcp-snooping binding enable
ip helper dhcp-snooping port 1/1 ip-source-filter enable
ip helper dhcp-snooping port 1/10 trust
</pre>
<p>首先&#8230;<br />
第一行是針對vlan 10來啟動dhcp snooping<br />
接下來再啟動binding的功能(後續會說明啟動這個會有什麼效果)<br />
然後針對port 1/1 來作過濾是否為私設IP<br />
port 1/10就是你的dhcp server所接的位置囉，要設定成trust，不然server沒有辦法配IP給user</p>
<p>binding這個功能會去比對dhcp server上的mac address mapping table<br />
這樣可以讓他判斷，user到底是跟dhcp server要IP&#8230;還是他自己偷偷設IP</p>
<p>以上述的設定來說&#8230;<br />
port 1/1的user，他是無法用私設IP上網，switch會drop他的封包<br />
其他屬於vlan 10的port則可以私設IP來上網&#8230;<br />
這樣我們就知道ip-source-filter的功用囉</p>
<p>另外<br />
有時候我們必須私設一個IP給設備使用，<br />
但是剛好在啟動dhcp snooping的vlan裡，<br />
這時我們可以設定一個static的binding&#8230;.</p>
<pre class="brush: plain; title: ; notranslate">
ip helper dhcp-snooping binding ff:ff:ff:ff:ff:ff port 1/1 address 192.168.10.20 vlan 10
</pre>
<p>這樣這個設備就可以從port 1/1 私設192.168.10.20來上網囉<br />
要拿掉的話就下</p>
<pre class="brush: plain; title: ; notranslate">
no ip helper dhcp-snooping binding ff:ff:ff:ff:ff:ff port 1/1
</pre>
<p>另外有一點很重要的是&#8230;<br />
有時候我們常常會遇到私設IP的人&#8230;<br />
設定到我們正常使用的IP&#8230;<br />
當他比我們早一步連通網路時&#8230;<br />
windows就會跳出一個視窗寫說網路上有一個位址的IP跟您衝突&#8230;..<br />
一時間要抓是誰，也很困擾&#8230;<br />
若又是緊急需要上網查資料&#8230;結果不能用&#8230;還真的很想砍人&#8230;.</p>
<p>但是當有啟動binding以及ip-source-filter時，<br />
就不用擔心有人盜你的IP&#8230;<br />
就算他比你早開機&#8230;<br />
也不用擔心不能上網，跳出IP衝突的視窗了&#8230;<br />
是不是很棒呢&#8230;</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://phpsrv.nutn.edu.tw/~silent/archives/244' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' send='true' /></div>]]></content:encoded>
			<wfw:commentRss>http://phpsrv.nutn.edu.tw/~silent/archives/244/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Lab] [OS6250-24M] OmniSwitch Single Port Loopback Detection</title>
		<link>http://phpsrv.nutn.edu.tw/~silent/archives/228</link>
		<comments>http://phpsrv.nutn.edu.tw/~silent/archives/228#comments</comments>
		<pubDate>Tue, 31 May 2011 07:54:29 +0000</pubDate>
		<dc:creator>水手</dc:creator>
				<category><![CDATA[Alcatel-Lucent]]></category>
		<category><![CDATA[OmniSwitch]]></category>

		<guid isPermaLink="false">http://phpsrv.nutn.edu.tw/~silent/?p=228</guid>
		<description><![CDATA[以往在Switch上， 我們可以利用Spanning tree去管制port loop(此處說的是具有網管功能的Switch)， 但前提是&#8230; loop必須產生在Switch的port上 .. 但在實際的環境中， 絕大部分都是Switch底下串Hub， 而loop都是在Hub上產生&#8230; 此時Switch上的Spanning tree就毫無招架之力&#8230; 只能任由Broadcast Storm無情的肆虐著我們的網路&#8230;.&#62;.&#60;&#124;&#124;&#124; 這種情形一般都稱做Single Port Loopback&#8230; 目前知道Extreme 全系列有抑制Single Port Loopback的功能(聽說的&#8230;小弟還沒實際測過) 現在OmniSwitch也有支援這個功能了， 並且將功能放在新的OS6250 Metro Models 目前M Models有出OS6250-8M、24M 而且他的AOS不是採用OS LS 6200系列的firmware&#8230; 所以在指令上面可以統一了&#8230;. 在 Loopback Detection的部份預設是沒有啟動&#8230; 可以透過指令將他啟動 transmission-timer表示偵測幾秒後將port shutdown autorecovery-timer表示幾秒後將port恢復]]></description>
			<content:encoded><![CDATA[<p>以往在Switch上，<br />
我們可以利用Spanning tree去管制port loop(此處說的是具有網管功能的Switch)，<br />
但前提是&#8230;<br />
loop必須產生在Switch的port上 ..</p>
<p>但在實際的環境中，<br />
絕大部分都是Switch底下串Hub，<br />
而loop都是在Hub上產生&#8230;<br />
此時Switch上的Spanning tree就毫無招架之力&#8230;<br />
只能任由Broadcast Storm無情的肆虐著我們的網路&#8230;.&gt;.&lt;|||</p>
<p><span id="more-228"></span></p>
<p>這種情形一般都稱做Single Port Loopback&#8230;<br />
目前知道Extreme 全系列有抑制Single Port Loopback的功能(聽說的&#8230;小弟還沒實際測過)</p>
<p>現在OmniSwitch也有支援這個功能了，<br />
並且將功能放在新的OS6250 Metro Models</p>
<p><a href="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2011/05/OS6250-24M.jpg"><img class="alignnone size-medium wp-image-233" title="OS6250-24M" src="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2011/05/OS6250-24M-300x225.jpg" alt="" width="300" height="225" /><br />
</a>目前M Models有出OS6250-8M、24M<br />
而且他的AOS不是採用OS LS 6200系列的firmware&#8230;<br />
所以在指令上面可以統一了&#8230;.</p>
<p>在 Loopback Detection的部份預設是沒有啟動&#8230;<br />
可以透過指令將他啟動</p>
<pre class="brush: plain; title: ; notranslate">
loopback-detection enable
loopback-detection transmission-timer 5
loopback-detection autorecovery-timer 60
loopback-detection port 1/1-28 enable
</pre>
<p>transmission-timer表示偵測幾秒後將port shutdown<br />
autorecovery-timer表示幾秒後將port恢復</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://phpsrv.nutn.edu.tw/~silent/archives/228' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' send='true' /></div>]]></content:encoded>
			<wfw:commentRss>http://phpsrv.nutn.edu.tw/~silent/archives/228/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Lab] OmniSwitch Routing by RIP</title>
		<link>http://phpsrv.nutn.edu.tw/~silent/archives/208</link>
		<comments>http://phpsrv.nutn.edu.tw/~silent/archives/208#comments</comments>
		<pubDate>Mon, 11 Apr 2011 06:20:44 +0000</pubDate>
		<dc:creator>水手</dc:creator>
				<category><![CDATA[Alcatel-Lucent]]></category>
		<category><![CDATA[OmniSwitch]]></category>

		<guid isPermaLink="false">http://phpsrv.nutn.edu.tw/~silent/?p=208</guid>
		<description><![CDATA[這個Lab的環境是 router : OS6400 RIP v2&#8230;(Omniswitch send預設v2, receive預設both) Local route&#8230; 基本上在官方User Guide裡面有基本的設定， 但是需要注意的是route-map與redist的部份， 如果沒有設定這兩個，route是不會出現任何rip routing 如果你的環境是static route 那就要把ip redist改成static into rip route-map名稱也記得改一下，以免混淆&#8230; 以下為router設定 R1 R2 設定完後， RIP就會自動生效， 下圖為生效後的狀況 &#160;]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2011/04/rip.jpg"><img class="size-medium wp-image-209 aligncenter" title="rip" src="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2011/04/rip-273x300.jpg" alt="" width="273" height="300" /></a></p>
<p>這個Lab的環境是<br />
router : OS6400<br />
RIP v2&#8230;(Omniswitch send預設v2, receive預設both)<br />
Local route&#8230;<br />
<span id="more-208"></span><br />
基本上在官方User Guide裡面有基本的設定，<br />
但是需要注意的是route-map與redist的部份，<br />
如果沒有設定這兩個，route是不會出現任何rip routing</p>
<p>如果你的環境是static route<br />
那就要把ip redist改成static into rip<br />
route-map名稱也記得改一下，以免混淆&#8230;</p>
<p>以下為router設定</p>
<p>R1</p>
<pre class="brush: plain; title: ; notranslate">
vlan 1 enable name &quot;VLAN 1&quot;
vlan 2 enable name &quot;VLAN 2&quot;
vlan 2 port default 1/5

ip interface &quot;VLAN 1&quot; address 192.168.1.254 mask 255.255.255.0 vlan 1 ifindex 1
ip interface &quot;VLAN 2&quot; address 192.168.3.254 mask 255.255.255.0 vlan 2 ifindex 2

ip load rip
ip rip interface &quot;VLAN 1&quot;
ip rip interface &quot;VLAN 1&quot; status enable
ip rip status enable

ip route-map &quot;local-to-rip&quot; sequence-number 10 action permit
ip redist local into rip route-map &quot;local-to-rip&quot; status enable
</pre>
<p>R2</p>
<pre class="brush: plain; title: ; notranslate">
vlan 1 enable name &quot;VLAN 1&quot;
vlan 2 enable name &quot;VLAN 2&quot;
vlan 2 port default 1/5

ip interface &quot;VLAN 1&quot; address 192.168.1.253 mask 255.255.255.0 vlan 1 ifindex 1
ip interface &quot;VLAN 2&quot; address 192.168.2.254 mask 255.255.255.0 vlan 2 ifindex 2

ip load rip
ip rip interface &quot;VLAN 1&quot;
ip rip interface &quot;VLAN 1&quot; status enable
ip rip status enable

ip route-map &quot;local-to-rip&quot; sequence-number 10 action permit
ip redist local into rip route-map &quot;local-to-rip&quot; status enable
</pre>
<p>設定完後，<br />
RIP就會自動生效，<br />
下圖為生效後的狀況</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2011/04/rip-result.jpg"><img class="size-medium wp-image-217 aligncenter" title="rip-result" src="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2011/04/rip-result-300x203.jpg" alt="" width="300" height="203" /></a></p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://phpsrv.nutn.edu.tw/~silent/archives/208' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' send='true' /></div>]]></content:encoded>
			<wfw:commentRss>http://phpsrv.nutn.edu.tw/~silent/archives/208/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Ubuntu] 啟動Two Finger Touchpad</title>
		<link>http://phpsrv.nutn.edu.tw/~silent/archives/183</link>
		<comments>http://phpsrv.nutn.edu.tw/~silent/archives/183#comments</comments>
		<pubDate>Thu, 03 Feb 2011 10:10:34 +0000</pubDate>
		<dc:creator>水手</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://phpsrv.nutn.edu.tw/~silent/?p=183</guid>
		<description><![CDATA[找了一下子才找到解決方法， 大部分找到的都是要用xinput來啟動 這個方法可能適用10版之前吧&#8230; 目前我裝在NB上的是10.10 NB是asus u36jc 相關的說明在這裡 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/308191/ 啟動方法是先下載一個package https://bugs.launchpad.net/ubuntu/+source/linux/+bug/308191/+attachment/1771346/+files/synaptics-dkms_1.1.1_all.deb 安裝完後重新啟動 然後在系統->偏好設定->滑鼠 點到觸控板的頁簽 會發現底下捲動方式的兩點捲動已經可以點了（沒裝package之前都不能點） 點了他之後就可以用囉]]></description>
			<content:encoded><![CDATA[<p>找了一下子才找到解決方法，<br />
大部分找到的都是要用xinput來啟動<br />
這個方法可能適用10版之前吧&#8230;<br />
<span id="more-183"></span><br />
目前我裝在NB上的是10.10<br />
NB是asus u36jc</p>
<p>相關的說明在這裡<br />
<a target="_blank" href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/308191/">https://bugs.launchpad.net/ubuntu/+source/linux/+bug/308191/</a></p>
<p>啟動方法是先下載一個package<br />
<a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/308191/+attachment/1771346/+files/synaptics-dkms_1.1.1_all.deb">https://bugs.launchpad.net/ubuntu/+source/linux/+bug/308191/+attachment/1771346/+files/synaptics-dkms_1.1.1_all.deb</a></p>
<p>安裝完後重新啟動<br />
然後在系統->偏好設定->滑鼠<br />
點到觸控板的頁簽<br />
會發現底下捲動方式的兩點捲動已經可以點了（沒裝package之前都不能點）<br />
點了他之後就可以用囉<br />
<a href="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2011/02/touchpad.png"><img src="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2011/02/touchpad-300x168.png" alt="" title="touchpad" width="300" height="168" class="alignnone size-medium wp-image-184" /></a></p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://phpsrv.nutn.edu.tw/~silent/archives/183' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' send='true' /></div>]]></content:encoded>
			<wfw:commentRss>http://phpsrv.nutn.edu.tw/~silent/archives/183/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PFsense] Captive Portal Local認證+Radius</title>
		<link>http://phpsrv.nutn.edu.tw/~silent/archives/175</link>
		<comments>http://phpsrv.nutn.edu.tw/~silent/archives/175#comments</comments>
		<pubDate>Mon, 29 Nov 2010 00:15:27 +0000</pubDate>
		<dc:creator>水手</dc:creator>
				<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[pfsense]]></category>

		<guid isPermaLink="false">http://phpsrv.nutn.edu.tw/~silent/?p=175</guid>
		<description><![CDATA[最近替一間學校的圖書館放了一台PFsense 要幫fat AP做captive portal.. PFsense預設只能選擇一種認證方式, 所以免不了要改程式&#8230; 請用shell方式登入 編輯/usr/local/captiveportal/index.php 找 把他們全部註解掉 or 刪除 再找 改成 觀念很簡單&#8230; 只是把原本註解的Local認證&#8230; 改到判斷radius的地方.. 優先從Local認證&#8230; 失敗後&#8230;再判斷radius&#8230; 改完後&#8230; 請把預設選項設定成RADIUS authentication]]></description>
			<content:encoded><![CDATA[<p>最近替一間學校的圖書館放了一台PFsense<br />
要幫fat AP做captive portal..</p>
<p>PFsense預設只能選擇一種認證方式,<br />
<a href="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2010/11/pfsense-cp.png"><img src="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2010/11/pfsense-cp-300x68.png" alt="" title="pfsense-cp" width="300" height="68" class="alignnone size-medium wp-image-176" /></a><br />
所以免不了要改程式&#8230;<br />
<span id="more-175"></span><br />
請用shell方式登入<br />
編輯/usr/local/captiveportal/index.php<br />
找</p>
<pre class="brush: php; title: ; notranslate">
} else if ($_POST['accept'] &amp;&amp; $config['captiveportal']['auth_method'] == &quot;local&quot;) {

    //check against local usermanager
    $userdb = &amp;$config['captiveportal']['user'];

    $loginok = false;

    //erase expired accounts
    if (is_array($userdb)) {
        $moddb = false;
        for ($i = 0; $i &lt; count($userdb); $i++) {
            if ($userdb[$i]['expirationdate'] &amp;&amp; (strtotime(&quot;-1 day&quot;) &gt; strtotime($userdb[$i]['expirationdate']))) {
                unset($userdb[$i]);
                $moddb = true;
            }
        }
        if ($moddb)
            write_config();

        $userdb = &amp;$config['captiveportal']['user'];

        for ($i = 0; $i &lt; count($userdb); $i++) {
            if (($userdb[$i]['name'] == $_POST['auth_user']) &amp;&amp; ($userdb[$i]['password'] == md5($_POST['auth_pass']))) {
                $loginok = true;
                break;
            }
        }
    }

    if ($loginok){
        captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,&quot;LOGIN&quot;);
        portal_allow($clientip, $clientmac,$_POST['auth_user']);
    } else {
        captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,&quot;FAILURE&quot;);
        portal_reply_page($redirurl, &quot;error&quot;);
    }
</pre>
<p>把他們全部註解掉 or 刪除</p>
<p>再找</p>
<pre class="brush: php; title: ; notranslate">
} else if ($_POST['accept'] &amp;&amp; $radius_enable) {

    if ($_POST['auth_user'] &amp;&amp; $_POST['auth_pass']) {
        $auth_list = radius($_POST['auth_user'],$_POST['auth_pass'],$clientip,$clientmac,&quot;USER LOGIN&quot;);

        if ($auth_list['auth_val'] == 1) {
            captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,&quot;ERROR&quot;,$auth_list['error']);
            portal_reply_page($redirurl, &quot;error&quot;, $auth_list['error']);
        }
        else if ($auth_list['auth_val'] == 3) {
            captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,&quot;FAILURE&quot;,$auth_list['reply_message']);
            portal_reply_page($redirurl, &quot;error&quot;, $auth_list['reply_message']);
        }
    } else {
        captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,&quot;ERROR&quot;);
        portal_reply_page($redirurl, &quot;error&quot;);
    }
</pre>
<p>改成</p>
<pre class="brush: php; title: ; notranslate">
} else if ($_POST['accept'] &amp;&amp; $radius_enable) {

    //check against local usermanager
    $userdb = &amp;$config['captiveportal']['user'];

    $loginok = false;

    //erase expired accounts
    if (is_array($userdb)) {
        $moddb = false;
        for ($i = 0; $i &lt; count($userdb); $i++) {
            if ($userdb[$i]['expirationdate'] &amp;&amp; (strtotime(&quot;-1 day&quot;) &gt; strtotime($userdb[$i]['expirationdate']))) {
                unset($userdb[$i]);
                $moddb = true;
            }
        }
        if ($moddb)
            write_config();

        $userdb = &amp;$config['captiveportal']['user'];

        for ($i = 0; $i &lt; count($userdb); $i++) {
            if (($userdb[$i]['name'] == $_POST['auth_user']) &amp;&amp; ($userdb[$i]['password'] == md5($_POST['auth_pass']))) {
                $loginok = true;
                break;
            }
        }
    }

    if ($loginok){
        captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,&quot;LOGIN&quot;);
        portal_allow($clientip, $clientmac,$_POST['auth_user']);
    } else {
        if ($_POST['auth_user'] &amp;&amp; $_POST['auth_pass']) {
            $auth_list = radius($_POST['auth_user'],$_POST['auth_pass'],$clientip,$clientmac,&quot;USER LOGIN&quot;);

            if ($auth_list['auth_val'] == 1) {
                captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,&quot;ERROR&quot;,$auth_list['error']);
                portal_reply_page($redirurl, &quot;error&quot;, $auth_list['error']);
            }
            else if ($auth_list['auth_val'] == 3) {
                captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,&quot;FAILURE&quot;,$auth_list['reply_message']);
                portal_reply_page($redirurl, &quot;error&quot;, $auth_list['reply_message']);
            }
        } else {
            captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,&quot;ERROR&quot;);
            portal_reply_page($redirurl, &quot;error&quot;);
        }
    }
</pre>
<p>觀念很簡單&#8230;<br />
只是把原本註解的Local認證&#8230;<br />
改到判斷radius的地方..<br />
優先從Local認證&#8230;<br />
失敗後&#8230;再判斷radius&#8230;</p>
<p>改完後&#8230;<br />
請把預設選項設定成RADIUS authentication</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://phpsrv.nutn.edu.tw/~silent/archives/175' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' send='true' /></div>]]></content:encoded>
			<wfw:commentRss>http://phpsrv.nutn.edu.tw/~silent/archives/175/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alcatel Omniswitch cacti template</title>
		<link>http://phpsrv.nutn.edu.tw/~silent/archives/149</link>
		<comments>http://phpsrv.nutn.edu.tw/~silent/archives/149#comments</comments>
		<pubDate>Tue, 17 Aug 2010 14:42:32 +0000</pubDate>
		<dc:creator>水手</dc:creator>
				<category><![CDATA[MIS]]></category>
		<category><![CDATA[Alcatel-Lucent]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[OmniSwitch]]></category>

		<guid isPermaLink="false">http://phpsrv.nutn.edu.tw/~silent/?p=149</guid>
		<description><![CDATA[給Alcatel OmniSwitch用的template 有分多個slot跟一般的switch 以下就是多個slot的圖跟68系列的圖， 基本上&#8230;68系列都是cmm跟slot1， 66系列的是cmm跟slot8&#8230;. 就看自己的需求去調配&#8230; MultiSlot的部份基本上就是直接拉16個slot上去&#8230; 沒有接的就會呈現-nan&#8230; 所以往後有新增slot～他會自己產生數據～不需要再去調整&#8230;]]></description>
			<content:encoded><![CDATA[<p>給Alcatel OmniSwitch用的template</p>
<p>有分多個slot跟一般的switch<span id="more-149"></span></p>
<p>以下就是多個slot的圖跟68系列的圖，</p>
<p>基本上&#8230;68系列都是cmm跟slot1，<br />
66系列的是cmm跟slot8&#8230;.<br />
就看自己的需求去調配&#8230;</p>
<p>MultiSlot的部份基本上就是直接拉16個slot上去&#8230;<br />
沒有接的就會呈現-nan&#8230;<br />
所以往後有新增slot～他會自己產生數據～不需要再去調整&#8230;</p>
<p><a href="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2010/08/graph_image.php_.png"><img class="alignnone size-medium wp-image-151" title="OS7800" src="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2010/08/graph_image.php_-300x210.png" alt="" width="300" height="210" /></a></p>
<p><a href="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2010/08/os68.png"><img class="alignnone size-medium wp-image-157" title="os68" src="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2010/08/os68-300x106.png" alt="" width="300" height="106" /></a></p>
<a href="http://phpsrv.nutn.edu.tw/~silent/wp-content/plugins/download-monitor/download.php?id=4">cacti alcatel template - 18.56 kB</a> - 下載次數 145
<div class='wpfblike' style='height: 40px;'><fb:like href='http://phpsrv.nutn.edu.tw/~silent/archives/149' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' send='true' /></div>]]></content:encoded>
			<wfw:commentRss>http://phpsrv.nutn.edu.tw/~silent/archives/149/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>自動備份Alcatel OmniSwitch設定檔</title>
		<link>http://phpsrv.nutn.edu.tw/~silent/archives/134</link>
		<comments>http://phpsrv.nutn.edu.tw/~silent/archives/134#comments</comments>
		<pubDate>Thu, 17 Jun 2010 16:53:42 +0000</pubDate>
		<dc:creator>水手</dc:creator>
				<category><![CDATA[Alcatel-Lucent]]></category>
		<category><![CDATA[OmniSwitch]]></category>

		<guid isPermaLink="false">http://phpsrv.nutn.edu.tw/~silent/?p=134</guid>
		<description><![CDATA[續之前自動備份FortiGate設定檔 把他改成給Alcatel OmniSwitch使用]]></description>
			<content:encoded><![CDATA[<p>續之前自動備份FortiGate設定檔<br />
把他改成給Alcatel OmniSwitch使用<br />
<span id="more-134"></span></p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
user=&quot;帳號&quot;
password=&quot;密碼&quot;
tftp_ip=&quot;tftp的主機&quot;
ac_devices=&quot;Alcatel的ip1 Alcatel的ip2&quot;
date=&quot;$(date +&quot;%Y%m%d&quot;)&quot;

for ac_device in $ac_devices ; do
  expect -c &quot;
  set timeout 10
  spawn ssh $user@$ac_device
  expect \&quot;(yes/no)\&quot; { send \&quot;yes\r\&quot;; exp_continue }
  expect \&quot;*?method:\&quot;
  set send_slow {1 0.05}
  send -s \&quot;$password\r\&quot;
  expect \&quot;*-&gt;\&quot;
  send -s \&quot;tftp $tftp_ip put source-file /flash/working/boot.cfg destination-file $date.cfg ascii\n\&quot;
  expect \&quot;*-&gt;\&quot;
  send -s \&quot;exit\n\&quot;
  interact&quot;

  mv /home/tftproot/$date.cfg /home/alcatelconfig/$ac_device/$date.cfg
done
</pre>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://phpsrv.nutn.edu.tw/~silent/archives/134' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' send='true' /></div>]]></content:encoded>
			<wfw:commentRss>http://phpsrv.nutn.edu.tw/~silent/archives/134/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OmniSwitch Mobile Vlan特性解說</title>
		<link>http://phpsrv.nutn.edu.tw/~silent/archives/130</link>
		<comments>http://phpsrv.nutn.edu.tw/~silent/archives/130#comments</comments>
		<pubDate>Mon, 14 Jun 2010 07:11:13 +0000</pubDate>
		<dc:creator>水手</dc:creator>
				<category><![CDATA[Alcatel-Lucent]]></category>
		<category><![CDATA[OmniSwitch]]></category>

		<guid isPermaLink="false">http://phpsrv.nutn.edu.tw/~silent/?p=130</guid>
		<description><![CDATA[Mobile Vlan是屬於Alcatel Switch的一個特殊功能, 他可以解決Mutliple Gateway by Vlan 的Broadcast domain過大而造成整個domain不穩定的問題 卻又可發揮相同的功效&#8230;.也就是說不同的網段可以共用一個port上線&#8230; 但是使用上必須要注意一點&#8230;. 這個port底下最好不要有Server &#8230;. 為什麼會說不要有Server呢&#8230; 除非你Server的網段是default vlan&#8230;. 不然就會發生我們俗稱 "睡著" 的問題&#8230;. 如果閒置一段時間&#8230;這台Server會消失在Gateway的arp table表中&#8230; 這&#8230;.應該算是保護機制吧 &#8230; 要如何開啟mobile的功能呢&#8230;. 這就是啟動後的效果 如果要取消&#8230;則是]]></description>
			<content:encoded><![CDATA[<p>Mobile Vlan是屬於Alcatel Switch的一個特殊功能,</p>
<p>他可以解決Mutliple Gateway by Vlan 的Broadcast domain過大而造成整個domain不穩定的問題<br />
卻又可發揮相同的功效&#8230;.也就是說不同的網段可以共用一個port上線&#8230;<br />
<span id="more-130"></span><br />
但是使用上必須要注意一點&#8230;.<br />
這個port底下最好不要有Server &#8230;.</p>
<p>為什麼會說不要有Server呢&#8230;<br />
除非你Server的網段是default vlan&#8230;.<br />
不然就會發生我們俗稱 "睡著" 的問題&#8230;.</p>
<p>如果閒置一段時間&#8230;這台Server會消失在Gateway的arp table表中&#8230;<br />
這&#8230;.應該算是保護機制吧 &#8230;</p>
<p>要如何開啟mobile的功能呢&#8230;.</p>
<pre class="brush: plain; title: ; notranslate">vlan port mobile 1/1</pre>
<p>這就是啟動後的效果<br />
<a href="http://phpsrv.nutn.edu.tw/~silent/archives/130/attachment/5284008727" rel="attachment wp-att-131"><img class="alignnone size-full wp-image-131" title="mobile vlan enable" src="http://phpsrv.nutn.edu.tw/~silent/wp-content/uploads/2010/06/5284008727.png" alt="" width="265" height="160" /></a></p>
<p>如果要取消&#8230;則是</p>
<pre class="brush: plain; title: ; notranslate">vlan no port mobile 1/1</pre>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://phpsrv.nutn.edu.tw/~silent/archives/130' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' send='true' /></div>]]></content:encoded>
			<wfw:commentRss>http://phpsrv.nutn.edu.tw/~silent/archives/130/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeRadius pop3認證程式(加入pop3 ssl認證判斷)</title>
		<link>http://phpsrv.nutn.edu.tw/~silent/archives/126</link>
		<comments>http://phpsrv.nutn.edu.tw/~silent/archives/126#comments</comments>
		<pubDate>Tue, 09 Mar 2010 09:07:31 +0000</pubDate>
		<dc:creator>水手</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[FreeRadius]]></category>
		<category><![CDATA[pop3 auth]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://phpsrv.nutn.edu.tw/~silent/?p=126</guid>
		<description><![CDATA[2010-10-07 這次把ssl判斷也加上去囉&#8230; 這樣就可以對只能用pop3s協定的主機做認證了 使用前&#8230;perl必須先安裝兩個模組 日前有廠商問我有沒有辦法寫一個pop3認證程式給radius用 我是記得之前有人有改過用pam去做認證，但是一次只能對一台pop3做認證&#8230; 雖然有人有改出來&#8230;但是卻沒有提供source 而我以前的師父是直接改pam的source去達成&#8230;. http://cym6112.blogspot.com/2008/01/freeradius-pampop3-mail-server-pop3.html 那我的作法&#8230;因為我比較懶惰..我想要能夠持續用apt或者是yum去更新server的套件&#8230; 所以是用外掛的方式&#8230;寫一隻script去完成這項工作 這隻程式就看你要丟去哪裡囉&#8230; 記得要讓freeradius的使用帳號有權限去執行它.. 程式裡面的 login success 看你要輸出什麼參數給radius做接收&#8230; fail的話就不要輸出任何訊息 接下來要如何使用這隻script呢？ 我們要先編輯users 下面加入 加完之後&#8230;記得要去proxy.conf裡面去加入你需要的認證主機的domain哦]]></description>
			<content:encoded><![CDATA[<p>2010-10-07<br />
這次把ssl判斷也加上去囉&#8230;<br />
這樣就可以對只能用pop3s協定的主機做認證了<br />
使用前&#8230;perl必須先安裝兩個模組</p>
<pre class="brush: bash; title: ; notranslate">
#cpan

cpan[1]&gt;install Mail::POP3Client
cpan[2]&gt;install IO::Socket::SSL
</pre>
<hr /></p>
<p>日前有廠商問我有沒有辦法寫一個pop3認證程式給radius用</p>
<p>我是記得之前有人有改過用pam去做認證，但是一次只能對一台pop3做認證&#8230;<br />
雖然有人有改出來&#8230;但是卻沒有提供source</p>
<p>而我以前的師父是直接改pam的source去達成&#8230;.<br />
<a href="http://cym6112.blogspot.com/2008/01/freeradius-pampop3-mail-server-pop3.html" target="_blank">http://cym6112.blogspot.com/2008/01/freeradius-pampop3-mail-server-pop3.html</a></p>
<p>那我的作法&#8230;因為我比較懶惰..我想要能夠持續用apt或者是yum去更新server的套件&#8230;<br />
所以是用外掛的方式&#8230;寫一隻script去完成這項工作<br />
<span id="more-126"></span></p>
<pre class="brush: perl; title: ; notranslate">
#!/usr/bin/perl
# Example:
# pop3.pl 你的認證主機 username password 是否使用ssl(1 or 0)

use Mail::POP3Client;

my $hostname=$ARGV[0];
my $username=$ARGV[1];
my $password=$ARGV[2];
my $ssl=$ARGV[3];

$pop = Mail::POP3Client-&gt;new(
        USER =&gt; $username,
        PASSWORD =&gt; $password,
        HOST =&gt; $hostname,
        USESSL =&gt; $ssl,
);

if($pop-&gt;Connect()){
  # login success
  # ex... &quot;Aruba-User-Role = guest&quot;;
  print &quot;&quot;;
}else{
  # login fail
  exit 4;
}
$pop-&gt;Close;
</pre>
<p>這隻程式就看你要丟去哪裡囉&#8230;<br />
記得要讓freeradius的使用帳號有權限去執行它..</p>
<p>程式裡面的 login success<br />
看你要輸出什麼參數給radius做接收&#8230;<br />
fail的話就不要輸出任何訊息</p>
<p>接下來要如何使用這隻script呢？<br />
我們要先編輯users<br />
下面加入</p>
<pre class="brush: bash; title: ; notranslate">
DEFAULT Auth-Type = Accept, User-Name !~ &quot;@&quot;
        Exec-Program-Wait = &quot;/usr/local/bin/pop3.pl 你的認證主機 %u %{Password} 0&quot;,
        Fall-Through = 1,

DEFAULT Auth-Type = Accept, User-Name =~ &quot;@你的認證主機domain&quot;
        Exec-Program-Wait = &quot;/usr/local/bin/pop3.pl 你的認證主機 %u %{Password} 1&quot;,
        Fall-Through = 1,
</pre>
<p>加完之後&#8230;記得要去proxy.conf裡面去加入你需要的認證主機的domain哦</p>
<div class='wpfblike' style='height: 40px;'><fb:like href='http://phpsrv.nutn.edu.tw/~silent/archives/126' layout='button_count' show_faces='true' width='400' action='like' colorscheme='light' send='true' /></div>]]></content:encoded>
			<wfw:commentRss>http://phpsrv.nutn.edu.tw/~silent/archives/126/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

