본문 바로가기
공부/Ubuntu

Netplan bonding (active-backup)

by CITTA 2023. 2. 13.
728x90
반응형

1. Bonding module 확인

## bonding module을 호출
$ modprobe bonding

## enable 되어있는지 확인
$ lsmod |grep bonding
bonding               196608  0
tls                   114688  1 bonding

## 안되어있다면 설치해야함
$ apt install ifenslave

## 부팅시 자동활성화 적용
$ echo 'bonding'|sudo tee -a /etc/modules
bonding

2. Netplan을 이용한 구성

## /etc/netplane/00-installer-config.yaml 수정
$ vi /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
  ethernets:
    enp1s0:
      dhcp4: no
    enp2s0:
      dhcp4: no
  bonds:
    bond0:
      interfaces: [enp1s0,enp2s0]
      addresses:
        - 192.168.130.141/23
      gateway4: 192.168.130.1
      parameters:
        mode: active-backup
        transmit-hash-policy: layer3+4
        mii-monitor-interval: 1
      nameservers:
        addresses:
          - "168.126.63.1"
          - "8.8.8.8"
  version: 2

## network 변경사항 적용
$ netplan apply

## bond0 interface status
$ ifconfig bond0
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
        inet 192.168.130.141  netmask 255.255.254.0  broadcast 192.168.131.255
        inet6 fe80::184d:5eff:feae:6b02  prefixlen 64  scopeid 0x20<link>
        ether 1a:4d:5e:ae:6b:02  txqueuelen 1000  (Ethernet)
        RX packets 1831  bytes 197600 (197.6 KB)
        RX errors 0  dropped 275  overruns 0  frame 0
        TX packets 128  bytes 16071 (16.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

## bond0 interface states detail
$ cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v5.15.0-60-generic

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: enp1s0
MII Status: up
MII Polling Interval (ms): 1
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0

Slave Interface: enp2s0
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 1
Permanent HW addr: 56:6f:4e:95:00:a4
Slave queue ID: 0

Slave Interface: enp1s0
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 1
Permanent HW addr: 56:6f:4e:95:00:a3
Slave queue ID: 0
728x90
반응형

'공부 > Ubuntu' 카테고리의 다른 글

Ubuntu root login 설정  (0) 2023.02.13
ubuntu 설치 후 부팅 시 cloud-init message 발생  (0) 2023.02.13
ubuntu 방화벽 관리  (0) 2023.02.07
ubuntu gui root 로그인 허용  (0) 2023.02.06
ubuntu gui package 설치  (0) 2023.02.06

댓글