Originally Posted by rcmonroig
Trying to change my ip address from 10.0.2.23 to 192.168.105.22 on my centos 6 system.
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:
service network stop
service network start