AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / unix / Perguntas / 762799
Accepted
hudac
hudac
Asked: 2023-12-01 05:57:16 +0800 CST2023-12-01 05:57:16 +0800 CST 2023-12-01 05:57:16 +0800 CST

A configuração do MTU não funciona no systemd-networkd, mas funciona no 'ip link set mtu'

  • 772

Estou tentando mudar uma MTUinterface.
Percebi que não muda corretamente ao usar systemd-networkd, mas funciona quando uso o ip link set mtucomando.

Atual MTUé 1500:

3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode eui64 numtxqueues 8 numrxqueues 8 gso_max_size 65536 gso_max_segs 65535 

Agora, mudei meu /etc/systemd/network/50_eth0.networkarquivo e adicionei:

[Link]
MTUBytes = 1000

Após systemd-networkda reinicialização do serviço, syslogmostra:

Nov 30 23:36:20 me kernel: [84974.429088] igb 0000:00:14.0: changing MTU from 1500 to 1280

E a corrente MTUé 1280:

3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode eui64 numtxqueues 8 numrxqueues 8 gso_max_size 65536 gso_max_segs 65535 

Como você pode ver, eu queria 1000, mas mudou para 1280. Acho que li em algum lugar sobre um limite devido ao IPv6.

Agora, ao usar a ipferramenta:

ip link set mtu 1000 dev eth0

syslog:

Nov 30 23:36:44 me kernel: [84998.785039] igb 0000:00:14.0: changing MTU from 1280 to 1000

E a corrente MTUé 1000:

# ip -d link show dev eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1000 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff promiscuity 0 numtxqueues 8 numrxqueues 8 gso_max_size 65536 gso_max_segs 65535 

Por que uma forma funciona e a outra não?
Obrigado.

linux
  • 1 1 respostas
  • 29 Views

1 respostas

  • Voted
  1. Best Answer
    hudac
    2023-12-05T15:40:26+08:002023-12-05T15:40:26+08:00

    De acordo com o comentário da AB.
    Na verdade, o final MTUBytesda [Link]seção diz esta nota IPv6:

    MTUBytes=
    The maximum transmission unit in bytes to set for the device. The usual suffixes K, M, G, are supported and are understood to the base of 1024.
    Note that if IPv6 is enabled on the interface, and the MTU is chosen below 1280 (the minimum MTU for IPv6) it will automatically be increased to this value.
    

    Depois de desabilitar o IPv6 para essa interface, consegui um MTU inferior a 1280.
    Desativei esse IPv6 para essa interface usando a diretiva da [Network]seção abaixo, com o nonevalor:

    IPv6LinkLocalAddressGenerationMode=
    Specifies how IPv6 link-local address is generated. Takes one of "eui64", "none", "stable-privacy" and "random". When unset, "stable-privacy" is used if IPv6StableSecretAddress= is specified, and if not, "eui64" is used. Note that if LinkLocalAddressing= is "no" or "ipv4", then IPv6LinkLocalAddressGenerationMode= will be ignored. Also, even if LinkLocalAddressing= is "yes" or "ipv6", setting IPv6LinkLocalAddressGenerationMode=none disables to configure an IPv6 link-local address.
    
    • 1

relate perguntas

  • Existe uma maneira de fazer ls mostrar arquivos ocultos apenas para determinados diretórios?

  • Inicie/pare o serviço systemd usando o atalho de teclado [fechado]

  • Necessidade de algumas chamadas de sistema

  • astyle não altera a formatação do arquivo de origem

  • Passe o sistema de arquivos raiz por rótulo para o kernel do Linux

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Possível firmware ausente /lib/firmware/i915/* para o módulo i915

    • 3 respostas
  • Marko Smith

    Falha ao buscar o repositório de backports jessie

    • 4 respostas
  • Marko Smith

    Como exportar uma chave privada GPG e uma chave pública para um arquivo

    • 4 respostas
  • Marko Smith

    Como podemos executar um comando armazenado em uma variável?

    • 5 respostas
  • Marko Smith

    Como configurar o systemd-resolved e o systemd-networkd para usar o servidor DNS local para resolver domínios locais e o servidor DNS remoto para domínios remotos?

    • 3 respostas
  • Marko Smith

    apt-get update error no Kali Linux após a atualização do dist [duplicado]

    • 2 respostas
  • Marko Smith

    Como ver as últimas linhas x do log de serviço systemctl

    • 5 respostas
  • Marko Smith

    Nano - pule para o final do arquivo

    • 8 respostas
  • Marko Smith

    erro grub: você precisa carregar o kernel primeiro

    • 4 respostas
  • Marko Smith

    Como baixar o pacote não instalá-lo com o comando apt-get?

    • 7 respostas
  • Martin Hope
    user12345 Falha ao buscar o repositório de backports jessie 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl Por que a maioria dos exemplos do systemd contém WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky Como exportar uma chave privada GPG e uma chave pública para um arquivo 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll status systemctl mostra: "Estado: degradado" 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim Como podemos executar um comando armazenado em uma variável? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S Por que /dev/null é um arquivo? Por que sua função não é implementada como um programa simples? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 Como ver as últimas linhas x do log de serviço systemctl 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - pule para o final do arquivo 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla Por que verdadeiro e falso são tão grandes? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis Substitua a string em um arquivo de texto enorme (70 GB), uma linha 2017-12-30 06:58:33 +0800 CST

Hot tag

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

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve