在Ubuntu下如何设置无线上网

本机使用无线网,未插入网线

Paste_Image.png

查看无线上网网卡

Paste_Image.png

设置virtualbox网络>网卡

Paste_Image.png

进入虚拟机

$cd /etc/network/
$ ls
if-down.d  if-post-down.d  if-pre-up.d  if-up.d  interfaces  interfaces.d
$ vim interfaces

interfaces文件内容如下

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp0s3 
iface enp0s3 inet dhcp

网卡是enp0s3eth0无所谓,enp0s3是Ubuntu16.04的新属性。
dhcp是动态获取IP地址

查看无线网所使用网段、网关等信息

打开物理机的CMD命令行,获取IP信息

ipconfig/all
Paste_Image.png

红色勾勒区域需要写入interfaces文件

将interfaces文件修改如下


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp0s3
iface enp0s3 inet static
address 192.168.188.101
netmask 255.0.0.0
network 192.168.188.0
gateway 192.168.188.253
dns-nameservers 8.8.8.8
dns-nameservers 114.114.114.114
dns-nameservers 192.168.188.253

dhcp换成static,动态获取IP换成静态获取;网关可以设置多个;其它一一对应填写即可,照葫芦画瓢即可。

完成

Paste_Image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容