VMware player NAT port forwarding 설정 (vmnetnat.conf 설정)
VMware player로 NAT 네트워크의 port forwarding 설정
윈도우즈용 VMware player는 VMware Network editor 툴이 지원되지 않으므로, NAT 포트포워딩을 설정하려면 사용자가 수동으로 설정 파일인 vmnetnat.conf 를 편집해야 한다.
vmware network editor
* vmnetnat.conf 파일 위치 : C:\ProgramData\VMware\vmnetnat.conf
vmnetnat.conf 파일을 편집기로 열어보면 다음과 같은 내용이 보인다.
# Windows NAT configuration file
[host]
# NAT gateway address
ip = 192.168.52.2/24
hostMAC = 00:52:57:C1:00:48
...생략...
[incomingtcp]
# Use these with care - anyone can enter into your virtual machine through these...
# FTP (both active and passive FTP is always enabled)
# ftp localhost 8887
#8887 = 192.168.27.128:21
# WEB (make sure that if you are using named webhosting, names point to
# your host, not to guest... And if you are forwarding port other
# than 80 make sure that your server copes with mismatched port
# number in Host: header)
# lynx http://localhost:8888
#8888 = 192.168.27.128:80
# SSH
# ssh -p 8889 root@localhost
#8889 = 192.168.27.128:22
[incomingudp]
# UDP port forwarding example
#6000 = 192.168.27.128:6001
[PrivilegedTCP]
autodetect = 1
[PrivilegedUDP]
autodetect = 1
NAT 포트포워딩 설정 방법은 incommingtcp나 incommingudp 항목에 "host port number = guest address:port" 로 지정한다. 예시가 몇 개 있으니까 예시를 살펴보자.
예를 들어 8889 = 192.168.27.128:22 항목은 윈도우즈 호스트의 8889번 포트로 접속하면 게스트의 192.168.27.128:22 포트로 포워딩 시켜준다는 것이다. 따라서 putty로 호스트 주소의 8889번 포트로 접속하면 게스트 OS의 ssh에 접속할 수 있다. 만일 접속이 잘 안되면 윈도우즈 방화벽 설정 때문일 수 있다.
일반적으로 설정 후엔 VMware 네트워크 서비스를 재시작해주면 되지만, 서비스 재시작 방법을 잘 모른다면 윈도우즈를 재시작 해주면 된다.