PDA

View Full Version : [ubuntu] How can run a instruction automaticly when Ubuntu12.04 starting up??



levinie001
September 2nd, 2012, 09:51 AM
I want to run "sudo ifconfig eth0 192.168.64.3" automaticly when my VM starting up.

ajgreeny
September 2nd, 2012, 10:50 AM
I want to run "sudo ifconfig eth0 192.168.64.3" automaticly when my VM starting up.
Add that command without the sudo prefix to your /etc/rc.local file, just above the "exit 0" line.

rubylaser
September 2nd, 2012, 11:48 AM
If you are just trying to set a static ip on eth0, why don't you just make an entry in /etc/network/interfaces for the interface?

xdracco
September 2nd, 2012, 04:56 PM
Add ethernet configuration to /etc/network/interfaces as mentioned above then restart networking.