Koozali.org: home of the SME Server

change IP address of client

Offline nicolasdiogo

  • **
  • 22
  • +0/-0
change IP address of client
« on: October 05, 2007, 12:37:20 AM »
hello,

i have installed vmware on SME,
and i am now planning to run glassfish on a ubuntu server installation.

however, this vm is setup on dhcp mode and it uses the ip provided by the dhcp server (x.x.x.94).
i have added all those necessary details of this vm to the hostname and addresses tab of SME and set the IP to be x.x.x.150, rebooted SME but the vm still has the original IP x.x.x.94.

any idea as to how i can change the IP for this vm on the dhcp?

many thanks

Offline TrevorB

  • *
  • 259
  • +0/-0
    • http://www.batley.id.au
Re: change IP address of client
« Reply #1 on: October 05, 2007, 01:59:56 AM »
however, this vm is setup on dhcp mode and it uses the ip provided by the dhcp server (x.x.x.94).
i have added all those necessary details of this vm to the hostname and addresses tab of SME and set the IP to be x.x.x.150, rebooted SME but the vm still has the original IP x.x.x.94.
And how have you setup the network for this vm? Is it bridged or nat'ed or hostonly?

If it is nat'ed or hostonly, the IP address is being supplied by the VMWare dhcp server and not by your smeserver. If it is bridged, then it will be obtaining it's IP from the smeserver.

Trevor B

Offline nicolasdiogo

  • **
  • 22
  • +0/-0
Re: change IP address of client
« Reply #2 on: October 05, 2007, 08:32:59 AM »
thanks,

it is bridged NIC.
that is why ii do not understand why the dhcp is not working as it does with the other pcs.


Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: change IP address of client
« Reply #3 on: October 05, 2007, 08:45:35 AM »
thanks,

it is bridged NIC.
that is why ii do not understand why the dhcp is not working as it does with the other pcs.


Did you specify t he correct MAC address? you need the MAC Address of the virtual network adapter from the Ubuntu server, not the MAC address of the hardware NIC. Normally you can obtain this with ifconfig ethx where you have to replace x with a number from 0 up, but I have no Ubuntu knowledge...
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline nicolasdiogo

  • **
  • 22
  • +0/-0
Re: change IP address of client
« Reply #4 on: October 05, 2007, 10:53:24 AM »
that is what i am doing.
ifconfig eth0
gives me the ip (x.x.x.94)
and MAC number

copying the MAC number into SME hostname and address tab.

then in ubuntu ifdown eth0

waiting a little..

then ifup eth0
and i get ip (x.x.x.94)

it is really odd.

how can i refresh the dhcp template?
« Last Edit: October 05, 2007, 11:14:23 AM by nicolasdiogo »

Offline TrevorB

  • *
  • 259
  • +0/-0
    • http://www.batley.id.au
Re: change IP address of client
« Reply #5 on: October 05, 2007, 11:56:28 AM »
how can i refresh the dhcp template?
Doing a save on the Hostnames and Addresses page will do that 'automagically'.

You can look at the dhcpd.conf file (more /etc/dhcpd.conf) to verify and you can look in /var/log/dhcpd/current to see what happened. You should see some lines like
Code: [Select]
DHCPDISCOVER from nn:nn:nn:nn:nn:nn via eth0
DHCPOFFER on x.x.x.150 to nn:nn:nn:nn:nn:nn (hostname) via eth0
DHCPREQUEST for x.x.x.150 from nn:nn:nn:nn:nn:nn (hostname) via eth0
DHCPACK on x.x.x.150 to nn:nn:nn:nn:nn:nn (hostname) via eth0
If you just see a DHCPOFFER follwed by a DHCPACK with no hostname part, it is not recognising your mac.

BTW. is x.x.x.150 outside of the dynamically assigned range? If not, you are likely to have some conflicts.

Trevor B

Offline nicolasdiogo

  • **
  • 22
  • +0/-0
Re: change IP address of client
« Reply #6 on: October 05, 2007, 01:46:04 PM »

> BTW. is x.x.x.150 outside of the dynamically assigned range? If not, you are likely to have some conflicts.

it maybe the problem since the ip within the dynamic range.
i have setup the server using the admin - configuration wizard for this card so it is giving out 256 address for the range and x.x.x.150 is among them.

but i also have other pcs with assigned ip and they work fine in the same ip range.

thus i will check the logs and come back to you.

many thanks

Offline nicolasdiogo

  • **
  • 22
  • +0/-0
Re: change IP address of client
« Reply #7 on: October 05, 2007, 10:05:00 PM »
hi,

something odd.

i checked the logs as suggested and the vmware ubuntu is receiving the current x.x.x.94 and it is properly identified on the log with MAC address pc name and all.

but when i look in /etc/dhcpd.conf

i find all pcs listed on the hostnames and address shown on the front end EXCEPT (guess!?) the ubuntu.

i have tried to delete reboot reenter it on the hostname and address but it does appear on this file.

should it be listed elsewhere in a different file for the dhcp server?

i am really confused about this.

many thanks for your assistance
« Last Edit: October 05, 2007, 10:54:32 PM by nicolasdiogo »

Offline TrevorB

  • *
  • 259
  • +0/-0
    • http://www.batley.id.au
Re: change IP address of client
« Reply #8 on: October 05, 2007, 11:57:12 PM »
i have setup the server using the admin - configuration wizard for this card so it is giving out 256 address for the range and x.x.x.150 is among them.

but i also have other pcs with assigned ip and they work fine in the same ip range.
It will work fine most of the time, but if you have a device with a statuc IP turned off for a while and the dhcp then assigns that address from it's pool to another device, when you turn that device back on, it won't be able to get it's address (ie. the hostnames panel doesn't reserve these addresses, it just allocates them).

You can always change the range of dynamically allocated IP's to something else (eg. 101-199 if you don't need many, or 11-250 if you need lots) and then use IP's outside of that range for your 'static' devices.

Trevor B

Offline TrevorB

  • *
  • 259
  • +0/-0
    • http://www.batley.id.au
Re: change IP address of client
« Reply #9 on: October 06, 2007, 12:03:44 AM »
i find all pcs listed on the hostnames and address shown on the front end EXCEPT (guess!?) the ubuntu.

i have tried to delete reboot reenter it on the hostname and address but it does appear on this file.
Then you have a problem.

Does the ubuntu box appear on the hostnames screen?

If it does, then somehow the expand-template is NOT working correctly (and you may have found a bug).

Quote from: nicolasdiogo
should it be listed elsewhere in a different file for the dhcp server?
No. This is the correct place.

This looks like it should go to the bug tracker, but I'd like  to get you to do one more thing first.
Code: [Select]
expand-template /etc/dhcpd-confAnd see if there are any errors.

Trevor B

Offline nicolasdiogo

  • **
  • 22
  • +0/-0
Re: change IP address of client
« Reply #10 on: October 06, 2007, 10:10:51 AM »
hi,

i tried your command this is what i get back:

ERROR: No templates were found for /etc/dhcpd-conf.
 at /sbin/e-smith/expand-template line 45

what to do next.

Offline TrevorB

  • *
  • 259
  • +0/-0
    • http://www.batley.id.au
Re: change IP address of client
« Reply #11 on: October 07, 2007, 02:02:44 AM »
ERROR: No templates were found for /etc/dhcpd-conf at /sbin/e-smith/expand-template line 45
Sorry, typo on my behalf. :oops:
Code: [Select]
expand-template /etc/dhcpd.confTrevor B