Ubuntu网络network eth0配置 | ubuntu network configuration
<p><strong>本文首发于个人博客https://kezunlin.me/post/5076bc45/,欢迎阅读!</strong></p><p>ubuntu network configuration</p>
<h1 id="guide">Guide</h1>
<h2 id="network-proxy">network proxy</h2>
<ul>
<li>System wide: Network--->None/Manual</li>
<li>chrome: can not set</li>
<li>firefox: about:preferences---> Network Proxy</li>
</ul>
<h2 id="eth0-config">eth0 config</h2>
<h3 id="rename-xxx-to-eth0">rename xxx to eth0</h3>
<p>errors may occur:</p>
<pre><code>Ubuntu networking restart | cannot find device 'eth0'
</code></pre>
<p>check eth0</p>
<pre><code>$ dmesg | grep eth
e1000 0000:02:01.0 eth0: (PCI:66MHz:32-bit) 00:0c:29:7d:bf:43
e1000 0000:02:01.0 eth0: Intel(R) PRO/1000 Network Connection
e1000 0000:02:01.0 ens33: renamed from eth0
</code></pre>
<p>and we get <code>ens33</code> renamed from <code>eth0</code>, we need to change it back to <code>eth0</code>.</p>
<h3 id="solution">solution</h3>
<p>(1). edit grub and update</p>
<pre><code>$ sudo vim /etc/default/grub
#GRUB_CMDLINE_LINUX=""
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
$ sudo update-grub
</code></pre>
<p>(2) edit network interfaces</p>
<pre><code>auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.77
netmask 255.255.255.0
gateway 192.168.1.1
</code></pre>
<p>(3) reboot</p>
<pre><code>sudo reboot now
</code></pre>
<p>(4) check eth0</p>
<pre><code>$ sudo ifconfig
eth0 Link encap:EthernetHWaddr 80:fa:5b:47:92:8a
inet addr:192.168.1.77Bcast:192.168.1.255Mask:255.255.255.0
UP BROADCAST MULTICASTMTU:1500Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B)TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNINGMTU:65536Metric:1
RX packets:4640 errors:0 dropped:0 overruns:0 frame:0
TX packets:4640 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:865530 (865.5 KB)TX bytes:865530 (865.5 KB)
wlan0 Link encap:EthernetHWaddr b0:35:9f:53:68:c6
inet addr:192.168.0.130Bcast:192.168.0.255Mask:255.255.255.0
inet6 addr: fe80::a3d7:e190:6fb3:133/64 Scope:Link
UP BROADCAST RUNNING MULTICASTMTU:1500Metric:1
RX packets:6536 errors:0 dropped:0 overruns:0 frame:0
TX packets:380 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:581427 (581.4 KB)TX bytes:46439 (46.4 KB)
</code></pre>
<p>OK. Now we get <code>eth0</code>,<code>wlan0</code> properly set.</p>
<h1 id="reference">Reference</h1>
<ul>
<li>ubuntu rename eth0</li>
</ul>
<h1 id="history">History</h1>
<ul>
<li>20180108: created</li>
<li>20180222: add eth0 part.</li>
</ul>
<h1 id="copyright">Copyright</h1>
<ul>
<li>Post author: kezunlin</li>
<li>Post link: https://kezunlin.me/post/5076bc45/</li>
<li>Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.</li>
</ul><br><br>
来源:https://www.cnblogs.com/kezunlin/p/11834841.html
頁:
[1]