OCI Compute OS 재부팅하지 않고 DHCP 옵션 설정을 다시 반영

소개



Oracle Cloud Infrastructure의 VCN(가상 네트워크) 내에서 AWS VNC와 마찬가지로 DHCP는 OS에 IP 주소와 DHCP 옵션(DNS 서버 및 검색 도메인(DNS 접미사))을 배포합니다.

이 설정을 OS를 재부팅하지 않고 다시 반영하는 것이 목적입니다.

할 일



기본 DHCP 옵션 설정은 "Internet and VCN Resolver"라는 설정으로 OCI VCN의 내부 DNS 169.254.169.254를 참조하고,
검색 도메인으로 "[VCN DNS label].oraclevcn.com)"이 설정되어 있습니다.

기본적으로 VCN의 이름 확인과 외부 인터넷에 이름 확인이 가능한 상태이지만 엔터프라이즈 내부의 DNS 서버를 참조하도록 "Custom Resolver"로 변경하여 DNS 서버의 IP 주소를 지정하고, 검색 도메인을 'sample.local'로 변경합니다.

전제


  • OCI VCN 작성됨
  • OCI Compute OS 작성됨(Oracle Linux 7.7 및 Windows 2016)

  • OCI DHCP 옵션 변경


  • OCI VCN 설정을 열고 DHCP 옵션 아래 아래를 눌러 "편집"
  • '사용자 확인자'로 변경하고 모든 DNS 서버 IP 및 검색 도메인을 입력하십시오
  • 변경 사항 저장
  • (여담) DNS 서버의 지정은 3개까지. 검색 도메인은 상한 1개만・・!
  • 변경됨

  • Oracle Linux 7.7에서 DHCP 옵션 반영


  • OS에 로그인을 루트 사용자로 전환
  • 현재 설정 확인
  • $ sudo -i
    
    # cat /etc/resolv.conf 
    ; Any changes made to this file will be overwritten whenever the
    ; DHCP lease is renewed. To persist changes you must update the
    ; /etc/oci-hostname.conf file. For more information see
    ;[https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingDHCP.htm#notes]
    ;
    ; generated by /usr/sbin/dhclient-script
    search vcntokyo1.oraclevcn.com subdmz.vcntokyo1.oraclevcn.com ★ここが変わる
    nameserver 169.254.169.254 ★ここが変わる
    
  • dhclient 명령을 실행하여 DHCP 옵션을 반영합니다
  • 명령을 실행하고 돌아올 때까지 10 초 정도 걸립니다
  • 설정 확인
  • # dhclient
    
    # cat /etc/resolv.conf 
    ; Any changes made to this file will be overwritten whenever the
    ; DHCP lease is renewed. To persist changes you must update the
    ; /etc/oci-hostname.conf file. For more information see
    ;[https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingDHCP.htm#notes]
    ;
    ; generated by /usr/sbin/dhclient-script
    search sample.local ★変わった
    nameserver 192.168.250.250 ★変わった
    
  • dhclient 프로세스가 남아 있기 때문에 KILL
  • # ps ax |grep dhc
     1574 ?        Ss     0:00 /sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient-ad083c0c-3c81-XXXX-9d74-XXXXXXX-ens3.lease -pf /var/run/dhclient-ens3.pid -H bastion ens3
     3868 ?        Ss     0:00 dhclient
     3914 pts/0    S+     0:00 grep --color=auto dhc
    
    # kill 3868
    

    Windows Server 2016에서 DHCP 옵션 반영


  • 현재 설정 확인 (길기 때문에 일부 할애)
  • C:\Users\opc>ipconfig /all
    
    Windows IP Configuration
    
       Host Name . . . . . . . . . . . . : win1
       Primary Dns Suffix  . . . . . . . :
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
       DNS Suffix Search List. . . . . . : vcntokyo1.oraclevcn.com ★ここが変わる
    
    Ethernet adapter Ethernet:
    
       Connection-specific DNS Suffix  . : vcntokyo1.oraclevcn.com ★ここが変わる
       Description . . . . . . . . . . . : Broadcom NetXtreme-E Virtual Function
       Physical Address. . . . . . . . . : 02-00-17-00-1D-F7
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::1179:560f:c64f%2(Preferred)
       IPv4 Address. . . . . . . . . . . : 10.1.0.37(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Lease Obtained. . . . . . . . . . : Thursday, March 5, 2020 9:56:51 PM
       Lease Expires . . . . . . . . . . : Friday, March 6, 2020 9:56:51 PM
       Default Gateway . . . . . . . . . : 10.1.0.1
       DHCP Server . . . . . . . . . . . : 169.254.169.254
       DHCPv6 IAID . . . . . . . . . . . : 33685527
       DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-25-EE-DA-EC-02-00-17-00-1D-F7
       DNS Servers . . . . . . . . . . . : 169.254.169.254 ★ここが変わる
       NetBIOS over Tcpip. . . . . . . . : Disabled
    
  • ipconfig/renew 로 DHCP 옵션을 반영
  • 설정 확인
  • C:\Users\opc>ipconfig /renew
    
    C:\Users\opc>ipconfig /all
    
    Windows IP Configuration
    
       Host Name . . . . . . . . . . . . : win1
       Primary Dns Suffix  . . . . . . . :
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
       DNS Suffix Search List. . . . . . : sample.local ★変わった
    
    Ethernet adapter Ethernet:
    
       Connection-specific DNS Suffix  . : sample.local ★変わった
       Description . . . . . . . . . . . : Broadcom NetXtreme-E Virtual Function
       Physical Address. . . . . . . . . : 02-00-17-00-1D-F7
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::1179:560f:c64f%2(Preferred)
       IPv4 Address. . . . . . . . . . . : 10.1.0.37(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Lease Obtained. . . . . . . . . . : Thursday, March 5, 2020 9:56:51 PM
       Lease Expires . . . . . . . . . . : Friday, March 6, 2020 10:17:52 PM
       Default Gateway . . . . . . . . . : 10.1.0.1
       DHCP Server . . . . . . . . . . . : 169.254.169.254
       DHCPv6 IAID . . . . . . . . . . . : 33685527
       DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-25-EE-DA-EC-02-00-17-00-1D-F7
       DNS Servers . . . . . . . . . . . : 192.168.250.250 ★変わった
       NetBIOS over Tcpip. . . . . . . . : Disabled
    

    참고


  • DHCP 옵션
  • htps : // / cs. cぉd. 오라 cぇ. 코 m/쟈-jp/아아 s/콘텐 t/네토 ぉrk/타 sks/마나긴 gDHCP. htm
  • 좋은 웹페이지 즐겨찾기