Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Trying to change my ip address from 10.0.2.23 to 192.168.105.22 on my centos 6 system.
I run
ip link set eth0 down
ip addr add 192.168.105.22 dev eth0
ip link set eth0 up
service network restart
Then I run ifconfig and the ip address
is 10.0.2.23 same as before -- no change
This should be pretty straight forward. Am I missing something here?
After running the blue part the ip is changed, but the green part takes its input from ifcfg-eth0 to restart the network. ifcfg-eth0 still contains the original settings.
If you want to permanently change you ip you need to edit /etc/sysconfig/network-scripts/ifcfg-eth0:
Code:
service network stop
edit ifcfg-eth0
service network start
Distribution: Red Hat Enterprise Linux Server release 6.0 (Santiago)
Posts: 18
Rep:
Quote:
Originally Posted by druuna
After running the blue part the ip is changed, but the green part takes its input from ifcfg-eth0 to restart the network. ifcfg-eth0 still contains the original settings.
If you want to permanently change you ip you need to edit /etc/sysconfig/network-scripts/ifcfg-eth0:
Code:
service network stop
edit ifcfg-eth0
service network start
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.