Changing Machine IP address

Hopefully someone can help with this. I need the command to change the IP address on a machine

please post the os details

if it is linux/unix, and eth0 is your ethernet adapter

ifconfig eth0 <ip-address>

also check out the following commands

netconf

netconfig

are you keeping to same hostname?
If yes then you just need to change 2 things:
/etc/hosts (make sure you remove your old ip and put in your new one.)
and you need to use "ifconfig" please refer to the man page for the syntax.

If you are also changeing your hostname then in addition to the above you also need to edit /etc/hostname.(interface) and put in your new hostname.

you can also change the ip addresses of different ethernet adapters by modifying the following files

/etc/sysconfig/network-scripts/ifcfg-eth0

for eth0. replace the eth0 by whatever interface name you wanna modify

Hi kkinnon,

What OS are you running? Depending on which Unix you run there are a couple of different ways to change your IP.

u can use the 'set_parms initial' for HP unix

For HPUX, you only need to change 2 places. I recently did this when my systems changed this when new routers were installed on my network with a different IP address scheme.

/etc/hosts

/etc/rc.config.d/netconf

These are the two places you need to change it.

Then you can check it by running.

netstat -rn

Look for your primary lan card. In most cases, it is lan0.

Also remember, if you have any security that runs, that piece will need to be updated. In my case that was a mandatory step for users to login at all.

Hope this helps.

My brain is your brain... :smiley: