33.2. nmstatectl을 사용하여 802.1X 네트워크 인증을 사용하여 정적 이더넷 연결 구성
nmstatectl
유틸리티를 사용하여 Nmstate API를 통해 802.1X 네트워크 인증으로 이더넷 연결을 구성합니다. Nmstate API는 구성을 설정한 후 결과가 구성 파일과 일치하는지 확인합니다. 아무것도 실패하면 nmstatectl
에서 시스템을 잘못된 상태로 두지 않도록 변경 사항을 자동으로 롤백합니다.
nmstate
라이브러리는 TLS
EAP(Extensible Authentication Protocol) 메서드만 지원합니다.
사전 요구 사항
- 네트워크는 802.1X 네트워크 인증을 지원합니다.
- 관리 노드는 NetworkManager를 사용합니다.
클라이언트에는 TLS 인증에 필요한 다음 파일이 있습니다.
-
저장된 클라이언트 키는
/etc/pki/tls/private/client.key
파일에 있으며 파일은root
사용자만 소유하고 읽을 수 있습니다. -
클라이언트 인증서는
/etc/pki/tls/certs/client.crt
파일에 저장됩니다. -
CA(인증 기관) 인증서는
/etc/pki/tls/certs/ca.crt
파일에 저장됩니다.
-
저장된 클라이언트 키는
절차
다음 콘텐츠를 사용하여 YAML 파일(예:
~/create-ethernet-profile.yml
)을 만듭니다.--- interfaces: - name: enp1s0 type: ethernet state: up ipv4: enabled: true address: - ip: 192.0.2.1 prefix-length: 24 dhcp: false ipv6: enabled: true address: - ip: 2001:db8:1::1 prefix-length: 64 autoconf: false dhcp: false 802.1x: ca-cert: /etc/pki/tls/certs/ca.crt client-cert: /etc/pki/tls/certs/client.crt eap-methods: - tls identity: client.example.org private-key: /etc/pki/tls/private/client.key private-key-password: password routes: config: - destination: 0.0.0.0/0 next-hop-address: 192.0.2.254 next-hop-interface: enp1s0 - destination: ::/0 next-hop-address: 2001:db8:1::fffe next-hop-interface: enp1s0 dns-resolver: config: search: - example.com server: - 192.0.2.200 - 2001:db8:1::ffbb
--- interfaces: - name: enp1s0 type: ethernet state: up ipv4: enabled: true address: - ip: 192.0.2.1 prefix-length: 24 dhcp: false ipv6: enabled: true address: - ip: 2001:db8:1::1 prefix-length: 64 autoconf: false dhcp: false 802.1x: ca-cert: /etc/pki/tls/certs/ca.crt client-cert: /etc/pki/tls/certs/client.crt eap-methods: - tls identity: client.example.org private-key: /etc/pki/tls/private/client.key private-key-password: password routes: config: - destination: 0.0.0.0/0 next-hop-address: 192.0.2.254 next-hop-interface: enp1s0 - destination: ::/0 next-hop-address: 2001:db8:1::fffe next-hop-interface: enp1s0 dns-resolver: config: search: - example.com server: - 192.0.2.200 - 2001:db8:1::ffbb
Copy to Clipboard Copied! 이러한 설정은 다음 설정을 사용하여
enp1s0
장치에 대한 이더넷 연결 프로필을 정의합니다.-
/24
서브넷 마스크가 있는 정적 IPv4 주소 -192.0.2.1
-
정적 IPv6 주소 -
2001:db8:1::1
(/64
서브넷 마스크 포함) -
IPv4 기본 게이트웨이 -
192.0.2.254
-
IPv6 기본 게이트웨이 -
2001:db8:1::fffe
-
IPv4 DNS 서버 -
192.0.2.200
-
IPv6 DNS 서버
2001:db8:1::ffbb
-
DNS 검색 도메인 -
example.com
-
TLS
EAP 프로토콜을 사용한 802.1x 네트워크 인증
-
시스템에 설정을 적용합니다.
nmstatectl apply ~/create-ethernet-profile.yml
# nmstatectl apply ~/create-ethernet-profile.yml
Copy to Clipboard Copied!
검증
- 네트워크 인증이 필요한 네트워크에서 리소스에 액세스합니다.