VMware Communities
badouglas11
Contributor
Contributor

Allowing a VM/Appliance to have a unique IP address

Hi.

[Running VMWare VM Player 4.02, Centos6 (as the guest OS), Fedora 13 on the host.]

I've managed to create a Centos based VM using the script/commandline process, without the VM Player GUI.

When the VM/Appliance app is configured to have the bridged NIC, the guest connects with the host system. If the guest is configured to be NAT, the guest can't connect with the host.

When the guest is NAT, the guest has an IP from ifconfig, of 192.168.12.128/eth0

When the guest is bridged, the guest has an IP from ifconfig of 192.168.1.27/eth0

I'm trying to figure out how to allow the guest to connect with the host, if the host is using dchp.

I'm also trying to solve a larger issue, of how an Appliance/Guest VM can be set with a dynamic IP so it doesn't

conflict with the host system the guest is running on.

Ie, if I create a guest/Appliance app that users can download/run on their own systems, the guest/appliance app willl need to be able to grab/initiate an IP address that will allow the appliance/guest to communicate with the external 'net, and at the same time, not conflict with the host system.

Thoughts/Pointers would be useful on this. (A lot of different articles, but nothing I've seen that are directly on point)

Thanks

The host always has (via ifconfig)

#ifconfig
eth0      Link encap:Ethernet  HWaddr B8:AC:6F:67:DC:BD 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:30

eth1      Link encap:Ethernet  HWaddr 70:F1:A1:5E:78:34 
          inet addr:192.168.1.45  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::72f1:a1ff:fe5e:7834/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:18000379 errors:0 dropped:0 overruns:0 frame:6442121
          TX packets:13931211 errors:161238 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2382505338 (2.2 GiB)  TX bytes:1907801567 (1.7 GiB)
          Interrupt:17

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:37072 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37072 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:170262998 (162.3 MiB)  TX bytes:170262998 (162.3 MiB)

virbr0    Link encap:Ethernet  HWaddr 46:AF:B1:8B:D9:FF 
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1919 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:91972 (89.8 KiB)

vmnet1    Link encap:Ethernet  HWaddr 00:50:56:C0:00:01 
          inet addr:192.168.208.1  Bcast:192.168.208.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

vmnet8    Link encap:Ethernet  HWaddr 00:50:56:C0:00:08 
          inet addr:192.168.12.1  Bcast:192.168.12.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:305 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Using wireless, so eth1 is the nic for the host.

The host is running

/usr/bin/vmware-networks --start

the dhcp.conf file is listed below:

dhcp.conf::

----------------------------------------------------------------------------------------------------------------------------------------------

# Configuration file for ISC 2.0 vmnet-dhcpd operating on vmnet8.
#
# This file was automatically generated by the VMware configuration program.
# See Instructions below if you want to modify it.
#
# We set domain-name-servers to make some DHCP clients happy
# (dhclient as configured in SuSE, TurboLinux, etc.).
# We also supply a domain name to make pump (Red Hat 6.x) happy.
#


###### VMNET DHCP Configuration. Start of "DO NOT MODIFY SECTION" #####
# Modification Instructions: This section of the configuration file contains
# information generated by the configuration program. Do not modify this
# section.
# You are free to modify everything else. Also, this section must start
# on a new line
# This file will get backed up with a different name in the same directory
# if this section is edited and you try to configure DHCP again.

# Written at: 11/14/2010 12:55:12
allow unknown-clients;
default-lease-time 1800;                # default is 30 minutes
max-lease-time 7200;                    # default is 2 hours

subnet 192.168.12.0 netmask 255.255.255.0 {
    range 192.168.12.128 192.168.12.254;
    option broadcast-address 192.168.12.255;
    option domain-name-servers 192.168.12.2;
    option domain-name localdomain;
    default-lease-time 1800;                # default is 30 minutes
    max-lease-time 7200;                    # default is 2 hours
    option routers 192.168.12.2;
}
host vmnet8 {
    hardware ethernet 00:50:56:C0:00:08;
    fixed-address 192.168.12.1;
    option domain-name-servers 0.0.0.0;
    option domain-name "";
    option routers 0.0.0.0;
}
####### VMNET DHCP Configuration. End of "DO NOT MODIFY SECTION" #######

Tags (2)
0 Kudos
1 Reply