“网卡”的版本间的差异
来自Ubuntu中文
(以内容'==基础知识== Ubuntu 中,通常有线网卡为'''eth0''',无线网卡则为'''wlan0''',后续增加的以此类推(可能某些无线网卡型号命名为'''eth1…'创建新页面) |
(→查看系统网卡信息) |
||
(未显示1个用户的5个中间版本) | |||
第1行: | 第1行: | ||
==基础知识== | ==基础知识== | ||
Ubuntu 中,通常有线网卡为'''eth0''',无线网卡则为'''wlan0''',后续增加的以此类推(可能某些无线网卡型号命名为'''eth1''',而非'''wlan0''')。 | Ubuntu 中,通常有线网卡为'''eth0''',无线网卡则为'''wlan0''',后续增加的以此类推(可能某些无线网卡型号命名为'''eth1''',而非'''wlan0''')。 | ||
− | + | ==ifconfig简介== | |
ifconfig 是一个用来查看、配置、启用或禁用网络接口的工具,这个工具极为常用的(说的是喜欢动命令的人……)。 | ifconfig 是一个用来查看、配置、启用或禁用网络接口的工具,这个工具极为常用的(说的是喜欢动命令的人……)。 | ||
− | + | ===查看系统网卡信息=== | |
<pre>ifconfig</pre> | <pre>ifconfig</pre> | ||
− | ====激活/禁用网卡 | + | ===查看网卡详细的硬件信息=== |
+ | <pre>● lshw -class network | ||
+ | *-network | ||
+ | description: Wireless interface | ||
+ | product: PRO/Wireless 3945ABG [Golan] Network Connection | ||
+ | vendor: Intel Corporation | ||
+ | physical id: 0 | ||
+ | bus info: pci@0000:02:00.0 | ||
+ | logical name: wlan0 | ||
+ | version: 02 | ||
+ | serial: 00:13:02:xx:xx:xx | ||
+ | width: 32 bits | ||
+ | clock: 33MHz | ||
+ | capabilities: bus_master cap_list ethernet physical wireless | ||
+ | configuration: broadcast=yes driver=iwl3945 ip=192.168.100.52 latency=0 multicast=yes wireless=IEEE 802.11abg | ||
+ | resources: irq:29 memory:fe0ff000-fe0fffff | ||
+ | </pre> | ||
+ | |||
+ | ===激活/禁用网卡=== | ||
激活网卡 | 激活网卡 | ||
<pre>sudo ifconfig 网卡设备名 up</pre> | <pre>sudo ifconfig 网卡设备名 up</pre> | ||
第11行: | 第29行: | ||
<pre>ifconfig 网卡设备名</pre> | <pre>ifconfig 网卡设备名</pre> | ||
− | + | ==启用/禁用网络== | |
<pre>sudo /etc/init.d/networking start</pre> | <pre>sudo /etc/init.d/networking start</pre> | ||
− | + | ==iwconfig== | |
用于查看无线连接情况 | 用于查看无线连接情况 | ||
<pre>qii@ubuntu:~$ iwconfig | <pre>qii@ubuntu:~$ iwconfig | ||
第26行: | 第44行: | ||
Power Management:off | Power Management:off | ||
</pre> | </pre> | ||
− | + | ==查看网卡设备信息== | |
查看网卡生产商,型号。 | 查看网卡生产商,型号。 | ||
− | <pre>lspci | + | <pre>qii@ubuntu:~$ lspci | grep -i net |
− | + | 03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01) | |
− | + | ||
04:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) | 04:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01) | ||
</pre> | </pre> | ||
+ | 举例来说,最底部,这样的格式,这里第一行是Realtek的RTL8111/8168B有线网卡,第二行是Atheros的AR9285无线网卡。 | ||
+ | 如果你是USB网卡 | ||
+ | <pre>lsusb</pre> | ||
+ | |||
+ | ==修改网卡接口名== | ||
+ | <pre>qii@ubuntu:~$ sudo nano /etc/udev/rules.d/70-persistent-net.rules | ||
+ | </pre> | ||
+ | 修改下列字段便成。 | ||
+ | <pre>NAME="eth0"</pre>和<pre> NAME="wlan0"</pre> | ||
+ | 随后重启Ubuntu。 | ||
[[Category:联网]] | [[Category:联网]] | ||
+ | [[Category:硬件]] |
2011年2月10日 (四) 10:38的最新版本
目录
基础知识
Ubuntu 中,通常有线网卡为eth0,无线网卡则为wlan0,后续增加的以此类推(可能某些无线网卡型号命名为eth1,而非wlan0)。
ifconfig简介
ifconfig 是一个用来查看、配置、启用或禁用网络接口的工具,这个工具极为常用的(说的是喜欢动命令的人……)。
查看系统网卡信息
ifconfig
查看网卡详细的硬件信息
● lshw -class network *-network description: Wireless interface product: PRO/Wireless 3945ABG [Golan] Network Connection vendor: Intel Corporation physical id: 0 bus info: pci@0000:02:00.0 logical name: wlan0 version: 02 serial: 00:13:02:xx:xx:xx width: 32 bits clock: 33MHz capabilities: bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=iwl3945 ip=192.168.100.52 latency=0 multicast=yes wireless=IEEE 802.11abg resources: irq:29 memory:fe0ff000-fe0fffff
激活/禁用网卡
激活网卡
sudo ifconfig 网卡设备名 up
查看网卡信息
ifconfig 网卡设备名
启用/禁用网络
sudo /etc/init.d/networking start
iwconfig
用于查看无线连接情况
qii@ubuntu:~$ iwconfig lo no wireless extensions. eth0 no wireless extensions. wlan0 IEEE 802.11bgn ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:off
查看网卡设备信息
查看网卡生产商,型号。
qii@ubuntu:~$ lspci | grep -i net 03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01) 04:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
举例来说,最底部,这样的格式,这里第一行是Realtek的RTL8111/8168B有线网卡,第二行是Atheros的AR9285无线网卡。
如果你是USB网卡
lsusb
修改网卡接口名
qii@ubuntu:~$ sudo nano /etc/udev/rules.d/70-persistent-net.rules
修改下列字段便成。
NAME="eth0"和
NAME="wlan0"
随后重启Ubuntu。