<?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>fake &#8211; richliu&#039;s blog</title>
	<atom:link href="https://richliu.com/tag/fake/feed/" rel="self" type="application/rss+xml" />
	<link>https://richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Wed, 24 Dec 2008 05:57:11 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[Linux] fakenetdev 假的 network interface</title>
		<link>https://richliu.com/2008/12/24/667/linux-fakenetdev-%e5%81%87%e7%9a%84-network-interface/</link>
					<comments>https://richliu.com/2008/12/24/667/linux-fakenetdev-%e5%81%87%e7%9a%84-network-interface/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 24 Dec 2008 05:57:11 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[fake]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[network driver]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=667</guid>

					<description><![CDATA[<p>有些時候, 我們會需要一個假的 network device. 像是 1) 某些軟體會去 check netw [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2008/12/24/667/linux-fakenetdev-%e5%81%87%e7%9a%84-network-interface/">[Linux] fakenetdev 假的 network interface</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>有些時候, 我們會需要一個假的 network device.<br />
像是<br />
1) 某些軟體會去 check network interface<br />
2) 需要學習寫作一些軟體</p>
<p>所以我花了一點點時間寫了這一個 kernel modules<br />
主要功能就是在 linux 下建立一個假的 network interface<br />
這個 network interface<br />
只能送(馬上就 free 掉 packet buffer), 沒有收的 function .</p>
<p>在 insert 時, 可以用參數 name 和 mac 指定特定的 network device name 和 mac address.<br />
ex: # insmod fakenetdev.ko name=fake0 mac=00:aa:bb:cc:dd:ee<br />
mac 的格式也可以是 00aabbccddee 或 00-aa-bb-cc-dd-ee<br />
也支援用 ifconfig 修改 mac<br />
ex: # ifconfig eth2 down<br />
# ifconfig eth2 hw ether 00:aa:bb:cc:dd:ee<br />
# ifconfig eth2 up</p>
<p>這個程式在 ubuntu 8.10 (interpid), Linux kernel 2.6.27 下測試.<br />
目前看起來沒有很大的問題, 原作者要用的目地可以達到</p>
<p>可以從這個 URL 下載程式 <a href="https://sourceforge.net/project/showfiles.php?group_id=248740&amp;package_id=303790&amp;release_id=649323" target="_blank" rel="noopener">fakenetdev</a></p>
<p>&#8212; English &#8212;<br />
Sometimes, we will need a fake network device for some purpose<br />
like,<br />
1) cheat some software which will check network mac<br />
2) learn how to write a simple network device driver</p>
<p>So, I spend a little time to write this kernel module.<br />
Major function is that create fake network interface.<br />
It can send packet, but driver will free it immediately.</p>
<p>When insert modules, the module support argument &#8220;name&#8221; and &#8220;mac&#8221; to<br />
modify default name and mac.<br />
ex: # insmod fakenetdev.ko name=fake0 mac=00:aa:bb:cc:dd:ee<br />
it also support other format for mac, like 00aabbccddee or 00-aa-bb-cc-dd-ee<br />
and support modify mac by ifconfig<br />
ex: # ifconfig eth2 down<br />
# ifconfig eth2 hw ether 00:aa:bb:cc:dd:ee<br />
# ifconfig eth2 up</p>
<p>This module was tested at ubuntu 8.10 (interpid), Linux kernel 2.6.27.<br />
It seems work fine for me .</p>
<p>You can download follow this link <a href="https://sourceforge.net/project/showfiles.php?group_id=248740&amp;package_id=303790&amp;release_id=649323" target="_blank" rel="noopener">fakenetdev</a></p>
<p>&#8212;</p>
<p>後記:</p>
<p>這 Driver 不難寫, 麻煩的是在 Debug .不小心少寫一行就 Core Dump.<br />
又懶得弄 KGDB 或是 User Mode Linux, 因為弄的時可能比寫完還多<br />
網路上掃了一遍沒有看到馬上可以用的, 所以就自己亂寫, 希望<br />
大家都可以用得到, 因為是用在*謎*用途的呀 :p</p>
<p>不過這個功能可以用 dummy device 達成,<br />
我寫的頂多就是可以在 load driver 的時候改 name 和 mac .</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2008/12/24/667/linux-fakenetdev-%e5%81%87%e7%9a%84-network-interface/">[Linux] fakenetdev 假的 network interface</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2008/12/24/667/linux-fakenetdev-%e5%81%87%e7%9a%84-network-interface/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
