Rocky Linux 9에서 bonding 설정 작업
1. /etc/default/grub 파일에 추가(아래 명령어 자동 추가)
# grubby --update-kernel=ALL --args="ipv6.disable=1 net.ifnames=0 biosdevname=0"
2. bond 설정 추가(ip도 같이 추가가 편함)
# nmcli connection add type bond ifname bond0 mode balance-rr ipv4.method manual ipv4.addresses 192.168.78.129/24 ipv4.gateway 192.168.78.2 ipv6.method ignore ipv4.dns 8.8.8.8,8.8.4.4
3. bond slave 설정 추가(eth0~3 추가)
# nmcli connection add type ethernet ifname eth0 master bond0
# nmcli connection add type ethernet ifname eth1 master bond0
# nmcli connection add type ethernet ifname eth2 master bond0
# nmcli connection add type ethernet ifname eth3 master bond0
4. 적용(eth로 인터페이스 바뀌기 전이면 reboot)
reboot 또는 systemctl restart NetworkManager
5. 확인
# nmcli connection
# ip a
# ifconfig
# cat /proc/net/bonding/bond0
* 파일이 여럿 생성되어 지저분할때 삭제 명령어(nmcli 명령과 ls 명령으로 지저분한 파일 확인)
nmcli connection delete bond-bond0-1
설정파일 값
#cat bond-bond0.nmconnection
------------------------------------------------------------------------------------
[connection]
id=bond-bond0-3
uuid=940c9bab-3ea1-4921-a476-ec1ccde0543c
type=bond
interface-name=bond0
[bond]
mode=balance-rr
[ipv4]
address1=192.168.78.129/24,192.168.78.2
dns=8.8.8.8;8.8.4.4;
method=manual
[ipv6]
addr-gen-mode=default
method=ignore
[proxy]
------------------------------------------------------------------------------------
#cat bond-slave-eth0.nmconnection
------------------------------------------------------------------------------------
[connection]
id=bond-slave-eth0
uuid=2a7474bf-94e7-4aa6-b5d8-52e1bc6a6dec
type=ethernet
controller=bond0
interface-name=eth0
port-type=bond
[ethernet]
[bond-port]
------------------------------------------------------------------------------------
수정하는 방법
# nmcli connection modify bond-bond0 ifname bond0 mode balance-rr ipv6.method ignore ipv4.method manual ipv4.addresses 192.168.78.129/24 ipv4.gateway 192.168.78.2 ipv6.method ignore ipv4.dns 8.8.8.8,8.8.4.4
/etc/NetworkManager/system-connections
[root@rocky9 system-connections]# ll
total 20
-rw-------. 1 root root 281 Feb 22 02:31 bond-bond0.nmconnection
-rw-------. 1 root root 165 Feb 22 01:46 bond-slave-eth0.nmconnection
-rw-------. 1 root root 165 Feb 22 01:48 bond-slave-eth1.nmconnection
-rw-------. 1 root root 165 Feb 22 01:45 bond-slave-eth2.nmconnection
-rw-------. 1 root root 165 Feb 22 01:45 bond-slave-eth3.nmconnection
-----------------------------------
ens160이란 인터페이스를 eth0으로 변경
mv /etc/NetworkManager/system-connections/ens160.nmconnection /etc/NetworkManager/system-connections/eth0.nmconnection
바꾼 파일의 ens160을 eth0으로 변경
sed -i 's/ens160/eth0/g' /etc/NetworkManager/system-connections/eth0.nmconnection