7.9.4. 인터페이스별 안전한 sysctl 목록 업데이트


OpenShift Container Platform에는 사전 정의된 안전한 인터페이스별 sysctl 목록이 포함되어 있습니다. openshift-multus 네임스페이스에서 cni-sysctl-allowlist 를 업데이트하여 이 목록을 수정할 수 있습니다.

중요

인터페이스별 안전한 sysctl 목록 업데이트 지원은 기술 프리뷰 기능 전용입니다. 기술 프리뷰 기능은 Red Hat 프로덕션 서비스 수준 계약(SLA)에서 지원되지 않으며 기능적으로 완전하지 않을 수 있습니다. 따라서 프로덕션 환경에서 사용하는 것은 권장하지 않습니다. 이러한 기능을 사용하면 향후 제품 기능을 조기에 이용할 수 있어 개발 과정에서 고객이 기능을 테스트하고 피드백을 제공할 수 있습니다.

Red Hat 기술 프리뷰 기능의 지원 범위에 대한 자세한 내용은 기술 프리뷰 기능 지원 범위를 참조하십시오.

사전 정의된 안전한 sysctl 목록을 수정하려면 다음 절차를 따르십시오. 다음 절차에서는 기본 허용 목록을 확장하는 방법을 설명합니다.

절차

  1. 다음 명령을 실행하여 사전 정의된 기존 목록을 확인합니다.

    $ oc get cm -n openshift-multus cni-sysctl-allowlist -oyaml

    예상 출력

    apiVersion: v1
    data:
      allowlist.conf: |-
        ^net.ipv4.conf.IFNAME.accept_redirects$
        ^net.ipv4.conf.IFNAME.accept_source_route$
        ^net.ipv4.conf.IFNAME.arp_accept$
        ^net.ipv4.conf.IFNAME.arp_notify$
        ^net.ipv4.conf.IFNAME.disable_policy$
        ^net.ipv4.conf.IFNAME.secure_redirects$
        ^net.ipv4.conf.IFNAME.send_redirects$
        ^net.ipv6.conf.IFNAME.accept_ra$
        ^net.ipv6.conf.IFNAME.accept_redirects$
        ^net.ipv6.conf.IFNAME.accept_source_route$
        ^net.ipv6.conf.IFNAME.arp_accept$
        ^net.ipv6.conf.IFNAME.arp_notify$
        ^net.ipv6.neigh.IFNAME.base_reachable_time_ms$
        ^net.ipv6.neigh.IFNAME.retrans_time_ms$
    kind: ConfigMap
    metadata:
      annotations:
        kubernetes.io/description: |
          Sysctl allowlist for nodes.
        release.openshift.io/version: 4.13.0-0.nightly-2022-11-16-003434
      creationTimestamp: "2022-11-17T14:09:27Z"
      name: cni-sysctl-allowlist
      namespace: openshift-multus
      resourceVersion: "2422"
      uid: 96d138a3-160e-4943-90ff-6108fa7c50c3

  2. 다음 명령을 사용하여 목록을 편집합니다.

    $ oc edit cm -n openshift-multus cni-sysctl-allowlist -oyaml

    예를 들어, 보다 엄격한 역방향 경로를 구현할 수 있도록 하려면 다음과 같이 ^net.ipv4.conf.IFNAME.rp_filter$^net.ipv6.conf.conf.IFNAME.rp_filter$ 를 추가해야 합니다.

    # Please edit the object below. Lines beginning with a '#' will be ignored,
    # and an empty file will abort the edit. If an error occurs while saving this file will be
    # reopened with the relevant failures.
    #
    apiVersion: v1
    data:
      allowlist.conf: |-
        ^net.ipv4.conf.IFNAME.accept_redirects$
        ^net.ipv4.conf.IFNAME.accept_source_route$
        ^net.ipv4.conf.IFNAME.arp_accept$
        ^net.ipv4.conf.IFNAME.arp_notify$
        ^net.ipv4.conf.IFNAME.disable_policy$
        ^net.ipv4.conf.IFNAME.secure_redirects$
        ^net.ipv4.conf.IFNAME.send_redirects$
        ^net.ipv4.conf.IFNAME.rp_filter$
        ^net.ipv6.conf.IFNAME.accept_ra$
        ^net.ipv6.conf.IFNAME.accept_redirects$
        ^net.ipv6.conf.IFNAME.accept_source_route$
        ^net.ipv6.conf.IFNAME.arp_accept$
        ^net.ipv6.conf.IFNAME.arp_notify$
        ^net.ipv6.neigh.IFNAME.base_reachable_time_ms$
        ^net.ipv6.neigh.IFNAME.retrans_time_ms$
        ^net.ipv6.conf.IFNAME.rp_filter$
  3. 파일의 변경 사항을 저장하고 종료합니다.

    참고

    sysctl 제거도 지원됩니다. 파일을 편집하고 sysctl 또는 sysctl 을 제거한 다음 변경 사항을 저장하고 종료합니다.

검증

IPv4에 대해 더 엄격한 역방향 경로 전달을 적용하려면 다음 절차를 따르십시오. 역방향 경로 전달에 대한 자세한 내용은 역방향 경로 전달 을 참조하십시오.

  1. 다음 콘텐츠를 사용하여 reverse-path-fwd-example.yaml 과 같은 네트워크 연결 정의를 생성합니다.

    apiVersion: "k8s.cni.cncf.io/v1"
    kind: NetworkAttachmentDefinition
    metadata:
      name: tuningnad
      namespace: default
    spec:
      config: '{
        "cniVersion": "0.4.0",
        "name": "tuningnad",
        "plugins": [{
          "type": "bridge"
          },
          {
          "type": "tuning",
          "sysctl": {
             "net.ipv4.conf.IFNAME.rp_filter": "1"
            }
        }
      ]
    }'
  2. 다음 명령을 실행하여 yaml을 적용합니다.

    $ oc apply -f reverse-path-fwd-example.yaml

    출력 예

    networkattachmentdefinition.k8.cni.cncf.io/tuningnad created

  3. 다음 YAML을 사용하여 examplepod.yaml 과 같은 Pod를 생성합니다.

    apiVersion: v1
    kind: Pod
    metadata:
      name: example
      labels:
        app: httpd
      namespace: default
      annotations:
        k8s.v1.cni.cncf.io/networks: tuningnad  
    1
    
    spec:
      securityContext:
        runAsNonRoot: true
        seccompProfile:
          type: RuntimeDefault
      containers:
        - name: httpd
          image: 'image-registry.openshift-image-registry.svc:5000/openshift/httpd:latest'
          ports:
            - containerPort: 8080
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
    1
    구성된 NetworkAttachmentDefinition 의 이름을 지정합니다.
  4. 다음 명령을 실행하여 yaml을 적용합니다.

    $ oc apply -f examplepod.yaml
  5. 다음 명령을 실행하여 Pod가 생성되었는지 확인합니다.

    $ oc get pod

    출력 예

    NAME      READY   STATUS    RESTARTS   AGE
    example   1/1     Running   0          47s

  6. 다음 명령을 실행하여 포드에 로그인합니다.

    $ oc rsh example
  7. 구성된 sysctl 플래그의 값을 확인합니다. 예를 들어 다음 명령을 실행하여 net.ipv4.conf.net1.rp_filter 값을 찾습니다.

    sh-4.4# sysctl net.ipv4.conf.net1.rp_filter

    예상 출력

    net.ipv4.conf.net1.rp_filter = 1

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동