网站建设中,中国大陆地区请使用VPN访问,欢迎提建议,关注LSKR Mastodon

如何解决osboxes ubuntu 服务器版本没有网络问题

提供解决osboxes ubuntu服务版本安装后,没有网络问题的具体解决方式。


使用osboxes Ubuntu Server 这个版本系统时候,发现无网络问题,服务器版本在安装过程中需要用户自己配置网络。

一、具体的现象分析

 osboxeseosboxes :~ ifconfig
 lo       Link encap:Local Loopback
        inet addr:127.0.0.1 Mask:255.0.0.0
        inet6 addr: ::1/128 Scope:Host
        UP LOOPBACK RUNNING MTU:65536 Metric:1
        RX packets:176 errors:0 dropped:0 overruns:0 frame:0
        TX packets:176 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1
        RX bytes:13296 (13.2 KB) TX bytes:13296 (13.2 KB)

检测网卡

检查系统是否可以检查出网卡,可以检出出网卡,说明系统只是没有配置网络

 osboxeseosboxes :~ ip a
 1: lo: <LOOPBACK,uP ,LOuER_UP> ntu 65536 qdisc noqueue state UNKNOMN group default qlem 1
 link/ loopback 00:00:00:00:00:00 brd 00:00:00:00: 00:00
 inet 127.0.0.1/8scope host lo
 ua lid_lft forever preferred_lft foreuerinet6 ::1/128scope host
 ualid_lft foreuer pref erred_lft foreuer
 2: ens33: 《<BROADCAST,MULTichST> ntu 1500 qdisc noop state DOMN group def ault qlen 1000
 link/ether 00:0c:29:3e:2?:5e brd ff :ff :ff :ff :ff :ff

开启网卡(不一定需要执行,一般DHCP自动分配会包含启动)

 ip link set ens33 up

二、使用DHCP配置网络

分析情况,系统中有网卡,但是没有分配 IP,用户可以使用DHCP服务来自动获取分配ip地址。

编辑配置文件 /etc/network/interface,开启DHCP分配请求给自己自动分配网络

 auto interface_name
 iface interface_name inet dhcp

interface_name 改为网卡 ens33 名称

重启机器 reboot或者重启网络

 sudo systemctl restart networking

注意:如果网络中有DHCP服务,我们可以使用DHCP来自动配置网络(VMware 虚拟机网络中会自动包含一个DHCP服务器,这里就不演示自己查看了)

三、手动分配网络

除了使用DHCP分配用户也可自己手动建立IP地址。

这里涉及到各种顾虑,比如私有网络段,比如不和已有IP地址冲突等。不太适合新手,一般熟悉网络的用户可以自己配置Linux 网络,这是基本的Linux网络配置。

 vim /etc/network/interfaces

编辑网卡配置文件,添加静态配置

 auto eth0
 iface eth0 inet static
 address 192.168.1.10
 netmask 255.255.255.0
 gateway 192.168.1.1

192.168.1.10 :配置自己私有网络地址

255.255.255.0:子网掩码

192.168.1.1 :网关

用户不知道如何配置,用户可以查看其它机器上相关配置,粘贴复制过来。修改一个私有网络地址即可,其它保持相同即可。

举例子

边上类似机器的地址

 auto eth0
 iface eth0 inet static
 address 192.168.1.9
 netmask 255.255.255.0
 gateway 192.168.1.1

自己的地址可以修改为

 auto eth0
 iface eth0 inet static
 address 192.168.1.10
 netmask 255.255.255.0
 gateway 192.168.1.1

发表评论

Cookie Consent
我们使用 Cookie 来了解您如何使用我们的网站并提升您的体验。这包括个性化内容和广告。
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.