2016년 7월 28일 목요일

[VMWare] VMWare Network Option

VMware에서 네트웍을 사용할때 host-only, bridged, NAT 방식이 있다.
host-only는 VMware가 깔리는 머신과 가상머신사이에만 통하는 네트웍이고
bridge는 VMware가상머신이 VMware host머신과 같은 네트웍상에서 똑같이 real ip상에서 동작하도록 하는것이며
NAT방식은 VMware가 자체적으로 내부네트웍대역을 할당하고 자체 DHCP서버도 띄워서 NAT기능을 지원하는것이다.

VMware는 안쓰는 NAT대역을 자동으로 할당하는데 만약 192.168.19.* 식으로 NAT 대역이 할당되면
192.168.19.1 은 host머신의 ip가 되고
192.168.19.2는 가상머신에서 gateway,DNS로 설정되며
192.168.19.3~127 까지는 수동으로 설정하는 ip대역이되며
192.168.19.128~254 는 VMware의 자체 DHCP가 자동으로 할당하는 대역이다.
DHCP를 쓰려면 가상머신에서 DHCP로 설정하면 자동으로 ip와 gateway,DNS정보를 받아서 설정되고,
수동으로 아이피를 설정한다면 gateway,DNS를 192.168.19.2로 수동으로 설정해줘야한다.
그렇지 않으면 외부인터넷을 쓸수 없게 된다.

LINUX가 가상머신이라면 (Redhat 기준)
/etc/sysconfig/network에
NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.19.2
GATEWAYDEV=eth0
위처럼 GATEWAY를 192.168.19.2 로 설정해야 된다.

그리고 /etc/resolv.conf 에는
nameserver 192.168.19.2
처럼 DNS도 192.168.19.2 로 설정해야된다.

그리고 NAT환경에서는 가상머신에서 돌리는 http,ftp등의 서비스는 외부 인터넷에서 접속하지 못하는데
vmware의 NAT은 port 포워딩을 통해 가상머신의 서비스에 접속할 수 있도록 해준다.
호스트 머신이 windows라면 c:\winnt\system32\vmnetnat.conf 파일에서
[incomingtcp]
8888 = 192.168.19.129:80
[incomingudp]
6000 = 192.168.19.129:6001

이런식으로 host머신의 8888로 들어오는 요청은 가상머신의 80번 으로 포워딩하고
6000으로 들어오는 요청은 6001으로 포워딩하게 한다.
만약에 가상머신 80에 web서비스가 돌아간다면 host머신의 ip의 8888포트로 접근하면 가상머신의 web서비스를 이용할 수 있는것이다.

출처:http://bbs.kldp.org/viewtopic.php?t=1052
출처:http://cafe.naver.com/secureos.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=52
==================================================================================
VM 의 도움말
In this panel, you can change your virtual network adapter (NIC) and add additional virtual network adapters.
Under Device status:
Connected ? Check or uncheck this option while the virtual machine is running to connect or disconnect the virtual network adapter.
Connect at power on ? Check this option if you want the virtual network adapter to automatically connect to the virtual machine when it powers on. If you do not check this option, the network adapter is not available to the virtual machine when it first powers on.
Under Network connection, you can choose:
Bridged ? If the host computer is on an Ethernet network, bridged networking is often the easiest way to give your virtual machine access to that network. With bridged networking, the virtual machine appears as an additional computer on the same physical Ethernet network as the host. A virtual machine with bridged networking may transparently use any of the services available on the network to which it is bridged, including file servers, printers, gateways and so on. Likewise, any physical host or other virtual machine configured with bridged networking can use resources of that virtual machine.
NAT (Network Address Translation) ? If you want to connect to the Internet or other TCP/IP network using the host computer's dial-up networking connection and you are not able to give your virtual machine an IP address on the external network, this is often the easiest way to give the virtual machine access to that network. The virtual machine does not have its own IP address on the external network. Instead, a separate private network is set up on the host computer. The virtual machine obtains an address on that network from the VMware virtual DHCP server.
Host-only ? When you use this type of network connection, the virtual machine is connected to the host operating system on a virtual private network, which normally is not visible outside the host. Multiple virtual machines configured with host-only networking on the same host are on the same network.
Custom ? If you want to set up a more complex networking configuration, select Custom for one or more of the virtual network adapters. After selecting Custom, choose a virtual switch (VMnet2-VMnet7or VMnet9) from the drop-down list. This connects your virtual machine's adapter to that switch. All virtual machines running on the same host computer and connected to the same virtual switch are on the same virtual network.
If the virtual machine is part of a team, you have the option of connecting the virtual NIC to a team LAN segment, a virtual private network for the team. To connect to a team LAN segment, select Team: LAN segment. Use the drop-down menu to specify the team LAN segment to which you want to connect. For more information on configuring team LAN segments, see LAN Settings.
Note: NICs configured with connections through a DHCP server cannot connect to a team LAN segment.
Note: A virtual NIC can connect to only one LAN segment at a time. To connect a virtual machine to multiple LAN segments, the virtual machine must be configured with multiple NICs.
If you are adding a new virtual NIC, click Add to install the device.
To remove an existing virtual NIC, select that NIC, then click Remove.
Click OK to save the configuration and close the virtual machine settings editor.

댓글 없음:

댓글 쓰기