change ip by command line
I am using suse 10.1 with static ip address 192.168.40.100.
And I want to change ip by command line permanently.How can I do? |
Which distro are you using? See if you have a /etc/sysconfig/network/ifcfg-eth0 file. You need to su to root to edit it. ( Note: I'm guessing that your interface is named eth0 )
Change the IP address listed after "IPADDR=". Quote:
|
/sbin/ifconfig eth0 new.ip.goes.here
this will only change it for the time being, at reboot it gets reset to the ip in sysconfig/ifcfg-eth0 (above) |
Hi,
Can someone help me and tell me how to implement this on Ubuntu? I have been taking a look at /etc/sysctl.conf, /etc/init.d/networking and the different files in /etc/network but I haven't yet been able to figure out how to do this permanently. Thanks a lot Sudipta |
can't tell you exactly where it is, but likely in /etc/sysconfig/network-scripts there will be a file ifcfg-eth0.
Edit that file to the new ip. If you need details on how to do it, post that file here and I'll help you. |
Umm.. nothing like /etc/sysconfig in Ubuntu. Any pointers to what the equivalent of that directory is in Ubuntu?
|
as root do: updatedb
then do: locate ifcfg so edit ifcfg-eth0 (post it if you still need help) |
Quote:
Thanks for the help. Even after the updatedb nothing was found: even tried a find . -name and left it for 2 hours to come back with no such file. However, I found what I was looking for: as it turns out, Ubuntu systems use /etc/network/interfaces to maintain ip addresses and all, and so I edited that file manually and could get the system to change its ip address. :) Thanks for all the help, though: I appreciate |
glad you got it :)
|
All times are GMT -5. The time now is 05:31 PM. |