ubuntu网络配置

14 篇文章 0 订阅
6 篇文章 0 订阅

ubuntu下面的网络配置文件为/etc/network/interfaces

所以如果想要修改网络相关配置,需要进入到该文件下。

1.dhcp配置

auto eth0 

iface eth0 inet dhcp

2.静态网络配置

auto eth0 

iface eth0 inet static

address  10.0.0.1

netmask 255.255.255.0

gateway 10.0.255.254


网络配置完成后使用/etc/init.d/networking restart 重新启动网络。

这样有线网络已经可以使用。

如果想要使用无线网络的话,配置如同有线网络。

但是我们需要启动无线网卡并且搜索可以检查到的无线网络。

ifconfig wlan0 up

iwlist wlan0 scan

然后继续连接无线网络。

iwconfig wlan0 essid ubuntu key 12345lenovo 

如果报错,是因为ubuntu对于wpa密码支持不够。

wpa_passphrase ESSID KEY > xxx.conf

然后配置文件中配置改为如下

auto wlan0

iface wlan0 inet static

address  10.0.0.1

netmask 255.255.255.0

gateway 10.0.255.254

wpa_conf xxx.conf

然后重启网络即可。





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值