Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Network Troublshooting => General Networking Support in Linux => Topic started by: naresh on June 16, 2011, 01:30:25 PM

Title: changing IP Address thru ifconfig utility
Post by: naresh on June 16, 2011, 01:30:25 PM
I tried using "ifconfig eth0 192.168.0.201 up" command to change my ip address from 192.168.0.210 to 192.168.0.201 and it got changed, I confirmed it by using "ifconfig eth0" command, but when i entered "neat" command i found out that the ip address still remained 192.168.0.210. I want to know the reason why..??
Title: Re: changing IP Address thru ifconfig utility
Post by: linux1986 on September 19, 2011, 11:16:30 AM
You can edit the network script and restart the network demon

vi /etc/sysconfig/network-scripts/ifcfg-eth0 and edit it

and restart network service



Title: Re: changing IP Address thru ifconfig utility
Post by: naresh on January 22, 2012, 06:07:51 AM
I am really thankful to everyone who responded my query.
But i need to know that DO I have to restart the service every time when i change my ip address.
Is neat utility not updated with the ifconfig command ?
And manually editing a network script everytime is a little bit tedious job and for that you will have to remember the exact path of the file too.
Anyways thanks for your reply.
Title: Re: changing IP Address thru ifconfig utility
Post by: ManiDhillon on January 22, 2012, 11:47:46 AM
How is IP address assigned to your card in first place?
Through dhcpd or through any router you are using with it?

Because if your router is assigning you the ip then this won't help you and you have to stop the DHCP server on your router.
If you are using manual ip assignment then you best use a dhcp server on your machine and assign the required parameters to it.
And before running the link up you should first shut it down with
$ ifconfig eth0 down
Title: Re: changing IP Address thru ifconfig utility
Post by: naresh on January 25, 2012, 12:57:34 PM
Thanks ManiDhillon
But in my case I need to assign IP address manually to the clients but what the tragic is that when i use a command
say "ifconfig eth0 192.168.0.201 up" it gets changed but if i go to the neat utility it does not come up. The neat utility shows the previous IP address which is "192.168.0.210" So therefore I am in a confusion why it is so ?
Title: Re: changing IP Address thru ifconfig utility
Post by: ManiDhillon on January 26, 2012, 12:30:38 AM
So do you out down the ethernet interface before putting it up with new ip?
$ ifconfig eth0 down
$ifconfig eth0 192.168.1.* up
And try restarting the network service.