AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[ifconfig](ubuntu)

Martin Hope
obayhan
Asked: 2020-10-15 11:47:26 +0800 CST

自PC打开以来如何获取终端中的总网络使用量

  • 0

我可以通过终端获得总网络使用量,但我也可以获得有关wlp0s20f3设备ifconfig wlp0s20f3的许多其他额外信息。

输出:

wlp0s20f3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.43.67  netmask 255.255.255.0  broadcast 192.168.43.255
        inet6 fe80::5f55:a45c:b66a:a7d2  prefixlen 64  scopeid 0x20<link>
        ether 48:f1:7f:f3:15:83  txqueuelen 1000  (Ethernet)
        RX packets 82724  bytes 108476705 (103.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 28959  bytes 3840172 (3.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

我只需要103.4 MiB的 rx 和3.6 MiB的 tx 与 kde 面板中的命令输出plasmoid一起使用。我怎么能得到那个?

PS:解析 ifconfig 输出的任何 bash 脚本或任何应用程序给出的值都是可以接受的

networking kde command-line bash ifconfig
  • 3 个回答
  • 173 Views
Martin Hope
mahfuj asif
Asked: 2020-10-09 09:14:03 +0800 CST

如何在 ubuntu 18.04 中不使用 ifconfig 更改 MTU?

  • 0

我需要更改MTU我新安装的 ubuntu 18.04 的大小。这可以通过ifconfig. 但我无法安装ifconfig。每当我运行命令时sudo apt install net-tools,我都会收到以下错误。

Err:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 net-tools amd64 1.60+git20161116.90da8a0-1ubuntu1
  Could not resolve 'archive.ubuntu.com'
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/n/net-tools/net-tools_1.60+git20161116.90da8a0-1ubuntu1_amd64.deb  Could not resolve 'archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

然后我尝试sudo apt-get update并得到以下

asif@asif-HP:~$ sudo apt-get update
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease                                                                        
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease                                               
  Could not resolve 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease            
  Could not resolve 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
  Could not resolve 'archive.ubuntu.com'
Err:5 http://archive.ubuntu.com/ubuntu bionic-security InRelease
  Could not resolve 'archive.ubuntu.com'
Err:6 http://archive.canonical.com/ubuntu bionic InRelease
  Could not resolve 'archive.canonical.com'
Reading package lists... Done           
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.canonical.com/ubuntu/dists/bionic/InRelease  Could not resolve 'archive.canonical.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Could not resolve 'archive.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

实际上我正在尝试更改 MTU 大小来解决问题Could not resolve 'archive.canonical.com',所以我有点陷入僵局。现在我该怎么做?

注意:我更改了 ubuntu 存档服务器,但总是发生相同的错误。

networking ifconfig internet ethernet 18.04
  • 2 个回答
  • 387 Views
Martin Hope
AndreaNobili
Asked: 2020-03-20 15:18:09 +0800 CST

由于系统崩溃重新启动后,以太网接口消失了。如何恢复它?

  • 2

我不太喜欢 Linux,我在使用 VmWare 工作站的 Linux 19.10 系统上遇到了一个非常奇怪的问题(但我认为这不是与 VMware 相关的问题)。

问题是由于崩溃导致系统冻结,我不得​​不重新启动系统。重新启动后,我没有更多的 Internet 连接。

在我获得的 shell中执行ifconfig命令:

developer@developer-virtual-machine:/etc/network$ ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Loopback locale)
        RX packets 2508  bytes 186240 (186.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2508  bytes 186240 (186.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

因此,由于某种原因,它似乎丢失了 VmWare 用于在 NAT 模式下连接的以太网接口。

我尝试重新启动系统(也是安装 VMWare 的主机 Windows 机器),但我仍然遇到这个问题。我该如何尝试修复它?

EDIT-1:执行sudo lshw -C network我得到这个输出:

developer@developer-virtual-machine:~$ sudo lshw -C network
[sudo] password di developer: 
  *-network DISABLED        
       description: Ethernet interface
       product: 82545EM Gigabit Ethernet Controller (Copper)
       vendor: Intel Corporation
       physical id: 1
       bus info: pci@0000:02:01.0
       logical name: ens33
       version: 01
       serial: 00:50:56:3a:4b:1e
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 66MHz
       capabilities: pm pcix bus_master cap_list rom ethernet physical logical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI duplex=full latency=0 link=no mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:19 memory:fd5c0000-fd5dffff memory:fdff0000-fdffffff ioport:2000(size=64) memory:fd500000-fd50ffff

好像网络被禁用了

networking network-manager ifconfig ethernet 19.10
  • 2 个回答
  • 3494 Views
Martin Hope
Mohammad Kholghi
Asked: 2019-10-02 11:53:46 +0800 CST

如果我使用 ifconfig 禁用环回设备会发生什么?

  • 4

我发现我可以使用禁用我的接口

$ sudo ifconfig lo down

我想知道如果我永远禁用我的环回接口会发生什么。它现在被禁用了,没有任何改变。有什么我现在看不到的缺点吗?

networking ifconfig
  • 1 个回答
  • 5842 Views
Martin Hope
Guy
Asked: 2019-05-15 08:55:50 +0800 CST

在 ubuntu 中路由 Docker

  • 3

在 Ubuntu 18.04 的路由表中,我有以下条目:

172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-9f3f970041e3
172.18.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-66d1d4ca46a2
172.19.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0

docker0 条目我设法通过创建一个/etc/docker/daemon.json文件并添加{"bip": "172.19.0.1/16"}到它来移动到不同的 IP 范围。

我不确定这些br-*条目来自哪里,但我知道如果我删除它们,Docker 就会停止工作,所以它们会被 Docker 使用。

我需要让 Docker 分配这些br-*地址,172.20.0.0因为172.21.0.0corp 网络使用他们当前占用的地址。

问题:

  1. Docker 的哪个部分正在创建这些br-*条目?
  2. Docker 如何使用这些条目?
  3. 如何配置 Docker 以将它们分配给其他范围?
ifconfig routing docker 18.04
  • 1 个回答
  • 2990 Views
Martin Hope
theQuantumMechanic
Asked: 2019-02-10 05:19:24 +0800 CST

从 Ubuntu 到 Win10 的目标主机无法共享 WiFi

  • 1

我正在尝试wlp1s0b1通过以太网 () 将我的 Ubuntu 16.04 无头笔记本电脑上的无线连接 () 共享到我的 Windows 10 PC enp0s9。

这是我的网络图:

路由器(198.168.0.1)---(wifi)--->笔记本电脑(192.168.0.169)---(eth)---> PC(192.168.127.2)

我一直在研究这样做的方法。我在这里遵循了本教程。遵循此快速指南后,我与路由器建立了 WiFi 连接,我的结果是分配给我的 Windows 10 PC 的 IP 地址(192.168.127.2,到目前为止还不错)以及网络掩码和网关(如指南中所述,192.168 .127.1 和 255.255.255.0 分别)。

现在,我无法在已知 IP 地址的两台计算机之间进行 ping 操作。Windows 10 PC 也没有识别任何外部连接。

相关输出(笔记本电脑):

ifconfig
enp0s9 Link encap:Ethernet HWaddr 70:cd:60:44:47:ba 
inet addr: 192.168.127.1 Bcast 192.168.127.255 Mask:255.255.255.0

wlp1s0b1 Link encap:Ethernet Hwaddr 10:9a:dd:b7:ba:b7
inet addr: 192.168.0.169 Bcast:192.168.0.255 Mask:255.255.255.0

route -n
Destination     Gateway    Genmask  Flags  Metric  Ref  Use Iface
0.0.0.0    192.168.0.1     0.0.0.0      UG     600  0     0 wlp1s0b1
192.168.0.0   0.0.0.0     255.255.255.0 U    600    0     0 wlp1s0b1
192.168.127.0   0.0.0.0   255.255.255.0  U     0    0     0 enp0s9
192.168.200.0   0.0.0.0     255.255.255.0    U    0   0   0 enp0s9

UFW 被禁用:

UFW status
Status: inactive

然后是文件中的相关条目/etc/network/interfaces:

auto enp0s9 
allow-hotplug enp0s9
iface enp0s9 inet static
address 192.168.200.0
netmask 255.255.255.0
broadcast 192.168.200.255
gateway 192.168.0.1

iface enp0s9 inet6 auto

然后 nmcli 输出:

nmcli connection 
NAME           UUID TYPE            DEVICE
mynetworkname  UUID 802-11-wireless wlps0b1

此外,按照第一个教程/指南isc-dhcp-server中的描述运行。

那么我错过了什么?我怀疑这与我的网关分配有关,但我无法放置它或弄清楚还有什么要检查的研究。

我要做的就是实现 GUI 中可用的“与其他计算机共享”设置。

我已经阅读了以下问题。我的问题与正在调试有关。这个问题很相似,但我的问题是无头的。 这个问题也类似,但仍然是 GUI。

我怎样才能做到这一点?

编辑:我正在运行一个无头服务器添加,我没有 GUI 选项。

ifconfig internet dhcp router nmcli
  • 1 个回答
  • 1243 Views
Martin Hope
AlexDude7
Asked: 2019-01-24 18:12:44 +0800 CST

Netplan 配置似乎没有生效

  • 1

在 /etc/netplan/01-network-manager-all.yaml 中为我的 wlan 接口配置静态 ip 地址后,ip 地址和 dns 都发生了变化。

我使用sudo netplan generateand sudo netplan apply,但是当我运行时,ifconfig什么都没有改变。

我的网络计划配置:

# Let NetworkManager manage all devices on this system

network:
  version: 2
  renderer: NetworkManager

  wifis:
    wlp6s0:
      dhcp4: no
      dhcp6: no
      addresses: [10.0.0.115/24]
      gateway4: 10.0.0.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      access-points:
        XXXXX:
          password: XXXXXXXX

ifconfig输出:

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
    inet 127.0.0.1  netmask 255.0.0.0
    inet6 ::1  prefixlen 128  scopeid 0x10<host>
    loop  txqueuelen 1000  (Local Loopback)
    RX packets 2882  bytes 252039 (252.0 KB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 2882  bytes 252039 (252.0 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp6s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 10.0.0.14  netmask 255.255.255.0  broadcast 10.0.0.255
    inet6 fe80::eba8:95b6:70df:fee5  prefixlen 64  scopeid 0x20<link>
    ether 00:17:9a:01:c6:00  txqueuelen 1000  (Ethernet)
    RX packets 12673  bytes 8587304 (8.5 MB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 11485  bytes 1727699 (1.7 MB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ip地址保持10.0.0.14

networking wireless ifconfig dns netplan
  • 1 个回答
  • 6346 Views
Martin Hope
Jesse יִשַׁי
Asked: 2018-12-02 21:34:03 +0800 CST

在 VPS 上的 Ubuntu 18.04 中通过 CLI 仅获取我的 eth0 网络掩码的“正确”方法?

  • 2

根据这个答案和整个网络上的许多其他教程,ifconfig将列出许多有趣且有用的信息。而且,这似乎是找出像我的网络掩码这样的东西的标准方法。

但是,对于脚本,我只需要网络掩码本身eth0;并且man ifconfig对这个问题没有帮助。

我使用的是 VPS,所以我无法控制我的网络掩码;我需要找出它的设置。

(注意:虽然我需要eth0,但有些机器可能有另一个,比如eth1or ens3,这也很有用。)

  • 我不需要网络掩码所在的整行:

inet 111.222.333.444 netmask 255.255.255.0 broadcast 111.222.555.666

  • 我想避免使用“hackdoor”方法,比如netmask 255.255.255.0开始运行sed "s/netmask //",因为事情可能会发生变化——除非专家这么说
networking server command-line vps ifconfig
  • 1 个回答
  • 851 Views
Martin Hope
BJsgoodlife
Asked: 2018-11-28 07:55:00 +0800 CST

ifconfig不存在,没有wifi适配器

  • 0

看来这是一个常见的话题,但我认为我的问题可能是独一无二的,因为我找不到 ifconfig。我试图遵循本教程和其他教程。我在 Ubuntu 18.04 和 Windows 10 上。当我输入

ifcongig

这就是我所看到的。

Command 'ifconfig' not found, but can be installed with: sudo apt install net-tools

听起来好像我需要重新安装,这次包含这些默认程序,这样我就可以获得 wifi。有人对我如何获得这些默认应用程序有任何建议吗?

wireless ifconfig adapter
  • 1 个回答
  • 1640 Views
Martin Hope
kimusan
Asked: 2018-08-17 03:41:16 +0800 CST

使用“ip”命令更改网络mac地址

  • 8

通常我可以使用 ifconfig 命令更改我的 wifi mac 地址,例如:

ifconfig <iface> hw ether XX:XX:XX:XX:XX:XX

然而,Ubuntu 已经弃用了 ifconfig 来代表“ip”命令,所以我想知道是否有办法使用该命令获得类似的功能?

networking ifconfig ip
  • 2 个回答
  • 18475 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve