广告
返回顶部
首页 > 资讯 > 精选 >Ubuntu怎么更改网卡配置
  • 366
分享到

Ubuntu怎么更改网卡配置

2023-06-27 18:06:23 366人浏览 薄情痞子
摘要

这篇文章主要介绍“ubuntu怎么更改网卡配置”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Ubuntu怎么更改网卡配置”文章能帮助大家解决问题。却换到 root 并更改密码用普通用户登录系统后,执

这篇文章主要介绍“ubuntu怎么更改网卡配置”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Ubuntu怎么更改网卡配置”文章能帮助大家解决问题。

Ubuntu怎么更改网卡配置

却换到 root 并更改密码

用普通用户登录系统后,执行 sudo -s 命令切换到 root 模式

Ubuntu怎么更改网卡配置

更改 root 密码

Ubuntu怎么更改网卡配置

更改网卡配置

静态IP
root@jaking-virtual-Machine:~# vim /etc/network/interfacesroot@jaking-virtual-machine:~# cat /etc/network/interfaces# interfaces(5) file used by ifup(8) and ifdown(8)auto loiface lo inet loopbackauto ens33iface ens33 inet staticaddress 192.168.10.6gateway 192.168.10.2netmask 255.255.255.0dns-nameservers 114.114.114.114root@jaking-virtual-machine:~# /etc/init.d/networking restart[ ok ] Restarting networking (via systemctl): networking.service.root@jaking-virtual-machine:~# ifconfigens33: flags=4163  mtu 1500       inet 192.168.10.6  netmask 255.255.255.0  broadcast 192.168.10.255       inet6 fe80::20c:29ff:fe05:75fb  prefixlen 64  scopeid 0x20       ether 00:0c:29:05:75:fb  txqueuelen 1000  (Ethernet)       RX packets 7529  bytes 9810758 (9.8 MB)       RX errors 0  dropped 0  overruns 0  frame 0       TX packets 2430  bytes 233194 (233.1 KB)       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0lo: flags=73  mtu 65536       inet 127.0.0.1  netmask 255.0.0.0       inet6 ::1  prefixlen 128  scopeid 0x10       loop  txqueuelen 1000  (Local Loopback)       RX packets 322  bytes 25983 (25.9 KB)       RX errors 0  dropped 0  overruns 0  frame 0       TX packets 322  bytes 25983 (25.9 KB)       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
动态IP
root@jaking-virtual-machine:~# vim /etc/network/interfacesroot@jaking-virtual-machine:~# cat /etc/network/interfaces# interfaces(5) file used by ifup(8) and ifdown(8)auto loiface lo inet loopbackauto ens33iface ens33 inet dhcp#address 192.168.10.6#gateway 192.168.10.2#netmask 255.255.255.0#dns-nameservers 114.114.114.114root@jaking-virtual-machine:~# /etc/init.d/networking restart[ ok ] Restarting networking (via systemctl): networking.service.root@jaking-virtual-machine:~# ifconfigens33: flags=4163  mtu 1500       inet 192.168.10.10  netmask 255.255.255.0  broadcast 192.168.10.255       inet6 fe80::20c:29ff:fe05:75fb  prefixlen 64  scopeid 0x20       ether 00:0c:29:05:75:fb  txqueuelen 1000  (Ethernet)       RX packets 7637  bytes 9823020 (9.8 MB)       RX errors 0  dropped 0  overruns 0  frame 0       TX packets 2606  bytes 253459 (253.4 KB)       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0lo: flags=73  mtu 65536       inet 127.0.0.1  netmask 255.0.0.0       inet6 ::1  prefixlen 128  scopeid 0x10       loop  txqueuelen 1000  (Local Loopback)       RX packets 393  bytes 30932 (30.9 KB)       RX errors 0  dropped 0  overruns 0  frame 0       TX packets 393  bytes 30932 (30.9 KB)       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0root@jaking-virtual-machine:~# ping www.baidu.comPING www.baidu.com (14.215.177.38) 56(84) bytes of data.64 bytes from www.baidu.com (14.215.177.38): icmp_seq=1 ttl=128 time=7.42 ms64 bytes from www.baidu.com (14.215.177.38): icmp_seq=2 ttl=128 time=7.18 ms64 bytes from www.baidu.com (14.215.177.38): icmp_seq=3 ttl=128 time=7.96 ms64 bytes from www.baidu.com (14.215.177.38): icmp_seq=4 ttl=128 time=7.32 ms^C--- www.baidu.com ping statistics ---4 packets transmitted, 4 received, 0% packet loss, time 3006msrtt min/avg/max/mdev = 7.182/7.472/7.963/0.314 ms
临时IP
root@jaking-virtual-machine:~# ifconfigens33: flags=4163  mtu 1500       inet 192.168.10.6  netmask 255.255.255.0  broadcast 192.168.10.255       inet6 fe80::20c:29ff:fe05:75fb  prefixlen 64  scopeid 0x20       ether 00:0c:29:05:75:fb  txqueuelen 1000  (Ethernet)       RX packets 348  bytes 34488 (34.4 KB)       RX errors 0  dropped 0  overruns 0  frame 0       TX packets 575  bytes 48711 (48.7 KB)       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0lo: flags=73  mtu 65536       inet 127.0.0.1  netmask 255.0.0.0       inet6 ::1  prefixlen 128  scopeid 0x10       loop  txqueuelen 1000  (Local Loopback)       RX packets 976  bytes 82275 (82.2 KB)       RX errors 0  dropped 0  overruns 0  frame 0       TX packets 976  bytes 82275 (82.2 KB)       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0root@jaking-virtual-machine:~# ping www.163.comPING z163ipv6.v.bsgslb.cn (183.47.233.6) 56(84) bytes of data.64 bytes from 183.47.233.6 (183.47.233.6): icmp_seq=1 ttl=128 time=5.09 ms64 bytes from 183.47.233.6 (183.47.233.6): icmp_seq=2 ttl=128 time=8.10 ms64 bytes from 183.47.233.6 (183.47.233.6): icmp_seq=3 ttl=128 time=6.68 ms64 bytes from 183.47.233.6 (183.47.233.6): icmp_seq=4 ttl=128 time=5.93 ms^C--- z163ipv6.v.bsgslb.cn ping statistics ---4 packets transmitted, 4 received, 0% packet loss, time 3006msrtt min/avg/max/mdev = 5.094/6.457/8.109/1.110 msroot@jaking-virtual-machine:~# ifconfig ens33 192.168.100.163root@jaking-virtual-machine:~# ifconfigens33: flags=4163  mtu 1500       inet 192.168.100.163  netmask 255.255.255.0  broadcast 192.168.100.255       inet6 fe80::20c:29ff:fe05:75fb  prefixlen 64  scopeid 0x20       ether 00:0c:29:05:75:fb  txqueuelen 1000  (Ethernet)       RX packets 351  bytes 34885 (34.8 KB)       RX errors 0  dropped 0  overruns 0  frame 0       TX packets 586  bytes 50269 (50.2 KB)       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0lo: flags=73  mtu 65536       inet 127.0.0.1  netmask 255.0.0.0       inet6 ::1  prefixlen 128  scopeid 0x10       loop  txqueuelen 1000  (Local Loopback)       RX packets 980  bytes 82521 (82.5 KB)       RX errors 0  dropped 0  overruns 0  frame 0       TX packets 980  bytes 82521 (82.5 KB)       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0root@jaking-virtual-machine:~# ping www.163.comping: www.163.com: Name or service not known

配置 DNS4

root@jaking-virtual-machine:~# vim /etc/systemd/resolved.confroot@jaking-virtual-machine:~# cat /etc/systemd/resolved.conf#  This file is part of systemd.##  systemd is free software; you can redistribute it and/or modify it#  under the terms of the GNU Lesser General Public License as published by#  the Free Software Foundation; either version 2.1 of the License, or#  (at your option) any later version.## Entries in this file show the compile time defaults.# You can change settings by editing this file.# Defaults can be restored by simply deleting this file.## See resolved.conf(5) for details[Resolve]#DNS=192.168.10.2DNS=114.114.114.114#FallbackDNS=#Domains=#LLMNR=no#MulticastDNS=no#DNSSEC=no#Cache=yes#DNSStubListener=yes

改完DNS后,最好重启一下Ubuntu系统。

关于“Ubuntu怎么更改网卡配置”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注编程网精选频道,小编每天都会为大家更新不同的知识点。

--结束END--

本文标题: Ubuntu怎么更改网卡配置

本文链接: https://www.lsjlt.com/news/312812.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Ubuntu怎么更改网卡配置
    这篇文章主要介绍“Ubuntu怎么更改网卡配置”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Ubuntu怎么更改网卡配置”文章能帮助大家解决问题。却换到 root 并更改密码用普通用户登录系统后,执...
    99+
    2023-06-27
  • ubuntu怎么修改网卡配置文件
    要修改Ubuntu的网卡配置文件,您可以按照以下步骤进行操作:1. 打开终端。您可以按下Ctrl + Alt + T来打开终端。2....
    99+
    2023-09-29
    ubuntu
  • ubuntu怎么配置网卡静态ip
    在Ubuntu中配置网卡的静态IP地址,可以按照以下步骤进行操作:1. 打开终端,使用以下命令编辑网络配置文件:```sudo na...
    99+
    2023-10-09
    ubuntu
  • Ubuntu中怎么以DHCP方式配置网卡
    Ubuntu中怎么以DHCP方式配置网卡,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。1. 以DHCP方式配置网卡编辑文件/etc/network/interfaces:sud...
    99+
    2023-06-16
  • Ubuntu怎么为网卡配置静态IP地址
    这篇“Ubuntu怎么为网卡配置静态IP地址”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“Ubuntu怎么为网卡配置静态IP...
    99+
    2023-07-04
  • linux怎么修改网卡ip配置文件
    要修改Linux网卡的IP配置文件,您可以按照以下步骤操作: 使用编辑器(如vi、nano等)打开网络配置文件。具体的文件路径可...
    99+
    2023-10-23
    linux
  • centos怎么配置网卡修改ip地址和修改网关
    这篇文章主要介绍“centos怎么配置网卡修改ip地址和修改网关”,在日常操作中,相信很多人在centos怎么配置网卡修改ip地址和修改网关问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”centos怎么配置网...
    99+
    2023-06-10
  • Ubuntu Server 20.04 网卡启动及配置
    前言 由于网络环境问题,联网安装会导致报错,故在安装期间disable了所有网卡,下面记录装好之后打开的过程。 查看网卡信息 ip a 得到本机的所有网卡信息,例如我这边网卡为eth0 打开网卡 将上述网卡名称填入 sudo ip link...
    99+
    2023-08-19
    ubuntu tcp/ip 服务器
  • Ubuntu配置虚拟IP和多网卡
    文章目录 实验环境1、Ubuntu子接口方式配置虚拟IP1.1、修改网卡文件1.2、重启网卡,验证 2、Ubuntu如何添加不同网段的多个IP,多网卡2.1、查询定位到具体添加的IP2.2...
    99+
    2023-09-16
    ubuntu linux ip tcp/ip 服务器
  • ubuntu怎么设置网卡速率
    要设置Ubuntu上的网卡速率,您可以按照以下步骤操作:1. 打开终端:您可以使用快捷键Ctrl+Alt+T或在应用程序菜单中搜索终...
    99+
    2023-08-29
    ubuntu
  • Ubuntu中怎么设置网卡IP
    Ubuntu中怎么设置网卡IP,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。1.单网卡配单IP(普遍)vi /etc/network/interface ...
    99+
    2023-06-16
  • CentOS7.1怎么配置网卡
    这篇文章给大家分享的是有关CentOS7.1怎么配置网卡的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。下面我来介绍一下7中的网卡配置,包括我所遇到的问题在VMware虚拟机中装完之后执行ifconfig会发现网卡...
    99+
    2023-06-10
  • linux如何修改网卡配置
    要修改Linux的网卡配置,可以按照以下步骤进行操作:1. 打开终端,使用root权限登录或以root权限执行命令。2. 使用ifc...
    99+
    2023-08-17
    linux
  • ubuntu网络配置如何修改
    要修改Ubuntu的网络配置,您可以按照以下步骤操作:1. 打开终端,使用root权限登录或者使用sudo命令。2. 使用以下命令打...
    99+
    2023-10-12
    ubuntu
  • Ubuntu中怎么通过修改配置文件实现网络配置
    ...
    99+
    2023-06-13
  • ubuntu如何查看网卡配置信息
    ubuntu查看网卡配置信息的方法:1、打开ubuntu终端;2、通过命令进行查看网卡配置信息。具体操作方法如下:使用快捷键【ctrl+alt+t】打开ubuntu终端。再通过以下命令查看网卡配置信息。ifconfig #查看网卡基本配置信...
    99+
    2022-10-18
  • CentOS双网卡时怎么改变网卡编号和配置静态路由
    这篇文章主要介绍“CentOS双网卡时怎么改变网卡编号和配置静态路由”,在日常操作中,相信很多人在CentOS双网卡时怎么改变网卡编号和配置静态路由问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”CentOS双...
    99+
    2023-06-10
  • 怎么更改Redis的配置
    这篇文章给大家分享的是更改Redis的配置的方法。小编觉得挺实用的,因此分享给大家学习。如下资料是关于更改Redis的配置的命令使用。命令将仅在当前会话期间或直到您运行之前更改Redis服务器的行为,con...
    99+
    2022-10-18
  • Linux双网卡怎么配置
    本篇内容介绍了“Linux双网卡怎么配置”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!配置双网卡网络接口eth0和eth2,并在服务器上配置...
    99+
    2023-06-05
  • Centos7系统怎么更改网卡名称
    这篇文章主要介绍“Centos7系统怎么更改网卡名称”,在日常操作中,相信很多人在Centos7系统怎么更改网卡名称问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Centos7系统怎么更改网卡名称”的疑惑有所...
    99+
    2023-06-10
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作