装完ubuntu估计首要的就是能上网了,因为很多软件的安装通过:
sudo apt-get install来完成,而这个是需要在网上下载软件包的。。

不管怎么说,ubuntu的各种配置总是很麻烦,但这种麻烦也是由于我们不熟悉,就像windows一样,其实配置起来也不简单,熟能生巧嘛,嗯,我们进入正题,这篇文章是我在ubuntu下刚刚用路由器上网之后就写下的~

首先说一下adslubuntu网络配置上网方式,很简单,就一个命令:

sudo pppoeconf

也就是pppoe(以太网的点对点协议)的配置,前面是sudo,大家都很熟悉了,就是提升当前用户权限,如果你是普通用户就用这个来完成根用户级的操作。

打完这个命令,之后就会出现图形化的界面,直接输入用户名和密码,就应该可以了。有一点
注意的就是在输入用户名时,那个框不明显,开始写了一个好像是name,你需要把它删除了才输入,而不是直接在后面输入,我犯过这个错误。



然后是经常用到的路由器上网,这里指的是有线路由。

网上有人说不需要配置,只要连上网线就能上了,这句话呢,一半对一半不对,为什么这么说呢,因为如果你一开始装完ubuntu就直接用路由上网,并且路由已经拨号成功,那么是很简单的就能直接上网了,那为什么网上仍然有人说路由器上不了网呢,原因是像我一样,先开始用的是ADSL的方式,后来再用路由器,网络环境变了,这时系统的网络配置文件需要更改了。

ubuntu本身有一个网络配置的应用程序network-manager,我是觉得不好用,于是卸载了:sudo apt-get remove network-manager --purge


当然你不想卸也没关系,下面就如何配置,ubuntu的网络环境配置是在文件:
/etc/network/interface中,用:
sudo gedit /etc/network/interface打开就可以看到很多配置信息,
开始有:
auto lo
auto eth0,。。

如果你是路由器上网,那就只需要把这个文件中的信息改成如下内容即可:
auto lo
auto eth0
iface lo inet loopback
iface eth0 inet dhcp
其他内容全部删除,这里就是相当于windows下的一个本地连接建立,

注意的一点是这里以太网地址是dhcp方式获得的,也就是路由器给你动态分配的,如果你是静态地址,也就是说你在这个局域网内总是某个IP,192.168.0.1,那么你可以如下配置:

iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.1.1
(以上三行请根据实际更改)

你可以在windows下在命令提示符中输入ipconfig /all来获得以上信息,

这个命令会给出网络的情况,如是否支持dhcp,好像有个项是DHCP ENABLED,如果是yes,说明支持,那么你就用第一种配置,如果是no,那就用第二种,下面有如你的ip(没有dhcp就是静态ip),子网掩码,网关等,请根据你的网络实际情况配置。。

关于无线,一直没有自己解决,网上的办法无外乎以下两种,一种通过ndiswrapper挂载windows的无线驱动,另一种是直接去下载linux无线驱动安装,两种方法我都试过,不知道是我哪里疏忽了还是怎么的,无线一直无法启用。偶然之间,在ubuntu的论坛上看到某君如是说:在系统->系统管理->硬件驱动里直接可以下载并激活无线驱动,哈。。难道网上这么多高人都傻了?这么简单的问题被整得这么复杂。。我试了一下,重启之后,输入iwconfig可以看到无线连接出来了!
hawk@ubuntu:~$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      IEEE 802.11  Nickname:""
Access Point: Not-Associated 

ppp0      no wireless extensions.


可以搜索到周围的无线了!
[sudo] password for hawk:
lo        Interface doesn't support scanning.

eth0      Interface doesn't support scanning.

eth1      Scan completed :
Cell 01 - Address: 00:21:27:8D:6D:6E
ESSID:"308"
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality:4/5  Signal level:-62 dBm  Noise level:-91 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Cell 02 - Address: 00:1D:0F:67:19:8E
ESSID:"@206"
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality:3/5  Signal level:-69 dBm  Noise level:-91 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Cell 03 - Address: 00:1E:58:8A:EC:30
ESSID:"104"
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality:2/5  Signal level:-71 dBm  Noise level:-91 dBm
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
48 Mb/s; 54 Mb/s
Cell 04 - Address: 00:23:CD:83:4F:00
ESSID:"MERCURY_834F00"
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality:4/5  Signal level:-65 dBm  Noise level:-91 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Cell 05 - Address: 00:23:CD:63:E5:8C
ESSID:"16#408"
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality:1/5  Signal level:-82 dBm  Noise level:-91 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Cell 06 - Address: 00:21:27:8B:C4:F2
ESSID:"310"
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality:2/5  Signal level:-73 dBm  Noise level:-91 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Cell 07 - Address: 00:23:CD:1B:A4:20
ESSID:"haozi_lwc"
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality:5/5  Signal level:-56 dBm  Noise level:-91 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Cell 08 - Address: 00:1D:0F:98:77:F8
ESSID:"202"
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality:1/5  Signal level:-84 dBm  Noise level:-92 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Cell 09 - Address: 00:1D:0F:3B:62:F0
ESSID:"room203"
Mode:Managed
Frequency:2.457 GHz (Channel 10)
Quality:1/5  Signal level:-87 dBm  Noise level:-92 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Cell 10 - Address: 00:EE:EE:9D:FD:66
ESSID:"207"
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality:1/5  Signal level:-85 dBm  Noise level:-92 dBm
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
48 Mb/s; 54 Mb/s

ppp0      Interface doesn't support scanning.

orz。。貌似我没有密码,哈哈,本来装无线网络的目的是为了试用一下spoonwep这个破解工具,看来我要当回小偷了,把周围这几个无线密码弄出来了~~

最后,我想说的是网上的内容请自己分辨,别人讲的不一定是对的,即使是对的,在特定的环境或许对于你的网络情况就不适合,想学会ubuntu,就必须自己亲自操作,使劲折腾,我为了路由器能上网就重启了至少5次,所以请务必自己亲手操作。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。