티스토리 뷰

Ubuntu에서 사용되는 netplan은 다음과 같은 ring buffer 설정을 고정하는 기능을 제공하지 않는다.

ETHTOOL_OPTS="-G ${DEVICE} rx 1024 ; -G {$DEVICE} tx 1024"

그러면 ringbuffer size 변경과 같이 재부팅후에도 적용이 되어야하는 설정의 적용은 어떻게 하는지 알아보자.

먼저 github에 보고된 내용이다.

갑자기 systemd가 나온다. 이유는 netplan은 기본적으로 아래와 같이 상단에서 systemd-networkd (혹은 NetworkManager)에서 실행될수 있는 backend file을 생성하게 된다.

즉, netplan에서 제공하지 않는 기능이더라도 systemd에서 설정이 될수 있다면 문제가 없다는 의미이다.

이제 실제 어떻게 변경하는지 알아보자.

systemd.link를 이용한 변경

netplan으로 만들어진 yaml파일이 존재하고

root@ubuntu20-server:/home/vagrant# cat /etc/netplan/50-vagrant.yaml
---
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s8:
      addresses:
      - 192.168.56.20/2
    enp0s9:
      dhcp4: no
    enp0s10:
      dhcp4: no

위 yaml을 기반으로 다음과 같은 파일이 만들어졌음을 확인할수 있다.

root@ubuntu20-server:/home/vagrant# cat /run/systemd/network/10-netplan-enp0s9.network
[Match]
Name=enp0s9

[Network]
LinkLocalAddressing=ipv6

실제 renderer가 default인 systemd-networkd로 되어 있기에 다음 명령어로 확인이 가능하다.

root@ubuntu20-server:~$ networkctl status enp0s9
● 4: enp0s9
                     Link File: /usr/lib/systemd/network/99-default.link
                  Network File: /run/systemd/network/10-netplan-enp0s9.network
                          Type: ether
                         State: degraded (configured)
                  Online state: online
                          Path: pci-0000:00:09.0
                        Driver: e1000
                        Vendor: Intel Corporation
                         Model: 82540EM Gigabit Ethernet Controller (PRO/1000 MT Desktop Adapter)
                    HW Address: 08:00:27:2c:80:44 (PCS Systemtechnik GmbH)
                           MTU: 1500 (min: 46, max: 16110)
                         QDisc: fq_codel
  IPv6 Address Generation Mode: eui64
          Queue Length (Tx/Rx): 1/1
              Auto negotiation: yes
                         Speed: 1Gbps
                        Duplex: full
                          Port: tp
                       Address: fe80::a00:27ff:fe2c:8044
             Activation Policy: up
           Required For Online: yes
             DHCP6 Client DUID: DUID-EN/Vendor:0000ab113bec7097fccc15660000

여기서 주목할 것은 Link File이다.
기본적으로는 99-default.link가 link file로 설정되어 있다.

다음과 같은 link 파일을 생성하고

root@ubuntu20-server:/home/vagrant# cat /etc/systemd/network/10-netplan-enp0s9.link
[Match]
MACAddress=08:00:27:2c:80:44

[Link]
RxBufferSize=1024
TxBufferSize=1024

재부팅하게되면 다음과 같이 변경된 Link File을 확인할 수 있다.

root@ubuntu20-server:~$ networkctl status enp0s9
● 4: enp0s9
                     Link File: /etc/systemd/network/10-netplan-enp0s9.link
                  Network File: /run/systemd/network/10-netplan-enp0s9.network
                          Type: ether
                         State: degraded (configured)
                  Online state: online
                          Path: pci-0000:00:09.0
                        Driver: e1000
                        Vendor: Intel Corporation
                         Model: 82540EM Gigabit Ethernet Controller (PRO/1000 MT Desktop Adapter)
                    HW Address: 08:00:27:2c:80:44 (PCS Systemtechnik GmbH)
                           MTU: 1500 (min: 46, max: 16110)
                         QDisc: fq_codel
  IPv6 Address Generation Mode: eui64
          Queue Length (Tx/Rx): 1/1
              Auto negotiation: yes
                         Speed: 1Gbps
                        Duplex: full
                          Port: tp
                       Address: fe80::a00:27ff:fe2c:8044
             Activation Policy: up
           Required For Online: yes
             DHCP6 Client DUID: DUID-EN/Vendor:0000ab113bec7097fccc15660000

실제 변경된 ringbuffer size를 확인해보면 다음과 같이 지정했던 1024가 확인된다.

root@ubuntu20-server:/home/vagrant# ethtool -g enp0s9
Ring parameters for enp0s9:
Pre-set maximums:
RX:             4096
RX Mini:        n/a
RX Jumbo:       n/a
TX:             4096
Current hardware settings:
RX:             1024
RX Mini:        n/a
RX Jumbo:       n/a
TX:             1024

참고사이트

'os > Linux' 카테고리의 다른 글

nftables  (0) 2022.08.09
print net_ratelimit in the message  (0) 2022.02.15
process max open files with systemd  (0) 2021.11.24
How to occur hung_task_panic on Rocky Linux  (0) 2021.11.03
Ubuntu CVE Status  (0) 2021.03.17
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함