VMware Cloud Community
foxy1977
Contributor
Contributor

Changing HQ IP address to a static address?

Hi folks,

Just wondering if there is an easy way to change the IP address of the HQ vmware appliance to a static address. I have installed it and it is running fine but need to change the setup of the box from a DHCP address to a static address.

Any tips greatly received!! I'm new to linux so not up to speed on knowing my way around the linux command line!

Thanks
0 Kudos
10 Replies
ama_hyperic
Hot Shot
Hot Shot

Hi,

The Vmware appliance is running debian underneath. Here is a tutorial to walk you through the process:
http://www.cyberciti.biz/tips/howto-ubuntu-linux-convert-dhcp-network-configuration-to-static-ip-con...

-Alex.
0 Kudos
foxy1977
Contributor
Contributor

Hi Alex,

thanks for that. I have tried that and edited the file ok. I used Pico to edit the file. Should i be using something else?

When I try and restart the network interfaces or reboot the server i get an error saying could not read networking/interfaces - failed and then i cannot access the server over the web browser.
0 Kudos
admin
Immortal
Immortal

Fox,

Try:

/sbin/ifconfig eth0


You can specify other options like:

/sbin/ifconfig eth0 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255

Type:
man ifconfig

To see all of the options and sytax.

--jeremy
0 Kudos
foxy1977
Contributor
Contributor

Just tried:

/sbin/ifconfig eth0 192.168.1.31 netmask 255.255.255.0

That reported no errors. I rebooted the box but i was then unable to access the server via the web browser on either the original or old IP address.

Any one any suggestions? This is really frustrating!

Thanks for the help so far
0 Kudos
AFatManInSpecta
Contributor
Contributor

Hi John,

That command will only change the current ip address of eth0. To make the
change persistent across reboots you have to edit the following file
/etc/network/interfaces.

Please 'cat /etc/network/interfaces' and post the output here so that we can
see what is wrong with it.

Rgds
Simon.

> -----Original Message-----
> From: hq-users-bounces@hyperic.org [mailto:hq-users-bounces@hyperic.org]
> On Behalf Of fox1977
> Sent: 16 July 2008 10:11
> To: hq-users@hyperic.org
> Subject: Re: Changing HQ IP address to a static address?
>
> Just tried:
>
> /sbin/ifconfig eth0 192.168.1.31 netmask 255.255.255.0
>
> That reported no errors. I rebooted the box but i was then unable to
> access the server via the web browser on either the original or old IP
> address.
>
> Any one any suggestions? This is really frustrating!
>
> Thanks for the help so far
>
> --
> This message has been scanned for viruses and
> dangerous content by Houxou, and is
> believed to be clean.



0 Kudos
foxy1977
Contributor
Contributor

Hi

when i run the cat command it returns:

iface eth0 inet static
address 192.168.1.31
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.27

When i try and run etc/init.d/networking restart i get the error:
reconfiguring network interfaces.../etc/interfaces:2: misplaced option
ifdown: couldnt read interface file "/etc/network/interfaces"
/etc/network/interfaces:2: misplaced option
ifup: couldnt read interface file "/etc/network/interfaces"
failed

Thanks for the assistance
0 Kudos
AFatManInSpecta
Contributor
Contributor

Try removing the spaces before the options...

I.e.

iface eth0 inet static
address 192.168.1.31
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.27


> -----Original Message-----
> From: hq-users-bounces@hyperic.org [mailto:hq-users-bounces@hyperic.org]
> On Behalf Of fox1977
> Sent: 16 July 2008 13:36
> To: hq-users@hyperic.org
> Subject: Re: RE: Changing HQ IP address to a static address?
>
> Hi
>
> when i run the cat command it returns:
>
> iface eth0 inet static
> address 192.168.1.31
> netmask 255.255.255.0
> network 192.168.1.0
> gateway 192.168.1.27
>
> When i try and run etc/init.d/networking restart i get the error:
> reconfiguring network interfaces.../etc/interfaces:2: misplaced option
> ifdown: couldnt read interface file "/etc/network/interfaces"
> /etc/network/interfaces:2: misplaced option
> ifup: couldnt read interface file "/etc/network/interfaces"
> failed
>
> Thanks for the assistance
>
> --
> This message has been scanned for viruses and
> dangerous content by Houxou, and is
> believed to be clean.



0 Kudos
foxy1977
Contributor
Contributor

Just removed the spaces. Still getting the error saying could not read file.

Thanks
0 Kudos
AFatManInSpecta
Contributor
Contributor

Check the file permissions - I don't know what they should be but it is
possible that they are not correct.

> -----Original Message-----
> From: hq-users-bounces@hyperic.org [mailto:hq-users-bounces@hyperic.org]
> On Behalf Of fox1977
> Sent: 18 July 2008 15:07
> To: hq-users@hyperic.org
> Subject: Re: RE: RE: Changing HQ IP address to a static address?
>
> Just removed the spaces. Still getting the error saying could not read
> file.
>
> Thanks
>
> --
> This message has been scanned for viruses and
> dangerous content by Houxou, and is
> believed to be clean.



0 Kudos
foxy1977
Contributor
Contributor

Hi folks,

Managed to restart the interface with the new IP address. The problem was down to pico wrapping the comment lines. I removed a couple of hard returns and I was able to restart the interface without the error.

Now I am having a problem access the server via the web browser!!! I changed the address to 192.168.1.31. After rebooting the box and watching it come back up I cannot get onto it. When i run cat interfaces i get:

iface eth0 inet static
address 192.168.1.31
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.27

Anyone any ideas
0 Kudos