手动配置ubuntu无线网络

iwconfig //命令查看一下有没有wlan0
备份配置文件:
cp /etc/network/interfaces /etc/network/interfaces_bak
然后修改interfaces文件 如果为静态ip,那么按照如下设置:
#auto eth0  
#iface eth0 inet static  
#address 192.168.1.118  
#gateway 192.168.1.1  
#netmask 255.255.255.0  

auto wlan0  
iface wlan0 inet static  
address 192.168.1.139  
gateway 192.168.1.1  
netmask 255.255.255.0  
wpa-ssid TP-LINK_196958     //用户名  
wpa-psk ×××××                 //无线密码  
dns-nameservers 8.8.8.8 //防止重启清空
如果为DHCP动态获取,那么按照如下设置:
auto wlan0
iface wlan0 inet dhcp
dns-nameservers 202.117.112.3
wpa-ssid myssid
wpa-psk 1234567890
设置开机启动:
vim /etc/rc.local  

sudo /sbin/ifconfig wlan0 up  
sudo /etc/init.d/networking restart  

exit 0
修改dns设置:
sudo vi /etc/resolv.conf
增加如下内容:
nameserver   210.34.018

nameserver   8.8.8.8
重启网卡:
sudo /etc/init.d/networking restart
查看网卡:
ifconfig
扫描网络:
iwlist wlan0 scan

参考:

 [1].  http://blog.51yip.com/linux/1341.html 

[2].  http://www.360doc.com/content/12/0406/14/3700464_201388554.shtml

[3].  http://gm100861.blog.51cto.com/1930562/895579

[4]  http://blog.appdevp.com/archives/188

转载于:https://my.oschina.net/itfanr/blog/195623

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值