<?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>Predictable Network Interface Names &#8211; richliu&#039;s blog</title>
	<atom:link href="https://blog.richliu.com/tag/predictable-network-interface-names/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Wed, 01 Oct 2014 13:46:19 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>udev 之後仍然想用原先的 network device rename 的方式修改 interface</title>
		<link>https://blog.richliu.com/2014/10/01/1667/udev-%e4%b9%8b%e5%be%8c%e4%bb%8d%e7%84%b6%e6%83%b3%e7%94%a8%e5%8e%9f%e5%85%88%e7%9a%84-network-device-rename-%e7%9a%84%e6%96%b9%e5%bc%8f%e4%bf%ae%e6%94%b9-interface/</link>
					<comments>https://blog.richliu.com/2014/10/01/1667/udev-%e4%b9%8b%e5%be%8c%e4%bb%8d%e7%84%b6%e6%83%b3%e7%94%a8%e5%8e%9f%e5%85%88%e7%9a%84-network-device-rename-%e7%9a%84%e6%96%b9%e5%bc%8f%e4%bf%ae%e6%94%b9-interface/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 01 Oct 2014 13:46:19 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Predictable Network Interface Names]]></category>
		<category><![CDATA[udev]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1667</guid>

					<description><![CDATA[<p>在Predictable Network Interface 這件事情出現之前, 很長一段時間, udev 起 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2014/10/01/1667/udev-%e4%b9%8b%e5%be%8c%e4%bb%8d%e7%84%b6%e6%83%b3%e7%94%a8%e5%8e%9f%e5%85%88%e7%9a%84-network-device-rename-%e7%9a%84%e6%96%b9%e5%bc%8f%e4%bf%ae%e6%94%b9-interface/">udev 之後仍然想用原先的 network device rename 的方式修改 interface</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>在<a href="http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/" target="_blank" rel="noopener">Predictable Network Interface </a>這件事情出現之前, 很長一段時間, udev 起來之後, script 會自動產生 70-persistent-net.rules , 然後所有的 ethernet device 就會在裡面, 如果要改個順序ex: eth0-&gt;eth1 or eth1-&gt;net1, 就在裡面改就好了.</p>
<p>不過總之他們就是改了, 說什麼安全的問題啦, firewall 設定啦.</p>
<p>只是改了之後, 大家討論了很久, 也 try 了很久.<br />
我也是這次因為一定要能動, 所以認真的研究了一下, 目前最安定的設定, 可以正確更改名稱的設定.<br />
1. 在 kernel command line 加上 net.ifnames=0, 這樣就會變原來的 eth0&#8230; blah blah , 可是原先的更改名稱方式還是不能用.</p>
<p>Gentoo 使用者可以改 Kernel Config, 關掉這個選掉</p>
<p>Gentoo Linux  &#8212;&gt;<br />
[ ]   Linux dynamic and persistent device naming (userspace devfs) support</p>
<p>2. 請參照 Gentoo 文件 <a href="http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=4&amp;chap=2#doc_chap4" target="_blank" rel="noopener">2.d. Network Interface Naming</a></p>
<pre># <span class="code-input">udevadm test-builtin net_id /sys/class/net/eth0 2&gt;/dev/null</span>
ID_NET_NAME_MAC=enxc80aa9429d76
ID_OUI_FROM_DATABASE=Quanta Computer Inc.

# <span class="code-input">vim /etc/udev/rules.d/70-net-name-use-custom.rules</span>
<span class="code-comment"># First one uses MAC information, and 70- number to be before other net rules</span>
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="c8:0a:a9:42:9d:76", NAME="lan0"

# <span class="code-input">vim /etc/udev/rules.d/76-net-name-use-custom.rules</span>
<span class="code-comment"># Second one uses ID_NET_NAME_PATH information, and 76- number to be between</span>
<span class="code-comment"># 75-net-*.rules and 80-net-*.rules</span>
SUBSYSTEM=="net", ACTION=="add", ENV{ID_NET_NAME_PATH}=="enp3s0", NAME="wifi0"</pre>
<p>這樣就可以成功了.</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2014/10/01/1667/udev-%e4%b9%8b%e5%be%8c%e4%bb%8d%e7%84%b6%e6%83%b3%e7%94%a8%e5%8e%9f%e5%85%88%e7%9a%84-network-device-rename-%e7%9a%84%e6%96%b9%e5%bc%8f%e4%bf%ae%e6%94%b9-interface/">udev 之後仍然想用原先的 network device rename 的方式修改 interface</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2014/10/01/1667/udev-%e4%b9%8b%e5%be%8c%e4%bb%8d%e7%84%b6%e6%83%b3%e7%94%a8%e5%8e%9f%e5%85%88%e7%9a%84-network-device-rename-%e7%9a%84%e6%96%b9%e5%bc%8f%e4%bf%ae%e6%94%b9-interface/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
