[linux] 네트워크, 본딩 설정IT/linux2020. 2. 7. 17:58
Table of Contents
CentOS
단일 네트워크 설정
$ vi /etc/sysconfig/network-scripts/ifcfg-eth0
---
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
NM_CONTROLLED=yes
IPADDR=192.168.100.2
GATEWAY=192.168.100.1
NETMASK=192.168.100.255
본딩 네트워크 설정
선행 작업
$ vi /etc/sysconfig/network-scripts/ifcfg-bond0
---
DEVICE=bond0
BOOTPROTO=static
ONBOOT=yes
NM_CONTROLLED=no
IPADDR=x.x.x.x
NETMASK=x.x.x.x
BONDING_OPT=“mode=0 miimon=100”
$ vi /etc/sysconfig/network
---
NETWORKING=yes
HOSTNAME=
NOZEROCONF=yes
GATEWAY=x.x.x.x
본딩 설정 방법
이더넷 두 개 정하기(eth0, eth1)
$ vi /etc/sysconfig/network-scripts/ifcfg-eth0
---
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
NM_CONTROLLED=no
HWADDR=x:x:x:x:x:x
MASTER=bond0
SLAVE=yes
$ vi /etc/sysconfig/network-scripts/ifcfg-eth1
---
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
NM_CONTROLLED=no
HWADDR=x:x:x:x:x:x
MASTER=bond0
SLAVE=yes
Ubuntu 22.04
단일 네트워크 설정
$ vi /etc/netplan/00-installer-config.yaml
---
network:
ethernets:
enp3s0:
addresses: [192.168.100.2/24]
routes:
- to: 0.0.0.0/0
via: 192.168.100.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
version: 2
본딩 네트워크 설정
선행 작업
$ sudo modprobe bonding
$ sudo lsmod | grep bonding
bonding 200704 0
tls 114688 1 bonding
$ sudo apt install ifenslave
$ echo 'bonding' | sudo tee -a /etc/modules
$ ip a
본딩 설정 방법
$ vi /etc/netplan/00-installer-config.yaml
---
network:
ethernets:
enp3s0:
dhcp4: no
enp4s0:
dhcp4: no
bonds:
bond0:
interfaces: [enp3s0, enp4s0]
addresses: [192.168.100.100/24]
gateway4: 192.168.100.1
parameters:
mode: active-backup
mii-monitor-interval: 100
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
version: 2
네트워크 재시작
$ netplan apply
본딩 설정 확인
$ cat /proc/net/bonding/bond0
본딩 모드 설명
MODE 0 - balance-rr
MODE 1 - active-backup
MODE 2 - balance-xor
MODE 3 - broadcast
'IT > linux' 카테고리의 다른 글
[linux] vi 명령어 (0) | 2020.04.16 |
---|---|
[linux] 디렉토리 (0) | 2020.02.27 |
[linux] sed (0) | 2020.02.27 |
[linux] runlevel (0) | 2020.02.27 |
[linux] ipmi (0) | 2020.02.27 |
@주니- :: 주니
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!