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
    • 最新
    • 标签
主页 / user-50289

Andrew Falanga's questions

Martin Hope
Andrew Falanga
Asked: 2019-11-05 13:55:16 +0800 CST

在 mq 顶层 qdisc 下添加 qdisc

  • 5

这篇 LWN 文章建议可以为mq “虚拟调度器” “下”的队列添加/替换网络调度器。这两点指向了这一点:

The mq scheduler does two things:

- present device TX queues as classes, allowing to attach
  different qdiscs to them, which are grafted to the TX queues

- present accumulated statistics of all device queue root qdiscs

我会很感激被教育如何做到这一点。我尝试了很多组合。例如,从这个默认列表(CentOS 7.6)中:

# tc qdisc show dev eth2
qdisc mq 0: root 
qdisc pfifo_fast 0: parent :8 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :7 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :6 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :5 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :4 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :3 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :1 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

我尝试了许多变体,试图在 mq 下尝试嫁接不同的调度程序。以下是一些尝试:

# tc qdisc add dev eth2 parent 0:1 fq_codel target 1ms interval 10ms quantum 9014
RTNETLINK answers: No such file or directory
# tc qdisc add dev eth2 parent 0:1 handle 1: fq_codel target 1ms interval 10ms quantum 9014
RTNETLINK answers: No such file or directory

有谁知道在mq下放置不同的调度程序而不仅仅是pfifo_fast的魔力?非常令人沮丧的一点是,手册页和许多互联网文章都引用了有关调度程序和队列的根目录和父目录。但是,从我上面的命令输出中,没有人能充分描述tc qdisc show dev eth2什么是根,哪些是父级。我在猜测,但我的猜测似乎很遥远。

networking
  • 1 个回答
  • 2318 Views
Martin Hope
Andrew Falanga
Asked: 2018-11-13 14:05:23 +0800 CST

更改 qdisc 算法 sysctl 和 tc

  • 1

通过tc命令 vs控制什么 qdisc sysctl net.core.default_qdisc?考虑

$ tc qdisc show dev eth2
qdisc mq 0: dev eth2 root 

$ sysctl net.core.default_qdisc
net.core.default_qdisc = pfifo_fast

在此系统上,默认 qdisc 设置为pfifo_fast,但重新启动后使用的 qdisc 是mq(多队列)。很明显,它们没有直接关系,或者至少没有以“开箱即用”的方式有意义。 这个关于在 Linux 网络堆栈中排队的链接清楚地表明它tc qdisc ...适用于位于 IP 堆栈和驱动程序队列之间的队列。

任何人都可以为我消除这两个歧义吗?

networking kernel
  • 1 个回答
  • 4347 Views
Martin Hope
Andrew Falanga
Asked: 2018-01-18 08:20:24 +0800 CST

dhcpd 与此 mac 地址不匹配

  • 2

在我的小网络上,我有一个简单的设备,它显然只使用bootp(而不是 bootp 的 dhcp 扩展)来获取其地址。我的 dhcpd.conf 文件看起来像这样

class "user" {
    match if substring(hardware, 1, 3) = 00:01:02;
    log(info, "matched to a 3com";
}

class "controller" {
    # tried matching based on two different styles I've seen on the net
    #match if substring(hardware, 1, 3) = 00:a0:45;
    match if (binary-to-ascii(16, 8, ":", substring(hardware, 0, 4)) = "1:00:a0:45");
    log(info, "found a controller");
}

subnet 192.168.0.0 netmask 255.255.0.0 {
    pool {
        allow members of "user";
        range 192.168.0.20 192.168.0.99;
        log(info, "A user just attached");
    }            

    pool {
        allow members of "controller";
        # never more than 1 on the network at a time
        range 192.168.1.240;
        log(info, "Allocated to a pwr user");
    }
}

dhcp 服务器根本不匹配它应该匹配的池。从日志

BOOTREQUEST from 00:a0:45:95:ce:14 via eth1: BOOTP from dynamic client and no dynamic leases

该设备在这两个类别中均被拒绝。使用 tcpdump 和 wireshark 比较来自笔记本电脑和控制器设备的数据包转储(我暂时为 HP 笔记本电脑创建了一个类,将该类添加到用于“控制器”的池中,并将范围扩大 2 个地址),这似乎是唯一的不同之处在于控制器设备实际上是一个 bootp 数据包(即它缺少标识 dhcp 类型的强制选项 53),并且仅携带选项 255。笔记本电脑是通过dhcpd不使用binary-to-ascii转换来匹配的。此外,奇怪的是,控制器客户端 IP 标头使用首先分配的 IP 地址 192.168.1.240,但在数据包的 bootp 部分中,该ciaddr字段为 0。如果它认为它有一个有效的租约,它不应该反映这一点在ciaddr?

为什么 dhcpd 无法匹配此设备的 MAC 地址?

centos dhcp
  • 2 个回答
  • 2719 Views
Martin Hope
Andrew Falanga
Asked: 2018-01-12 10:10:11 +0800 CST

为什么 dhcpd 不监听虚拟接口

  • 0

我想我可能遗漏了一些简单的东西,但我现在需要对这个问题多加注意。我需要 2 个单独的网络位于同一个 NIC(eth1)上:192.168.0.0/24和192.168.1.0/24。接口是:

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.1.250  netmask 255.255.255.0  broadcast 192.168.1.255
    ether 0c:c4:7a:7d:bb:f8  txqueuelen 1000  (Ethernet)
    RX packets 24515  bytes 5405247 (5.1 MiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 31116  bytes 3036051 (2.8 MiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    device interrupt 16  memory 0xdf200000-df220000  

eth1:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.0.250  netmask 255.255.255.0  broadcast 192.168.0.255
    ether 0c:c4:7a:7d:bb:f8  txqueuelen 1000  (Ethernet)
    device interrupt 16  memory 0xdf200000-df220000  

在/etc/sysconfig/dhcpd我有

DHCPD_INTERFACE="eth1 eth1:1"
DHCPDARGS="eth1 eth1:1"

在/etc/dhcpd.conf我有

subnet 192.168.0.0 netmask 255.255.255.0 {
    pool {
       ....
    }
}
subnet 192.168.1.0 netmask 255.255.255.0 {
    pool {
        ....
    }
}

然而,当我启动 dhcpd 时,我看到了这个

$ sudo journalctl -xeu dhcpd.service
  ....
dhcpd[5113]: No subnet declaration for eth1:1 (no IPv4 addresses).
dhcpd[5113]: ** Ignoring requests on eth1:1.  If this is not what
dhcpd[5113]:    you want, please write a subnet declaration
dhcpd[5113]:    in your dhcpd.conf file for the network segment
dhcpd[5113]:    to which interface eth1:1 is attached. **
  ....

为什么?

centos dhcp
  • 1 个回答
  • 1836 Views
Martin Hope
Andrew Falanga
Asked: 2017-11-29 13:40:12 +0800 CST

为什么我的交换机没有从指定的池中获取地址

  • 2

我正在通过Zero Touch Provisioning配置 Juniper Networks 交换机。在 CentOS 7 上,journal/log/(systemd 不管它是什么) 包含以下内容:

Nov 28 10:08:46 server dhcpd[8800]: Checking if packet is permitted.
Nov 28 10:08:46 server dhcpd[8800]:     Permit list: unknown clients
Nov 28 10:08:46 server dhcpd[8800]:    OK
Nov 28 10:08:46 server dhcpd[8800]: Checking if packet is permitted.
Nov 28 10:08:46 server dhcpd[8800]:     Permit list: unknown clients
Nov 28 10:08:46 server dhcpd[8800]:    OK
Nov 28 10:08:46 server dhcpd[8800]: matched a Juniper Networks QFX-5100
Nov 28 10:08:46 server dhcpd[8800]: DHCPDISCOVER from 08:b2:58:ab:dc:00 via eth2
Nov 28 10:08:47 server dhcpd[8800]: DHCPOFFER on 192.168.0.100 to 08:b2:58:ab:dc:00 (TR0217010017) via eth2
Nov 28 10:08:47 server dhcpd[8800]: Checking if packet is permitted.
Nov 28 10:08:47 server dhcpd[8800]:     Permit list: unknown clients
Nov 28 10:08:47 server dhcpd[8800]:    OK
Nov 28 10:08:47 server dhcpd[8800]: Checking if packet is permitted.
Nov 28 10:08:47 server dhcpd[8800]:     Permit list: unknown clients
Nov 28 10:08:47 server dhcpd[8800]:    OK
Nov 28 10:08:47 server dhcpd[8800]: matched a Juniper Networks QFX-5100
Nov 28 10:08:47 server dhcpd[8800]: DHCPREQUEST for 192.168.0.100 (192.168.0.250) from 08:b2:58:ab:dc:00 (TR0217010017) via eth2
Nov 28 10:08:47 server dhcpd[8800]: DHCPACK on 192.168.0.100 to 08:b2:58:ab:dc:00 (TR0217010017) via eth2

服务器是从“未知”池中提供的。以下是配置的相关部分:

# Global options
max-lease-time 1800;
default-lease-time 1800;
dynamic-bootp-lease-length 120;
ddns-update-style none;

# TFTP Server IP and file
next-server 192.168.0.250; # Assumed to be the DHCP server
filename "pxelinux.0";


# Define the pxe grub filename option
option zone-pxegrub-filename code 150 = text;
option zone-pxegrub-filename "/opt/tftp_files/boot/pxelinux.0";

# Options for Juniper switch to download FW and configuration from this server
# as described here: https://www.juniper.net/documentation/en_US/junos/topics/task/configuration/software-image-and-configuration-automatic-provisioning-confguring.html
option space NEW_OP;
option NEW_OP.config-file-name code 1 = text;
option NEW_OP.image-file-name code 0 = text;
option NEW_OP.image-file-type code 2 = text;
option NEW_OP.transfer-mode code 3 = text;
option NEW_OP.alt-image-file-name code 4 = text;
option NEW_OP-encapsulation code 43 = encapsulate NEW_OP;
option option-150 code 150 = ip-address;

# bringing in the vendor specific options
vendor-option-space NEW_OP;
option NEW_OP.image-file-name "/juniper/fw/jinstall-host-qfx-5-17.2R1.13-signed.tgz";
option NEW_OP.config-file-name "/juniper/cfg/qfx-5100.cfg";
option NEW_OP.alt-image-file-name "/juniper/fw/jinstall-host-qfx-5-17.2R1.13-signed.tgz";
option NEW_OP.image-file-type "filename";
option NEW_OP.transfer-mode "tftp";

option option-150 192.168.0.250;


class "workers" {
   match if substring(hardware, 1, 3) = 00:20:0c or substring(hardware, 1, 3) = 00:18:7D;
   log(info, "matched a worker bee");
}

class "monitor" {
   match if substring(hardware, 1, 3) = 00:d0:24;
   log(info, "matched to a monitor");
}

class "JuniperSwitch" {
   match if option vendor-class-identifier ~~ "^juniper-qfx5100.+$";
   log(info, "matched a Juniper Networks QFX-5100");
}

subnet 192.168.0.0 netmask 255.255.255.0 {
   #authoritative;
   option routers 192.168.0.250;
   pool {
      allow members of "workers";
      range 192.168.0.1 192.168.0.99;
      log(info, concat("Issuing DHCP address to worker bootp requestor: ", binary-to-ascii(16, 8, ":", substring(hardware, 1, 6))));
   }
   pool {
      allow members of "monitor";
      range 192.168.0.245;
      log(info, concat("Issuing DHCP address to monitor bootp requestor: ", binary-to-ascii(16, 8, ":", substring(hardware, 1, 6))));
   }
   pool {
      allow members of "JuniperSwitch";
      allow dynamic bootp clients;
      range 192.168.0.201;
   }
   pool {
      allow unknown-clients;
      range 192.168.0.100 192.168.0.150;
   }
}

请帮助我理解为什么这没有给出我期望的地址。

centos dhcp
  • 1 个回答
  • 109 Views

Sidebar

Stats

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

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve