How to change local IP address?

I have a new Ethernet device that has a default IP address on a different subnet and need to change it. I have a Debian 6.0 host connected to the device with a crossover cable and have changed the host /etc/hosts and /etc/networks files to the same subnet as the new device and rebooted. Ping reports the device is unreachable and shows the host is still on the old subnet. What other files have to be changed to change the IP address?

Check your man page for ifconfig BEFORE you type this, I have not done this for a while:

ifconfig eth0 192.168.2.2 netmask 255.255.255.0 broadcast 192.168.2.255

eth0 is the nic, netmask is the subnet; broadcast is optional see what ifconfig -a shows beforehand.

then try

ifconfig eth0 up
1 Like

The ifconfig command worked! I discovered the /etc/network/interfaces file could have been edited also.

Thanks for the help!