7.7. 네트워크 RHEL 시스템 역할을 사용하여 네트워크 본딩 구성

네트워크 RHEL 시스템 역할을 사용하여 Linux 본딩을 구성할 수 있습니다. 예를 들어 두 개의 이더넷 장치를 사용하는 active-backup 모드로 네트워크 본딩을 구성하고 IPv4 및 IPv6 주소, 기본 게이트웨이 및 DNS 구성을 설정합니다.

참고

Linux 본딩 포트에가 아니라 본딩에서 IP 구성을 설정합니다.

Ansible 제어 노드에서 다음 절차를 수행합니다.

사전 요구 사항

  • 제어 노드와 관리형 노드를 준비했습니다.
  • 관리 노드에서 플레이북을 실행할 수 있는 사용자로 제어 노드에 로그인되어 있습니다.
  • 관리형 노드에 연결하는 데 사용하는 계정에는 sudo 권한이 있습니다.
  • 이 플레이북을 실행하려는 관리형 노드 또는 관리형 노드 그룹은 Ansible 인벤토리 파일에 나열됩니다.
  • 서버에 두 개 이상의 실제 또는 가상 네트워크 장치가 설치되어 있습니다.

절차

  1. 다음 내용으로 플레이북 파일(예: ~/bond-ethernet.yml )을 만듭니다.

    ---
    - name: Configure the network
      hosts: managed-node-01.example.com
      tasks:
      - name: Configure a network bond that uses two Ethernet ports
        include_role:
          name: rhel-system-roles.network
    
        vars:
          network_connections:
            # Define the bond profile
            - name: bond0
              type: bond
              interface_name: bond0
              ip:
                address:
                  - "192.0.2.1/24"
                  - "2001:db8:1::1/64"
                gateway4: 192.0.2.254
                gateway6: 2001:db8:1::fffe
                dns:
                  - 192.0.2.200
                  - 2001:db8:1::ffbb
                dns_search:
                  - example.com
              bond:
                mode: active-backup
              state: up
    
            # Add an Ethernet profile to the bond
            - name: bond0-port1
              interface_name: enp7s0
              type: ethernet
              controller: bond0
              state: up
    
            # Add a second Ethernet profile to the bond
            - name: bond0-port2
              interface_name: enp8s0
              type: ethernet
              controller: bond0
              state: up
  2. 플레이북을 실행합니다.

    # ansible-playbook ~/bond-ethernet.yml

추가 리소스

  • /usr/share/ansible/roles/rhel-system-roles.network/README.md file