가상화/VMware

[VMware_ESXi] https 443 포트 변경 (8버전)

콧물도련님 2023. 6. 30. 16:40

[소개]

VMware ESXi의 https default port 443을 10022 변경한다.

port 변경으로 보다 관리하기 용이하게 진행한다. 

 

[실습 내용]

VMware ESXi https 포트 변경 

 

[실습 환경]

VMware ESXi 8.0

※VMware 8버전 이상부터 파일의 대한 w 권한이 없으며, 구성 파일을 직접 기입해서 넣어줘야 한다.

 

[실습]

1. ESXi SSH 서비스 활성

- 콘솔 화면 -> F2 Customize System/View Logs

- Troubleshooting Mode Options -> Disable ESXi Shell

 

2. 접속 후 원하는 포트 등록

cat >> proxy.json << __PROXY__
{
   "proxy": {
      "http_port": 8080,
      "https_port": 10022
   }
}
__PROXY__

- http port = 8080 설정 / - https port = 10022 설정

 

3. rhttpproxy 파일 등록

# configstorecli config current set -c esx -g services -k rhttpproxy -infile proxy.json

#configstorecli config current get -c esx -g services -k rhttpproxy

 

4. rhttpproxy 데몬 재시작

#/etc/init.d/rhttpproxy restart

 

5. 방화벽 설정

#vi /etc/rc.local.d/local.sh

cat > /etc/vmware/firewall/custom-rhttpproxy <<EOF

<ConfigRoot>

  <service>

    <id>custom-rhttpproxy</id>

    <rule id='0000'>

      <direction>inbound</direction>

      <protocol>tcp</protocol>

      <porttype>dst</porttype>

      <port>10022</port>

    </rule>

    <enabled>true</enabled>

    <required>false</required>

  </service>

</ConfigRoot>

EOF

 

localcli network firewall refresh

- 재부팅 후에도 방화벽 10022,8080 open 상태로 저장 후 방화벽 데몬 재시작 명령어

 

6. 변경 된 포트로 https 접속

 

※방화벽 포트 확인 방법

#localcli network firewall ruleset rule list 

ex)